source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Fix list-type being clobbered by margins.
@ 2010-12-20 13:39 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-12-20 13:39 UTC (permalink / raw)
  To: source

Log Message:
-----------
Fix list-type being clobbered by margins.  Last default styles in place.
Added `Sx' to be default-italic (as in OpenBSD's cvsweb).  Added `diag'
formatting, which had been lost.

Modified Files:
--------------
    mdocml:
        example.style.css
        mdoc_html.c
        style.css

Revision Data
-------------
Index: style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/style.css,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lstyle.css -Lstyle.css -u -p -r1.16 -r1.17
--- style.css
+++ style.css
@@ -57,44 +57,44 @@ table		{ margin-top: 0px; margin-bottom:
 
 /* Context-specific modes. */
 
-span.addr	{ font-style: italic; font-weight: normal; } /* Address (Ad). */
-span.arg	{ font-style: italic; font-weight: normal; } /* Command argument (Ar). */
+i.addr		{ font-weight: normal; } /* Address (Ad). */
+i.arg		{ font-weight: normal; } /* Command argument (Ar). */
 span.author	{ } /* Author name (An). */
-span.cmd	{ font-style: normal; font-weight: bold; } /* Command (Cm). */ 
-span.config	{ font-style: normal; font-weight: bold; } /* Config statement (Cd). */
+b.cmd		{ font-style: normal; } /* Command (Cm). */ 
+b.config	{ font-style: normal; } /* Config statement (Cd). */
 span.define	{ } /* Defines (Dv). */
 span.desc	{ } /* Nd.  After em-dash. */
-span.diag	{ font-style: normal; font-weight: bold; } /* Diagnostic (Bl -diag). */
+b.diag		{ font-style: normal; } /* Diagnostic (Bl -diag). */
 span.env	{ } /* Environment variables (Ev). */
 span.errno	{ } /* Error string (Er). */
-span.farg	{ font-style: italic; font-weight: normal; } /* Function argument (Fa, Fn). */
-span.file	{ font-style: italic; font-weight: normal; } /* File (Pa). */
-span.flag	{ font-style: normal; font-weight: bold; } /* Flag (Fl, Cm). */
-span.fname	{ font-style: normal; font-weight: bold; } /* Function name (Fa, Fn, Rv). */
-span.ftype	{ font-style: italic; font-weight: normal; } /* Function types (Ft, Fn). */
-span.includes	{ font-style: normal; font-weight: bold; } /* Header includes (In). */
+i.farg		{ font-weight: normal; } /* Function argument (Fa, Fn). */
+i.file		{ font-weight: normal; } /* File (Pa). */
+b.flag		{ font-style: normal; } /* Flag (Fl, Cm). */
+b.fname		{ font-style: normal; } /* Function name (Fa, Fn, Rv). */
+i.ftype		{ font-weight: normal; } /* Function types (Ft, Fn). */
+b.includes	{ font-style: normal; } /* Header includes (In). */
 span.lib	{ } /* Library (Lb). */
-span.macro	{ font-style: normal; font-weight: bold; } /* Macro-ish thing (Fd). */
-span.name	{ color: blue; font-style: normal; font-weight: bold; } /* Name of utility (Nm). */
+b.macro		{ font-style: normal; } /* Macro-ish thing (Fd). */
+b.name		{ color: blue; font-style: normal; } /* Name of utility (Nm). */
 span.opt	{ } /* Options (Op, Oo/Oc). */
 span.ref	{ } /* Citations (Rs). */
 span.ref-auth	{ } /* Reference author (%A). */
-span.ref-book	{ font-style: italic; font-weight: normal; } /* Reference book (%B). */
+i.ref-book	{ font-weight: normal; } /* Reference book (%B). */
 span.ref-city	{ } /* Reference city (%C). */
 span.ref-date	{ } /* Reference date (%D). */
-span.ref-issue	{ font-style: italic; font-weight: normal; } /* Reference issuer/publisher (%I). */
-span.ref-jrnl	{ font-style: italic; font-weight: normal; } /* Reference journal (%J). */
+i.ref-issue	{ font-weight: normal; } /* Reference issuer/publisher (%I). */
+i.ref-jrnl	{ font-weight: normal; } /* Reference journal (%J). */
 span.ref-num	{ } /* Reference number (%N). */
 span.ref-opt	{ } /* Reference optionals (%O). */
 span.ref-page	{ } /* Reference page (%P). */
 span.ref-corp	{ } /* Reference corporate/foreign author (%Q). */
 span.ref-rep	{ } /* Reference report (%R). */
-span.ref-title	{ text-decoration: underline; } /* Reference title (%T). */
+u.ref-title	{ } /* Reference title (%T). */
 span.ref-vol	{ } /* Reference volume (%V). */
 span.type	{ font-style: italic; font-weight: normal; } /* Variable types (Vt). */
 span.unix	{ } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */
-span.utility	{ font-style: normal; font-weight: bold; } /* Name of utility (Ex). */
-span.var	{ font-style: normal; font-weight: bold; } /* Variables (Rv). */
+b.utility	{ font-style: normal; } /* Name of utility (Ex). */
+b.var		{ font-style: normal; } /* Variables (Rv). */
 
 a.link-ext	{ background: transparent url(external.png) center right no-repeat; padding-right: 12px; }/* Off-site link (Lk). */
 a.link-includes	{ } /* Include-file link (In). */
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.133
retrieving revision 1.134
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.133 -r1.134
--- mdoc_html.c
+++ mdoc_html.c
@@ -857,7 +857,6 @@ mdoc_it_pre(MDOC_ARGS)
 		case(LIST_enum):
 			return(0);
 		case(LIST_diag):
-			/* FIXME: STYLE for diag! */
 			/* FALLTHROUGH */
 		case(LIST_hang):
 			/* FALLTHROUGH */
@@ -870,6 +869,10 @@ mdoc_it_pre(MDOC_ARGS)
 			bufcat_su(h, "margin-top", &su);
 			PAIR_STYLE_INIT(&tag[1], h);
 			print_otag(h, TAG_DT, 2, tag);
+			if (LIST_diag != type)
+				break;
+			PAIR_CLASS_INIT(&tag[0], "diag");
+			print_otag(h, TAG_B, 1, tag);
 			break;
 		case(LIST_column):
 			break;
@@ -939,6 +942,7 @@ mdoc_bl_pre(MDOC_ARGS)
 	size_t		 i;
 	struct htmlpair	 tag[3];
 	struct roffsu	 su;
+	char		 buf[BUFSIZ];
 
 	if (MDOC_BODY == n->type) {
 		if (LIST_column == n->data.Bl->type)
@@ -977,19 +981,15 @@ mdoc_bl_pre(MDOC_ARGS)
 	PAIR_STYLE_INIT(&tag[0], h);
 
 	assert(lists[n->data.Bl->type]);
-	bufinit(h);
-	bufcat(h, "list ");
-	bufcat(h, lists[n->data.Bl->type]);
-	PAIR_INIT(&tag[1], ATTR_CLASS, h->buf);
-	i = 2;
+	strlcpy(buf, "list ", BUFSIZ);
+	strlcat(buf, lists[n->data.Bl->type], BUFSIZ);
+	PAIR_INIT(&tag[1], ATTR_CLASS, buf);
 
 	/* Set the block's left-hand margin. */
 
 	if (n->data.Bl->offs) {
 		a2offs(n->data.Bl->offs, &su);
 		bufcat_su(h, "margin-left", &su);
-		PAIR_STYLE_INIT(&tag[2], h);
-		i = 3;
 	}
 
 	switch (n->data.Bl->type) {
@@ -1000,10 +1000,10 @@ mdoc_bl_pre(MDOC_ARGS)
 	case(LIST_hyphen):
 		/* FALLTHROUGH */
 	case(LIST_item):
-		print_otag(h, TAG_UL, i, tag);
+		print_otag(h, TAG_UL, 2, tag);
 		break;
 	case(LIST_enum):
-		print_otag(h, TAG_OL, i, tag);
+		print_otag(h, TAG_OL, 2, tag);
 		break;
 	case(LIST_diag):
 		/* FALLTHROUGH */
@@ -1014,10 +1014,10 @@ mdoc_bl_pre(MDOC_ARGS)
 	case(LIST_ohang):
 		/* FALLTHROUGH */
 	case(LIST_tag):
-		print_otag(h, TAG_DL, i, tag);
+		print_otag(h, TAG_DL, 2, tag);
 		break;
 	case(LIST_column):
-		print_otag(h, TAG_TABLE, i, tag);
+		print_otag(h, TAG_TABLE, 2, tag);
 		break;
 	default:
 		abort();
@@ -1124,6 +1124,7 @@ mdoc_sx_pre(MDOC_ARGS)
 	PAIR_CLASS_INIT(&tag[0], "link-sec");
 	PAIR_HREF_INIT(&tag[1], buf);
 
+	print_otag(h, TAG_I, 1, tag);
 	print_otag(h, TAG_A, 2, tag);
 	return(1);
 }
Index: example.style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/example.style.css,v
retrieving revision 1.36
retrieving revision 1.37
diff -Lexample.style.css -Lexample.style.css -u -p -r1.36 -r1.37
--- example.style.css
+++ example.style.css
@@ -57,7 +57,7 @@ b.cmd		{ font-style: normal; } /* Comman
 b.config	{ font-style: normal; } /* Config statement (Cd). */
 span.define	{ } /* Defines (Dv). */
 span.desc	{ } /* Nd.  After em-dash. */
-span.diag	{ font-style: normal; font-weight: bold; } /* Diagnostic (Bl -diag). */
+b.diag		{ font-style: normal; } /* Diagnostic (Bl -diag). */
 span.env	{ } /* Environment variables (Ev). */
 span.errno	{ } /* Error string (Er). */
 i.farg		{ font-weight: normal; } /* Function argument (Fa, Fn). */
@@ -67,6 +67,7 @@ b.fname		{ font-style: normal; } /* Func
 i.ftype		{ font-weight: normal; } /* Function types (Ft, Fn). */
 b.includes	{ font-style: normal; } /* Header includes (In). */
 span.lib	{ } /* Library (Lb). */
+i.link-sec	{ font-weight: normal; } /* Section links (Sx). */
 b.macro		{ font-style: normal; } /* Macro-ish thing (Fd). */
 b.name		{ font-style: normal; } /* Name of utility (Nm). */
 span.opt	{ } /* Options (Op, Oo/Oc). */
@@ -94,7 +95,7 @@ a.link-includes	{ } /* Include-file link
 a.link-mail	{ } /* Mailto links (Mt). */
 a.link-man	{ } /* Manual links (Xr). */
 a.link-ref	{ } /* Reference section links (%Q). */
-a.link-sec	{ font-style: italic; font-weight: normal; } /* Section links (Sx). */
+a.link-sec	{ } /* Section links (Sx). */
 
 /* Formatting for lists. */
 
--
 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:[~2010-12-20 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-20 13:39 mdocml: Fix list-type being clobbered by margins kristaps

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).