Skip to content

Commit

Permalink
Rename "--nroff-xxx" arguments as "--roff-xxx".
Browse files Browse the repository at this point in the history
This is a change long in coming.  Historically, the use of "nroff"
was because -tman was the output choice, and -tman is mostly used
with nroff for formatting to a terminal.

The use of "roff" is because both -tms and -tman are roff(7)
macros processed by nroff.  So name the argument in favour of the
language, not the tool.

The old prefix is retained and will not go away.
  • Loading branch information
kristapsdz committed Dec 13, 2024
1 parent 9f07635 commit 46c8118
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 47 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ $(PDFS) index.xml README.xml: lowdown
index.html README.html: template.xml

.md.pdf:
./lowdown --nroff-no-numbered -s -tms $< | \
./lowdown --roff-no-numbered -s -tms $< | \
pdfroff -i -mspdf -t -k > $@

index.latex.pdf: index.md $(THUMBS)
Expand All @@ -263,11 +263,11 @@ index.latex.pdf: index.md $(THUMBS)
pdflatex index.latex.latex

index.mandoc.pdf: index.md
./lowdown --nroff-no-numbered -s -tman index.md | \
./lowdown --roff-no-numbered -s -tman index.md | \
mandoc -Tpdf > $@

index.nroff.pdf: index.md
./lowdown --nroff-no-numbered -s -tms index.md | \
./lowdown --roff-no-numbered -s -tms index.md | \
pdfroff -i -mspdf -t -k > $@

.xml.html:
Expand All @@ -286,7 +286,7 @@ diff.diff.html: diff.md diff.old.md lowdown-diff
./lowdown-diff -s diff.old.md diff.md >$@

diff.diff.pdf: diff.md diff.old.md lowdown-diff
./lowdown-diff --nroff-no-numbered -s -tms diff.old.md diff.md | \
./lowdown-diff --roff-no-numbered -s -tms diff.old.md diff.md | \
pdfroff -i -mspdf -t -k > $@

$(HTMLS): versions.xml lowdown
Expand Down
49 changes: 34 additions & 15 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,21 +299,21 @@ main(int argc, char *argv[])
{ "latex-skiphtml", no_argument, &afl, LOWDOWN_LATEX_SKIP_HTML },
{ "latex-no-skiphtml", no_argument, &rfl, LOWDOWN_LATEX_SKIP_HTML },

{ "nroff-traditional", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "nroff-no-traditional",no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "nroff-no-groff", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "nroff-groff", no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "nroff-nolinks", no_argument, &afl, LOWDOWN_NROFF_NOLINK },
{ "nroff-no-nolinks", no_argument, &rfl, LOWDOWN_NROFF_NOLINK },
{ "nroff-numbered", no_argument, &afl, LOWDOWN_NROFF_NUMBERED },
{ "nroff-no-numbered", no_argument, &rfl, LOWDOWN_NROFF_NUMBERED },
{ "nroff-shortlinks", no_argument, &afl, LOWDOWN_NROFF_SHORTLINK },
{ "nroff-no-shortlinks",no_argument, &rfl, LOWDOWN_NROFF_SHORTLINK },
{ "nroff-skiphtml", no_argument, &afl, LOWDOWN_NROFF_SKIP_HTML },
{ "nroff-no-skiphtml", no_argument, &rfl, LOWDOWN_NROFF_SKIP_HTML },
{ "nroff-endnotes", no_argument, &afl, LOWDOWN_NROFF_ENDNOTES },
{ "nroff-no-endnotes", no_argument, &rfl, LOWDOWN_NROFF_ENDNOTES },
{ "nroff-code-font", required_argument, NULL, 7 },
{ "roff-traditional", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "roff-no-traditional",no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "roff-no-groff", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "roff-groff", no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "roff-nolinks", no_argument, &afl, LOWDOWN_NROFF_NOLINK },
{ "roff-no-nolinks", no_argument, &rfl, LOWDOWN_NROFF_NOLINK },
{ "roff-numbered", no_argument, &afl, LOWDOWN_NROFF_NUMBERED },
{ "roff-no-numbered", no_argument, &rfl, LOWDOWN_NROFF_NUMBERED },
{ "roff-shortlinks", no_argument, &afl, LOWDOWN_NROFF_SHORTLINK },
{ "roff-no-shortlinks",no_argument, &rfl, LOWDOWN_NROFF_SHORTLINK },
{ "roff-skiphtml", no_argument, &afl, LOWDOWN_NROFF_SKIP_HTML },
{ "roff-no-skiphtml", no_argument, &rfl, LOWDOWN_NROFF_SKIP_HTML },
{ "roff-endnotes", no_argument, &afl, LOWDOWN_NROFF_ENDNOTES },
{ "roff-no-endnotes", no_argument, &rfl, LOWDOWN_NROFF_ENDNOTES },
{ "roff-code-font", required_argument, NULL, 7 },

