From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Added list-type style tips.
Date: Wed, 15 Dec 2010 10:32:01 -0500 (EST) [thread overview]
Message-ID: <201012151532.oBFFW1HC012321@krisdoz.my.domain> (raw)
Log Message:
-----------
Added list-type style tips.
Modified Files:
--------------
mdocml:
example.style.css
mdoc_html.c
Revision Data
-------------
Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.115 -r1.116
--- mdoc_html.c
+++ mdoc_html.c
@@ -246,13 +246,13 @@ static const struct htmlmdoc mdocs[MDOC_
static const char * const lists[LIST_MAX] = {
NULL,
- "list-bullet",
- "list-column",
+ "list-bul",
+ "list-col",
"list-dash",
"list-diag",
"list-enum",
"list-hang",
- "list-hyphen",
+ "list-hyph",
"list-inset",
"list-item",
"list-ohang",
@@ -903,7 +903,7 @@ mdoc_it_pre(MDOC_ARGS)
{
struct roffsu su;
enum mdoc_list type;
- struct htmlpair tag;
+ struct htmlpair tag[2];
const struct mdoc_node *bl;
bl = n->parent;
@@ -914,11 +914,12 @@ mdoc_it_pre(MDOC_ARGS)
type = bl->data.Bl->type;
- /* Whether we're top-padded (not "compact"). */
+ assert(lists[type]);
+ PAIR_CLASS_INIT(&tag[0], lists[type]);
SCALE_VS_INIT(&su, ! bl->data.Bl->comp);
bufcat_su(h, "margin-top", &su);
- PAIR_STYLE_INIT(&tag, h);
+ PAIR_STYLE_INIT(&tag[1], h);
if (MDOC_HEAD == n->type) {
switch (type) {
@@ -941,7 +942,7 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- print_otag(h, TAG_DT, 1, &tag);
+ print_otag(h, TAG_DT, 2, tag);
break;
case(LIST_column):
break;
@@ -960,7 +961,7 @@ mdoc_it_pre(MDOC_ARGS)
/* FALLTHROUGH */
case(LIST_item):
/* FALLTHROUGH */
- print_otag(h, TAG_LI, 1, &tag);
+ print_otag(h, TAG_LI, 2, tag);
break;
case(LIST_diag):
/* FALLTHROUGH */
@@ -971,10 +972,10 @@ mdoc_it_pre(MDOC_ARGS)
case(LIST_ohang):
/* FALLTHROUGH */
case(LIST_tag):
- print_otag(h, TAG_DD, 0, NULL);
+ print_otag(h, TAG_DD, 1, tag);
break;
case(LIST_column):
- print_otag(h, TAG_TD, 1, &tag);
+ print_otag(h, TAG_TD, 2, tag);
break;
default:
break;
@@ -982,7 +983,7 @@ mdoc_it_pre(MDOC_ARGS)
} else {
switch (type) {
case (LIST_column):
- print_otag(h, TAG_TR, 0, NULL);
+ print_otag(h, TAG_TR, 1, tag);
break;
default:
break;
Index: example.style.css
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/example.style.css,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lexample.style.css -Lexample.style.css -u -p -r1.21 -r1.22
--- example.style.css
+++ example.style.css
@@ -70,3 +70,44 @@ div.symb { font-weight: bold; font-style
table.footer { } /* Document footer. */
table.header { } /* Document header. */
+
+/* Formatting for lists. */
+
+dl.list-diag { }
+dt.list-diag { }
+dd.list-diag { }
+
+dl.list-hang { }
+dt.list-hang { }
+dd.list-hang { }
+
+dl.list-inset { }
+dt.list-inset { }
+dd.list-inset { }
+
+dl.list-ohang { }
+dt.list-ohang { }
+dd.list-ohang { }
+
+dl.list-tag { }
+dt.list-tag { }
+dd.list-tag { }
+
+table.list-col { }
+tr.list-col { }
+td.list-col { }
+
+ul.list-bul { }
+li.list-bul { }
+
+ul.list-dash { }
+li.list-dash { }
+
+ul.list-hyph { }
+li.list-hyph { }
+
+ul.list-item { }
+li.list-item { }
+
+ol.list-enum { }
+li.list-enum { }
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2010-12-15 15:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012151532.oBFFW1HC012321@krisdoz.my.domain \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).