source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Have synopsis_pre() in -Thtml emit P or BR, not DIVs.
@ 2010-12-17  8:17 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-12-17  8:17 UTC (permalink / raw)
  To: source

Log Message:
-----------
Have synopsis_pre() in -Thtml emit P or BR, not DIVs.

Banish header and footer TABLE styling to example.style.css.

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

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -Lhtml.c -Lhtml.c -u -p -r1.116 -r1.117
--- html.c
+++ html.c
@@ -449,6 +449,10 @@ print_otag(struct html *h, enum htmltag 
 	putchar('>');
 
 	h->flags |= HTML_NOSPACE;
+
+	if ((HTML_AUTOCLOSE | HTML_CLRLINE) & htmltags[tag].flags)
+		putchar('\n');
+
 	return(t);
 }
 
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.124 -r1.125
--- mdoc_html.c
+++ mdoc_html.c
@@ -299,21 +299,15 @@ a2width(const char *p, struct roffsu *su
 static void
 synopsis_pre(struct html *h, const struct mdoc_node *n)
 {
-	struct roffsu	 su;
-	struct htmlpair	 tag;
 
 	if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))
 		return;
 
-	SCALE_VS_INIT(&su, 1);
-	bufcat_su(h, "margin-top", &su);
-	PAIR_STYLE_INIT(&tag, h);
-
 	if (n->prev->tok == n->tok && 
 			MDOC_Fo != n->tok && 
 			MDOC_Ft != n->tok && 
 			MDOC_Fn != n->tok) {
-		print_otag(h, TAG_DIV, 0, NULL);
+		print_otag(h, TAG_BR, 0, NULL);
 		return;
 	}
 
@@ -327,16 +321,16 @@ synopsis_pre(struct html *h, const struc
 	case (MDOC_In):
 		/* FALLTHROUGH */
 	case (MDOC_Vt):
-		print_otag(h, TAG_DIV, 1, &tag);
+		print_otag(h, TAG_P, 0, NULL);
 		break;
 	case (MDOC_Ft):
 		if (MDOC_Fn != n->tok && MDOC_Fo != n->tok) {
-			print_otag(h, TAG_DIV, 1, &tag);
+			print_otag(h, TAG_P, 0, NULL);
 			break;
 		}
 		/* FALLTHROUGH */
 	default:
-		print_otag(h, TAG_DIV, 0, NULL);
+		print_otag(h, TAG_BR, 0, NULL);
 		break;
 	}
 }
@@ -463,37 +457,31 @@ print_mdoc_node(MDOC_ARGS)
 	}
 }
 
-
 /* ARGSUSED */
 static void
 mdoc_root_post(MDOC_ARGS)
 {
-	struct htmlpair	 tag[3];
+	struct htmlpair	 tag[2];
 	struct tag	*t, *tt;
 	char		 b[DATESIZ];
 
 	time2a(m->date, b, DATESIZ);
 
-	PAIR_CLASS_INIT(&tag[0], "footer");
-	bufcat_style(h, "width", "100%");
-	PAIR_STYLE_INIT(&tag[1], h);
-	PAIR_SUMMARY_INIT(&tag[2], "footer");
+	PAIR_CLASS_INIT(&tag[0], "foot");
+	PAIR_SUMMARY_INIT(&tag[1], "Document Footer");
+	t = print_otag(h, TAG_TABLE, 2, tag);
 
-	t = print_otag(h, TAG_TABLE, 3, tag);
 	tt = print_otag(h, TAG_TR, 0, NULL);
 
-	bufinit(h);
-	bufcat_style(h, "width", "50%");
-	PAIR_STYLE_INIT(&tag[0], h);
+	PAIR_CLASS_INIT(&tag[0], "foot-date");
 	print_otag(h, TAG_TD, 1, tag);
+
 	print_text(h, b);
 	print_stagq(h, tt);
 
-	bufinit(h);
-	bufcat_style(h, "width", "50%");
-	bufcat_style(h, "text-align", "right");
-	PAIR_STYLE_INIT(&tag[0], h);
+	PAIR_CLASS_INIT(&tag[0], "foot-os");
 	print_otag(h, TAG_TD, 1, tag);
+
 	print_text(h, m->os);
 	print_tagq(h, t);
 }