{ "odt-skiphtml", no_argument, &afl, LOWDOWN_ODT_SKIP_HTML },
{ "odt-no-skiphtml", no_argument, &rfl, LOWDOWN_ODT_SKIP_HTML },
Expand Down Expand Up @@ -395,6 +395,25 @@ main(int argc, char *argv[])
{ "parse-maxdepth", required_argument, NULL, 5 },

{ "template", required_argument, NULL, 8 },

/* Deprecated "nroff" prefix. */

{ "nroff-traditional", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "nroff-no-traditional",no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "nroff-no-groff", no_argument, &rfl, LOWDOWN_NROFF_GROFF },
{ "nroff-groff", no_argument, &afl, LOWDOWN_NROFF_GROFF },
{ "nroff-nolinks", no_argument, &afl, LOWDOWN_NROFF_NOLINK },
{ "nroff-no-nolinks", no_argument, &rfl, LOWDOWN_NROFF_NOLINK },
{ "nroff-numbered", no_argument, &afl, LOWDOWN_NROFF_NUMBERED },
{ "nroff-no-numbered", no_argument, &rfl, LOWDOWN_NROFF_NUMBERED },
{ "nroff-shortlinks", no_argument, &afl, LOWDOWN_NROFF_SHORTLINK },
{ "nroff-no-shortlinks",no_argument, &rfl, LOWDOWN_NROFF_SHORTLINK },
{ "nroff-skiphtml", no_argument, &afl, LOWDOWN_NROFF_SKIP_HTML },
{ "nroff-no-skiphtml", no_argument, &rfl, LOWDOWN_NROFF_SKIP_HTML },
{ "nroff-endnotes", no_argument, &afl, LOWDOWN_NROFF_ENDNOTES },
{ "nroff-no-endnotes", no_argument, &rfl, LOWDOWN_NROFF_ENDNOTES },
{ "nroff-code-font", required_argument, NULL, 7 },

{ NULL, 0, NULL, 0 }
};

