From: Ingo Schwarze Date: Sun, 5 Feb 2017 20:22:04 +0000 (+0000) Subject: mark up .Ar, .Fa, .Va, .Ft, and .Vt with rather than ; X-Git-Tag: VERSION_1_14_1~60 X-Git-Url: https://git.cameronkatri.com/mandoc.git/commitdiff_plain/790521c2b6aef2996ee67bd9fdcb7a3d5614261b mark up .Ar, .Fa, .Va, .Ft, and .Vt with rather than ; suggested by bentley@ long ago, but needed lots of cleanup first --- diff --git a/TODO b/TODO index 40aa9a59..1f3ee2c3 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,6 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.230 2017/02/03 17:59:22 schwarze Exp $ +* $Id: TODO,v 1.231 2017/02/05 20:22:04 schwarze Exp $ ************************************************************************ Many issues are annotated for difficulty as follows: @@ -427,9 +427,6 @@ are mere guesses, and some may be wrong. http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 loc * exist * algo ** size * imp *** -- consider whether can be used for Ar Dv Er Ev Fa Va. - from bentley@ Wed, 13 Aug 2014 09:17:55 -0600 - - generate tags in HTML idea from florian@ Tue, 7 Apr 2015 00:26:28 +0000 may be possible to implement with .Lk img://something.png alt_text diff --git a/html.c b/html.c index b084f1a0..40f2cc07 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.206 2017/02/05 19:29:19 schwarze Exp $ */ +/* $Id: html.c,v 1.207 2017/02/05 20:22:04 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2011-2015, 2017 Ingo Schwarze @@ -76,6 +76,7 @@ static const struct htmldata htmltags[TAG_MAX] = { {"dt", HTML_NLAROUND}, {"dd", HTML_NLAROUND | HTML_INDENT}, {"pre", HTML_NLALL | HTML_NOINDENT}, + {"var", 0}, {"cite", 0}, {"b", 0}, {"i", 0}, diff --git a/html.h b/html.h index 95b56be6..5be2f82d 100644 --- a/html.h +++ b/html.h @@ -1,4 +1,4 @@ -/* $Id: html.h,v 1.82 2017/02/05 19:29:19 schwarze Exp $ */ +/* $Id: html.h,v 1.83 2017/02/05 20:22:04 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2017 Ingo Schwarze @@ -41,6 +41,7 @@ enum htmltag { TAG_DT, TAG_DD, TAG_PRE, + TAG_VAR, TAG_CITE, TAG_B, TAG_I, diff --git a/mandoc.css b/mandoc.css index 7ea4d975..0e5f04dd 100644 --- a/mandoc.css +++ b/mandoc.css @@ -1,4 +1,4 @@ -/* $Id: mandoc.css,v 1.15 2017/02/05 19:29:19 schwarze Exp $ */ +/* $Id: mandoc.css,v 1.16 2017/02/05 20:22:04 schwarze Exp $ */ /* * Standard style sheet for mandoc(1) -Thtml and man.cgi(8). */ @@ -134,7 +134,8 @@ table.Nm { } b.Nm { font-style: normal; } b.Fl { font-style: normal; } b.Cm { font-style: normal; } -i.Ar { font-weight: normal; } +var.Ar { font-style: italic; + font-weight: normal; } span.Op { } b.Ic { font-style: normal; } code.Ev { font-style: normal; @@ -148,11 +149,15 @@ span.Lb { } b.In { font-style: normal; } a.In { } b.Fd { font-style: normal; } -i.Ft { font-weight: normal; } +var.Ft { font-style: italic; + font-weight: normal; } b.Fn { font-style: normal; } -i.Fa { font-weight: normal; } -i.Vt { font-weight: normal; } -i.Va { font-weight: normal; } +var.Fa { font-style: italic; + font-weight: normal; } +var.Vt { font-style: italic; + font-weight: normal; } +var.Va { font-style: italic; + font-weight: normal; } code.Dv { font-style: normal; font-weight: normal; font-family: monospace; } diff --git a/mdoc_html.c b/mdoc_html.c index 9d6ca1af..4bae0aa0 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.266 2017/02/05 19:29:19 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.267 2017/02/05 20:22:04 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -649,7 +649,7 @@ mdoc_ns_pre(MDOC_ARGS) static int mdoc_ar_pre(MDOC_ARGS) { - print_otag(h, TAG_I, "c", "Ar"); + print_otag(h, TAG_VAR, "c", "Ar"); return 1; } @@ -1088,12 +1088,12 @@ mdoc_fa_pre(MDOC_ARGS) struct tag *t; if (n->parent->tok != MDOC_Fo) { - print_otag(h, TAG_I, "c", "Fa"); + print_otag(h, TAG_VAR, "c", "Fa"); return 1; } for (nn = n->child; nn; nn = nn->next) { - t = print_otag(h, TAG_I, "c", "Fa"); + t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, nn->string); print_tagq(h, t); if (nn->next) { @@ -1172,7 +1172,7 @@ mdoc_vt_pre(MDOC_ARGS) } else if (n->type == ROFFT_HEAD) return 0; - print_otag(h, TAG_I, "c", "Vt"); + print_otag(h, TAG_VAR, "c", "Vt"); return 1; } @@ -1180,7 +1180,7 @@ static int mdoc_ft_pre(MDOC_ARGS) { synopsis_pre(h, n); - print_otag(h, TAG_I, "c", "Ft"); + print_otag(h, TAG_VAR, "c", "Ft"); return 1; } @@ -1201,7 +1201,7 @@ mdoc_fn_pre(MDOC_ARGS) ep = strchr(sp, ' '); if (NULL != ep) { - t = print_otag(h, TAG_I, "c", "Ft"); + t = print_otag(h, TAG_VAR, "c", "Ft"); while (ep) { sz = MIN((int)(ep - sp), BUFSIZ - 1); @@ -1227,10 +1227,10 @@ mdoc_fn_pre(MDOC_ARGS) for (n = n->child->next; n; n = n->next) { if (NODE_SYNPRETTY & n->flags) - t = print_otag(h, TAG_I, "css?", "Fa", + t = print_otag(h, TAG_VAR, "css?", "Fa", "white-space", "nowrap"); else - t = print_otag(h, TAG_I, "c", "Fa"); + t = print_otag(h, TAG_VAR, "c", "Fa"); print_text(h, n->string); print_tagq(h, t); if (n->next) { @@ -1438,7 +1438,7 @@ mdoc_ic_pre(MDOC_ARGS) static int mdoc_va_pre(MDOC_ARGS) { - print_otag(h, TAG_I, "c", "Va"); + print_otag(h, TAG_VAR, "c", "Va"); return 1; }