From 46c8118df7893508f10b736fbadd8356ca2ebe09 Mon Sep 17 00:00:00 2001 From: Kristaps Dz Date: Thu, 12 Dec 2024 19:02:49 -0800 Subject: [PATCH] Rename "--nroff-xxx" arguments as "--roff-xxx". 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. --- Makefile | 8 ++++---- main.c | 49 ++++++++++++++++++++++++++++++++-------------- man/lowdown-diff.1 | 35 ++++++++++++++++++++------------- man/lowdown.1 | 35 ++++++++++++++++++++------------- 4 files changed, 80 insertions(+), 47 deletions(-) diff --git a/Makefile b/Makefile index f0bbffb..fc47edd 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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: @@ -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 diff --git a/main.c b/main.c index ca7b057..4db86b8 100644 --- a/main.c +++ b/main.c @@ -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 }, @@ -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 } }; diff --git a/man/lowdown-diff.1 b/man/lowdown-diff.1 index 36f3383..658a925 100644 --- a/man/lowdown-diff.1 +++ b/man/lowdown-diff.1 @@ -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, @@ -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 , @@ -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: diff --git a/man/lowdown.1 b/man/lowdown.1 index ad49bb2..38586fe 100644 --- a/man/lowdown.1 +++ b/man/lowdown.1 @@ -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, @@ -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 , @@ -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: