summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-09-24 11:05:45 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-09-24 11:05:45 +0000
commitf31eee34a29f6fcdb8fe0640095473ede5982887 (patch)
treeef337ebfd5c2ab6b14b93f3079461f874210a89c
parent7781128d46665331fdbd9893a256257e88eaf96d (diff)
downloadmandoc-f31eee34a29f6fcdb8fe0640095473ede5982887.tar.gz
Sync'd example style-sheet to be more like OpenBSD's default (KISS).
-Thtml and -Tascii now have equivalent functionality.
-rw-r--r--example.style.css13
-rw-r--r--mdoc_html.c83
-rw-r--r--mdoc_term.c9
3 files changed, 89 insertions, 16 deletions
diff --git a/example.style.css b/example.style.css
index 9a4da78d..03e4360c 100644
--- a/example.style.css
+++ b/example.style.css
@@ -1,4 +1,4 @@
-div.body { } /* Wraps entire body file. */
+div.body { font-family: monospace; min-width: 580px; width: 580px; } /* Top-most div tag. */
span.sec-head { font-weight: bold; } /* Sections (Sh). */
div.sec-head { }
@@ -10,7 +10,7 @@ div.ssec-head { }
div.ssec-body { }
div.ssec-block { }
-span.addr { text-decoration: underline; } /* Address (Ad). */
+span.addr { } /* Address (Ad). */
span.arg { font-style: italic; } /* Command argument (Ar). */
span.author { } /* Author name (An). */
span.cmd { font-weight: bold; } /* Command (Cm). */
@@ -21,13 +21,14 @@ span.diag { font-weight: bold; } /* Diagnostic (Bl -diag). */
span.emph { font-style: italic; } /* Emphasis (Em). */
span.env { } /* Environment variables (Ev). */
span.errno { } /* Error string (Er). */
-span.farg { text-decoration: underline; } /* Function argument (Fa, Fn). */
-span.fname { text-decoration: underline; } /* Function name (Fa, Fn, Rv). */
+span.farg { font-style: italic; } /* Function argument (Fa, Fn). */
+span.fname { font-style: italic; } /* Function name (Fa, Fn, Rv). */
span.file { font-style: italic; } /* File (Pa). */
span.flag { font-weight: bold; } /* Flag (Fl, Cm). */
span.includes { font-weight: bold; } /* Header includes (In). */
+span.lib { } /* Library (Lb). */
span.lit { font-family: monospace; } /* Literals (Bf -literal). */
-span.macro { } /* Macro-ish thing (Fd). */
+span.macro { font-weight: bold; } /* Macro-ish thing (Fd). */
span.name { font-weight: bold; } /* Name of utility (Nm). */
span.opt { } /* Options (Op, Oo/Oc). */
span.symb { font-weight: bold; } /* Symbols. */
@@ -41,7 +42,7 @@ a.link-sec { } /* Section links (Sx). */
a.link-mail { } /* Mailto links (Mt). */
a.link-ext { } /* Off-site link (Lk). */
-div.lit { font-family: monospace; } /* Literal (D1, Bd -literal, Dl, Bd -literal). */
+div.lit { } /* Literal (D1, Bd -literal, Dl, Bd -literal). */
div.emph { font-style: italic; } /* Emphasis (Bl -emphasis). */
div.symb { font-weight: bold; } /* Symbols (Bl -symbolic). */
diff --git a/mdoc_html.c b/mdoc_html.c
index 8299ffc2..e7f1abe2 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -73,6 +73,7 @@ static void mdoc_bq_post(MDOC_ARGS);
static int mdoc_bq_pre(MDOC_ARGS);
static void mdoc_brq_post(MDOC_ARGS);
static int mdoc_brq_pre(MDOC_ARGS);
+static int mdoc_bt_pre(MDOC_ARGS);
static int mdoc_bx_pre(MDOC_ARGS);
static int mdoc_cd_pre(MDOC_ARGS);
static int mdoc_d1_pre(MDOC_ARGS);
@@ -93,6 +94,8 @@ static int mdoc_fo_pre(MDOC_ARGS);
static int mdoc_ic_pre(MDOC_ARGS);
static int mdoc_in_pre(MDOC_ARGS);
static int mdoc_it_pre(MDOC_ARGS);
+static int mdoc_lb_pre(MDOC_ARGS);
+static int mdoc_li_pre(MDOC_ARGS);
static int mdoc_lk_pre(MDOC_ARGS);
static int mdoc_mt_pre(MDOC_ARGS);
static int mdoc_ms_pre(MDOC_ARGS);
@@ -114,6 +117,8 @@ static void mdoc_sq_post(MDOC_ARGS);
static int mdoc_sq_pre(MDOC_ARGS);
static int mdoc_ss_pre(MDOC_ARGS);
static int mdoc_sx_pre(MDOC_ARGS);
+static int mdoc_sy_pre(MDOC_ARGS);
+static int mdoc_ud_pre(MDOC_ARGS);
static int mdoc_va_pre(MDOC_ARGS);
static int mdoc_vt_pre(MDOC_ARGS);
static int mdoc_xr_pre(MDOC_ARGS);
@@ -155,7 +160,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
{mdoc_ft_pre, NULL}, /* Ft */
{mdoc_ic_pre, NULL}, /* Ic */
{mdoc_in_pre, NULL}, /* In */
- {NULL, NULL}, /* Li */
+ {mdoc_li_pre, NULL}, /* Li */
{mdoc_nd_pre, NULL}, /* Nd */
{mdoc_nm_pre, NULL}, /* Nm */
{mdoc_op_pre, mdoc_op_post}, /* Op */
@@ -214,9 +219,9 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
{NULL, NULL}, /* Sc */
{mdoc_sq_pre, mdoc_sq_post}, /* So */
{mdoc_sq_pre, mdoc_sq_post}, /* Sq */
- {NULL, NULL}, /* Sm */
+ {NULL, NULL}, /* Sm */ /* FIXME - no idea. */
{mdoc_sx_pre, NULL}, /* Sx */
- {NULL, NULL}, /* Sy */
+ {mdoc_sy_pre, NULL}, /* Sy */
{NULL, NULL}, /* Tn */
{mdoc_xx_pre, NULL}, /* Ux */
{NULL, NULL}, /* Xc */
@@ -227,11 +232,11 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = {
{NULL, NULL}, /* Oc */
{NULL, NULL}, /* Bk */
{NULL, NULL}, /* Ek */
- {NULL, NULL}, /* Bt */
+ {mdoc_bt_pre, NULL}, /* Bt */
{NULL, NULL}, /* Hf */
{NULL, NULL}, /* Fr */
- {NULL, NULL}, /* Ud */
- {NULL, NULL}, /* Lb */
+ {mdoc_ud_pre, NULL}, /* Ud */
+ {mdoc_lb_pre, NULL}, /* Lb */
{mdoc_sp_pre, NULL}, /* Lp */
{mdoc_lk_pre, NULL}, /* Lk */
{mdoc_mt_pre, NULL}, /* Mt */
@@ -2008,3 +2013,69 @@ mdoc_rs_pre(MDOC_ARGS)
print_otag(h, TAG_DIV, i, tag);
return(1);
}
+
+
+
+/* ARGSUSED */
+static int
+mdoc_li_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+
+ tag.key = ATTR_CLASS;
+ tag.val = "lit";
+
+ print_otag(h, TAG_SPAN, 1, &tag);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_sy_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+
+ tag.key = ATTR_CLASS;
+ tag.val = "symb";
+
+ print_otag(h, TAG_SPAN, 1, &tag);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_bt_pre(MDOC_ARGS)
+{
+
+ print_text(h, "is currently in beta test.");
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_ud_pre(MDOC_ARGS)
+{
+
+ print_text(h, "currently under development.");
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+mdoc_lb_pre(MDOC_ARGS)
+{
+ struct htmlpair tag;
+
+ tag.key = ATTR_CLASS;
+ tag.val = "lib";
+
+ if (SEC_SYNOPSIS == n->sec)
+ print_otag(h, TAG_DIV, 0, NULL);
+
+ print_otag(h, TAG_SPAN, 1, &tag);
+ return(1);
+}
diff --git a/mdoc_term.c b/mdoc_term.c
index 7343ffdf..f50149bf 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -261,8 +261,8 @@ static const struct termact termacts[MDOC_MAX] = {
{ termp_brq_pre, termp_brq_post }, /* Bro */
{ NULL, NULL }, /* Brc */
{ NULL, NULL }, /* %C */
- { NULL, NULL }, /* Es */
- { NULL, NULL }, /* En */
+ { NULL, NULL }, /* Es */ /* TODO */
+ { NULL, NULL }, /* En */ /* TODO */
{ termp_xx_pre, NULL }, /* Dx */
{ NULL, NULL }, /* %Q */
{ termp_sp_pre, NULL }, /* br */
@@ -1417,7 +1417,7 @@ termp_bt_pre(DECL_ARGS)
{
term_word(p, "is currently in beta test.");
- return(1);
+ return(0);
}
@@ -1426,7 +1426,8 @@ static void
termp_lb_post(DECL_ARGS)
{
- term_newln(p);
+ if (SEC_LIBRARY == node->sec)
+ term_newln(p);
}