* mdocml: Make the tag column in .Bl -tag lists wider: 1.
@ 2017-05-12 17:58 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-05-12 17:58 UTC (permalink / raw)
To: source
Log Message:
-----------
Make the tag column in .Bl -tag lists wider:
1. I forgot about the 2n padding between tag and body.
2. The factor 1.1 was too small for bold fold, make it *1.15 + 1n.
Ugliness spotted by tb@.
Modified Files:
--------------
mdocml:
html.c
mdoc_html.c
mandoc_html.3
Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v
retrieving revision 1.286
retrieving revision 1.287
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.286 -r1.287
--- mdoc_html.c
+++ mdoc_html.c
@@ -768,7 +768,7 @@ mdoc_it_pre(MDOC_ARGS)
(n->parent->prev == NULL ||
n->parent->prev->body == NULL ||
n->parent->prev->body->child != NULL)) {
- t = print_otag(h, TAG_DT, "csWl",
+ t = print_otag(h, TAG_DT, "csw+-l",
cattr, bl->norm->Bl.width);
print_text(h, "\\ ");
print_tagq(h, t);
@@ -776,7 +776,7 @@ mdoc_it_pre(MDOC_ARGS)
print_text(h, "\\ ");
print_tagq(h, t);
}
- print_otag(h, TAG_DT, "csWl", cattr,
+ print_otag(h, TAG_DT, "csw+-l", cattr,
bl->norm->Bl.width);
break;
case ROFFT_BODY:
@@ -839,7 +839,7 @@ mdoc_bl_pre(MDOC_ARGS)
t = print_otag(h, TAG_COLGROUP, "");
for (i = 0; i < bl->ncols - 1; i++)
- print_otag(h, TAG_COL, "sww", bl->cols[i]);
+ print_otag(h, TAG_COL, "sw+w", bl->cols[i]);
print_otag(h, TAG_COL, "swW", bl->cols[i]);
print_tagq(h, t);
return 0;
@@ -886,7 +886,7 @@ mdoc_bl_pre(MDOC_ARGS)
cattr = "Bl-tag";
if (bl->offs)
print_otag(h, TAG_DIV, "cswl", cattr, bl->offs);
- print_otag(h, TAG_DL, "cswl", cattr, bl->width);
+ print_otag(h, TAG_DL, "csw+l", cattr, bl->width);
return 1;
case LIST_column:
elemtype = TAG_TABLE;
Index: mandoc_html.3
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mandoc_html.3,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lmandoc_html.3 -Lmandoc_html.3 -u -p -r1.7 -r1.8
--- mandoc_html.3
+++ mandoc_html.3
@@ -204,7 +204,7 @@ Instead, the rest of the format string c
argument type letters and style name letters.
.El
.Pp
-Argument type letters each require on argument as follows:
+Argument type letters each require one argument as follows:
.Bl -tag -width 1n -offset indent
.It Cm h
Requires one
@@ -233,10 +233,18 @@ width specifier.
If the argument is
.Dv NULL ,
nothing is printed for this pair.
-.It Cm W
-Similar to
-.Cm w ,
-but makes the width negative by multiplying it with \(mi1.
+.Pp
+The
+.Cm w
+argument type letter can optionally be followed by one or two
+modifier letters.
+The modifier
+.Cm +
+increases the width by 10% to make even bold text fit
+and adds two units for padding between columns.
+The modifier
+.Cm \-
+makes the width negative by multiplying it with \-1.
.El
.Pp
Style name letters decide what to do with the preceding argument:
Index: html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/html.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -Lhtml.c -Lhtml.c -u -p -r1.210 -r1.211
--- html.c
+++ html.c
@@ -609,15 +609,21 @@ print_otag(struct html *h, enum htmltag
SCALE_VS_INIT(su, i);
break;
case 'w':
- case 'W':
if ((arg2 = va_arg(ap, char *)) == NULL)
break;
su = &mysu;
a2width(arg2, su);
- /* Increase width to make even bold text fit. */
- su->scale *= 1.1;
- if (fmt[-1] == 'W')
+ if (*fmt == '+') {
+ /* Increase to make even bold text fit. */
+ su->scale *= 1.15;
+ /* Add padding. */
+ su->scale += 3.0;
+ fmt++;
+ }
+ if (*fmt == '-') {
su->scale *= -1.0;
+ fmt++;
+ }
break;
default:
abort();
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-12 17:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-12 17:58 mdocml: Make the tag column in .Bl -tag lists wider: 1 schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).