Expand Down
35 changes: 21 additions & 14 deletions man/lowdown-diff.1
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ If any were parsed, format the title information (title, author, date)
into a header element appearing first in the document.
.El
.Pp
For both
For both roff formats
.Fl t Ns Ar man
and
.Fl t Ns Ar ms
.Pq unless as noted ,
the following apply:
.Bl -tag -width Ds
.It Fl -nroff-code-font Ns = Ns Ar fonts
.It Fl -roff-code-font Ns = Ns Ar fonts
Override the default constant-width fonts with a tuple of regular, bold,
italic, and bold-italic variants in that order.
For example,
Expand All @@ -270,44 +270,41 @@ Aliases
and
.Li code
set no special fonts, bold, and the default constant-width.
.It Fl -nroff-endnotes
.It Fl -roff-endnotes
Delay printing of footnotes until the end of the document.
Only applies to
.Fl t Ns Ar ms ,
as
.Fl t Ns Ar man
only supports endnotes.
.It Fl -nroff-no-groff
Deprecated alias for
.Fl -nroff-traditional .
.It Fl -nroff-no-numbered
.It Fl -roff-no-numbered
Don't output numbered headings
.Po
.Li .NH NN
.Pc .
Only applies to
.Fl t Ns Ar ms .
.It Fl -nroff-no-skiphtml
.It Fl -roff-no-skiphtml
Output embedded HTML.
This usually doesn't make sense because the HTML won't be interpreted by
the output reader.
By default, HTML is omitted.
.It Fl -nroff-nolinks
.It Fl -roff-nolinks
Don't show URLs for images and links (autolinks are still shown).
.Pq Link content is still shown.
Overrides
.Fl -nroff-shortlinks
.Fl -roff-shortlinks
for images and links.
Only applies when
.Fl -nroff-traditional
.Fl -roff-traditional
is specified.
.It Fl -nroff-shortlinks
.It Fl -roff-shortlinks
Shorten URLs for images, links, and autolinks to only the domain name
and final path.
Only applies when
.Fl -nroff-traditional
.Fl -roff-traditional
is specified.
.It Fl -nroff-traditional
.It Fl -roff-traditional
Don't use hyperlink macros
.Po
.Li .pdfhref ,
Expand Down Expand Up @@ -339,8 +336,18 @@ or intra-document links
.Pc .
The output is compatible with traditional
.Xr troff 1 .
The deprecated
.Fl -roff-no-groff
was previously used for this argument.
.El
.Pp
The argument prefix
.Fl -nroff ,
such as in
.Fl -nroff-traditional ,
is deprecated in favour of
.Fl -roff .
.Pp
The
.Fl t Ns Ar term
output has the following:
Expand Down
35 changes: 21 additions & 14 deletions man/lowdown.1
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ If any were parsed, format the title information (title, author, date)
into a header element appearing first in the document.
.El
.Pp
For both
For both roff formats
.Fl t Ns Ar man
and
.Fl t Ns Ar ms
.Pq unless as noted ,
the following apply:
.Bl -tag -width Ds
.It Fl -nroff-code-font Ns = Ns Ar fonts
.It Fl -roff-code-font Ns = Ns Ar fonts
Override the default constant-width fonts with a tuple of regular, bold,
italic, and bold-italic variants in that order.
For example,
Expand All @@ -288,44 +288,41 @@ Aliases
and
.Li code
set no special fonts, bold, and the default constant-width.
.It Fl -nroff-endnotes
.It Fl -roff-endnotes
Delay printing of footnotes until the end of the document.
Only applies to
.Fl t Ns Ar ms ,
as
.Fl t Ns Ar man
only supports endnotes.
.It Fl -nroff-no-groff
Deprecated alias for
.Fl -nroff-traditional .
.It Fl -nroff-no-numbered
.It Fl -roff-no-numbered
Don't output numbered headings
.Po
.Li .NH NN
.Pc .
Only applies to
.Fl t Ns Ar ms .
.It Fl -nroff-no-skiphtml
.It Fl -roff-no-skiphtml
Output embedded HTML.
This usually doesn't make sense because the HTML won't be interpreted by
the output reader.
By default, HTML is omitted.
.It Fl -nroff-nolinks
.It Fl -roff-nolinks
Don't show URLs for images and links (autolinks are still shown).
.Pq Link content is still shown.
Overrides
.Fl -nroff-shortlinks
.Fl -roff-shortlinks
for images and links.
Only applies when
.Fl -nroff-traditional
.Fl -roff-traditional
is specified.
.It Fl -nroff-shortlinks
.It Fl -roff-shortlinks
Shorten URLs for images, links, and autolinks to only the domain name
and final path.
Only applies when
.Fl -nroff-traditional
.Fl -roff-traditional
is specified.
.It Fl -nroff-traditional
.It Fl -roff-traditional
Don't use hyperlink macros
.Po
.Li .pdfhref ,
Expand Down Expand Up @@ -357,8 +354,18 @@ or intra-document links
.Pc .
The output is compatible with traditional
.Xr troff 1 .
The deprecated
.Fl -roff-no-groff
was previously used for this argument.
.El
.Pp
The argument prefix
.Fl -nroff ,
such as in
.Fl -nroff-traditional ,
is deprecated in favour of
.Fl -roff .
.Pp
The
.Fl t Ns Ar term
output has the following:
Expand Down

0 comments on commit 46c8118

Please sign in to comment.