From 8f65e2365fc46c19cff46c40dc76dbbd014fdbaa Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 9 Feb 2011 09:52:47 +0000 Subject: [PATCH] EQN blocks are now printed in all modes. This is simply a printing of the concatenated string (in -T[x]html, it gets a SPAN, too). --- example.style.css | 6 +++++- man_html.c | 10 ++++++++-- man_term.c | 3 ++- mdoc_html.c | 10 ++++++++-- mdoc_term.c | 3 ++- style.css | 19 ++++++++++++------- 6 files changed, 37 insertions(+), 14 deletions(-) diff --git a/example.style.css b/example.style.css index 7f640ee8..c7cc484f 100644 --- a/example.style.css +++ b/example.style.css @@ -1,4 +1,4 @@ -/* $Id: example.style.css,v 1.41 2011/01/05 13:00:11 kristaps Exp $ */ +/* $Id: example.style.css,v 1.42 2011/02/09 09:52:47 kristaps Exp $ */ /* * This is an example style-sheet provided for mandoc(1) and the -Thtml @@ -141,6 +141,10 @@ li.list-item { } ol.list-enum { padding-left: 2em; } li.list-enum { } +/* Equation modes. See eqn(7). */ + +span.eqn { } + /* Table modes. See tbl(7). */ table.tbl { } diff --git a/man_html.c b/man_html.c index e11127d2..357ae420 100644 --- a/man_html.c +++ b/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.68 2011/02/06 21:44:36 kristaps Exp $ */ +/* $Id: man_html.c,v 1.69 2011/02/09 09:52:47 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -180,6 +180,7 @@ print_man_node(MAN_ARGS) { int child; struct tag *t; + struct htmlpair tag; child = 1; t = h->tags.head; @@ -216,7 +217,10 @@ print_man_node(MAN_ARGS) print_otag(h, TAG_BR, 0, NULL); return; case (MAN_EQN): - return; + PAIR_CLASS_INIT(&tag, "eqn"); + print_otag(h, TAG_SPAN, 1, &tag); + print_text(h, n->eqn->data); + break; case (MAN_TBL): /* * This will take care of initialising all of the table @@ -261,6 +265,8 @@ print_man_node(MAN_ARGS) case (MAN_ROOT): man_root_post(m, n, mh, h); break; + case (MAN_EQN): + break; default: if (mans[n->tok].post) (*mans[n->tok].post)(m, n, mh, h); diff --git a/man_term.c b/man_term.c index f0a9879f..82af7018 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.102 2011/02/06 21:44:36 kristaps Exp $ */ +/* $Id: man_term.c,v 1.103 2011/02/09 09:52:47 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -897,6 +897,7 @@ print_man_node(DECL_ARGS) p->flags |= TERMP_SENTENCE; return; case (MAN_EQN): + term_word(p, n->eqn->data); return; case (MAN_TBL): /* diff --git a/mdoc_html.c b/mdoc_html.c index b6e61034..712cd92a 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.152 2011/02/06 23:02:31 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.153 2011/02/09 09:52:47 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * @@ -410,6 +410,7 @@ print_mdoc_node(MDOC_ARGS) { int child; struct tag *t; + struct htmlpair tag; child = 1; t = h->tags.head; @@ -433,7 +434,10 @@ print_mdoc_node(MDOC_ARGS) print_text(h, n->string); return; case (MDOC_EQN): - return; + PAIR_CLASS_INIT(&tag, "eqn"); + print_otag(h, TAG_SPAN, 1, &tag); + print_text(h, n->eqn->data); + break; case (MDOC_TBL): /* * This will take care of initialising all of the table @@ -481,6 +485,8 @@ print_mdoc_node(MDOC_ARGS) case (MDOC_ROOT): mdoc_root_post(m, n, h); break; + case (MDOC_EQN): + break; default: if (mdocs[n->tok].post && ENDBODY_NOT == n->end) (*mdocs[n->tok].post)(m, n, h); diff --git a/mdoc_term.c b/mdoc_term.c index 25ad7fea..a6d6dd89 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_term.c,v 1.218 2011/02/06 23:02:31 schwarze Exp $ */ +/* $Id: mdoc_term.c,v 1.219 2011/02/09 09:52:47 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010 Ingo Schwarze @@ -355,6 +355,7 @@ print_mdoc_node(DECL_ARGS) term_word(p, n->string); break; case (MDOC_EQN): + term_word(p, n->eqn->data); break; case (MDOC_TBL): term_tbl(p, n->span); diff --git a/style.css b/style.css index 4fb1b5d8..b51c7219 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,4 @@ -/* $Id: style.css,v 1.20 2010/12/24 22:51:13 kristaps Exp $ */ +/* $Id: style.css,v 1.21 2011/02/09 09:52:47 kristaps Exp $ */ html { max-width: 800px; } body { color: #333333; @@ -30,23 +30,18 @@ h2 { margin-bottom: 0px; color: #000000; font-size: 0.93em; margin-left: -2ex; div.section { margin-bottom: 2ex; margin-left: 4ex; } /* Sections (Sh, SH). */ div.subsection { } /* Sub-sections (Ss, SS). */ table.synopsis { } /* SYNOPSIS section table. */ -table.synopsis td { vertical-align: top; } /* SYNOPSIS section table. */ /* Vertical spacing. */ p { } /* Paragraph: Pp, Lp. */ blockquote { margin-top: 0px; margin-bottom: 0px; } table { margin-top: 0px; margin-bottom: 0px; } +td { vertical-align: top; } /* SYNOPSIS section table. */ /* General font modes. */ -.lit { font-family: monospace; font-style: normal; font-weight: normal; } /* Literal: Dl, Li, Bf -literal, Bl -literal, Bl -unfilled. */ -.italic { font-style: italic; font-weight: normal; } /* Italic: BI, IB, I, (implicit). */ .emph { font-style: italic; font-weight: normal; } /* Emphasis: Em, Bl -emphasis. */ -.bold { font-style: normal; font-weight: bold; } /* Bold: SB, BI, IB, BR, RB, B, (implicit). */ .symb { font-style: normal; font-weight: bold; } /* Symbolic: Sy, Ms, Bf -symbolic. */ -.roman { font-style: normal; font-weight: normal; } /* Roman: (implicit). */ -.small { font-style: normal; font-weight: normal; font-size: smaller; } /* Small: SB, SM. */ /* Block modes. */ @@ -75,6 +70,8 @@ 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). */ +i.link-sec { font-weight: normal; } /* Section links (Sx). */ +code.lit { font-style: normal; font-weight: normal; } /* Literal: Dl, Li, Bf -literal, Bl -literal, Bl -unfilled. */ 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). */ @@ -144,3 +141,11 @@ li.list-item { } ol.list-enum { padding-left: 2em; } li.list-enum { } + +/* Equation modes. See eqn(7). */ + +span.eqn { } + +/* Table modes. See tbl(7). */ + +table.tbl { } -- 2.47.1