@@ -517,36 +505,27 @@ mdoc_root_pre(MDOC_ARGS)
 
 	snprintf(title, BUFSIZ - 1, "%s(%s)", m->title, m->msec);
 
-	PAIR_CLASS_INIT(&tag[0], "header");
-	bufcat_style(h, "width", "100%");
-	PAIR_STYLE_INIT(&tag[1], h);
-	PAIR_SUMMARY_INIT(&tag[2], "header");
-
-	t = print_otag(h, TAG_TABLE, 3, tag);
+	PAIR_CLASS_INIT(&tag[0], "head");
+	PAIR_SUMMARY_INIT(&tag[1], "Document Header");
+	t = print_otag(h, TAG_TABLE, 2, tag);
 
 	tt = print_otag(h, TAG_TR, 0, NULL);
 
-	bufinit(h);
-	bufcat_style(h, "width", "10%");
-	PAIR_STYLE_INIT(&tag[0], h);
+	PAIR_CLASS_INIT(&tag[0], "head-ltitle");
 	print_otag(h, TAG_TD, 1, tag);
+
 	print_text(h, title);
 	print_stagq(h, tt);
 
-	bufinit(h);
-	bufcat_style(h, "text-align", "center");
-	bufcat_style(h, "white-space", "nowrap");
-	bufcat_style(h, "width", "80%");
-	PAIR_STYLE_INIT(&tag[0], h);
+	PAIR_CLASS_INIT(&tag[0], "head-vol");
 	print_otag(h, TAG_TD, 1, tag);
+
 	print_text(h, b);
 	print_stagq(h, tt);
 
-	bufinit(h);
-	bufcat_style(h, "text-align", "right");
-	bufcat_style(h, "width", "10%");
-	PAIR_STYLE_INIT(&tag[0], h);
+	PAIR_CLASS_INIT(&tag[0], "head-rtitle");
 	print_otag(h, TAG_TD, 1, tag);
+
 	print_text(h, title);
 	print_tagq(h, t);
 	return(1);
@@ -1196,6 +1175,7 @@ mdoc_bd_pre(MDOC_ARGS)
 		}
 		if (nn->next && nn->next->line == nn->line)
 			continue;
+
 		print_text(h, "\n");
 		h->flags |= HTML_NOSPACE;
 	}
Index: example.style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/example.style.css,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lexample.style.css -Lexample.style.css -u -p -r1.29 -r1.30
--- example.style.css
+++ example.style.css
@@ -5,8 +5,13 @@ body		{ font-family: monospace; }
 
 /* Preamble structure. */
 
-table.footer	{ } /* Document footer. */
-table.header	{ } /* Document header. */
+table.foot	{ width: 100%; } /* Document footer. */
+td.foot-date	{ width: 50%; } /* Document footer: date. */
+td.foot-os	{ width: 50%; text-align: right; } /* Document footer: OS. */
+table.head	{ width: 100%; } /* Document header. */
+td.head-ltitle	{ width: 10%; } /* Document header: left-title. */
+td.head-vol	{ width: 80%; text-align: center; } /* Document header: volume. */
+td.head-rtitle	{ width: 10%; text-align: right; } /* Document header: right-title. */
 
 /* Sections. */
 
@@ -20,6 +25,8 @@ table.synopsis td { vertical-align: top;
 /* Vertical spacing. */
 
 p		{ } /* Paragraph: Pp, Lp. */
+blockquote	{ margin-top: 0px; margin-bottom: 0px; }
+table		{ margin-top: 0px; margin-bottom: 0px; }
 
 /* General font modes. */
 
--
 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-17  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17  8:17 mdocml: Have synopsis_pre() in -Thtml emit P or BR, not DIVs 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).