summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--chars.in4
-rw-r--r--example.style.css17
-rw-r--r--mdoc_html.c34
-rw-r--r--mdoc_term.c6
4 files changed, 41 insertions, 20 deletions
diff --git a/chars.in b/chars.in
index 429fb237..1e5d3048 100644
--- a/chars.in
+++ b/chars.in
@@ -1,4 +1,4 @@
-/* $Id: chars.in,v 1.17 2009/09/23 11:02:21 kristaps Exp $ */
+/* $Id: chars.in,v 1.18 2009/09/24 11:55:28 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -32,7 +32,7 @@
/* Spacing. */
CHAR("c", 1, "", 0, "", 0)
-CHAR("0", 1, " ", 1, "&#8194;", 6)
+CHAR("0", 1, " ", 1, "&#8194;", 7)
CHAR(" ", 1, " ", 1, "&#8194;", 7)
CHAR("~", 1, " ", 1, "&#160;", 6)
CHAR("%", 1, "", 0, "", 0)
diff --git a/example.style.css b/example.style.css
index 03e4360c..99441efa 100644
--- a/example.style.css
+++ b/example.style.css
@@ -1,4 +1,5 @@
-div.body { font-family: monospace; min-width: 580px; width: 580px; } /* Top-most div tag. */
+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 { }
@@ -22,9 +23,10 @@ span.emph { font-style: italic; } /* Emphasis (Em). */
span.env { } /* Environment variables (Ev). */
span.errno { } /* Error string (Er). */
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.fname { font-weight: bold; } /* Function name (Fa, Fn, Rv). */
+span.ftype { font-style: italic; } /* Function types (Ft, Fn). */
span.includes { font-weight: bold; } /* Header includes (In). */
span.lib { } /* Library (Lb). */
span.lit { font-family: monospace; } /* Literals (Bf -literal). */
@@ -32,20 +34,19 @@ 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. */
-span.type { font-style: italic; } /* Variable types (Vt, Ft, Fn). */
+span.type { font-style: italic; } /* Variable types (Vt). */
span.unix { } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */
span.utility { font-weight: bold; } /* Name of utility (Ex). */
span.var { font-weight: bold; } /* Variables (Rv). */
+a.link-ext { } /* Off-site link (Lk). */
+a.link-mail { } /* Mailto links (Mt). */
a.link-man { } /* Manual links (Xr). */
a.link-sec { } /* Section links (Sx). */
-a.link-mail { } /* Mailto links (Mt). */
-a.link-ext { } /* Off-site link (Lk). */
-div.lit { } /* Literal (D1, Bd -literal, Dl, Bd -literal). */
div.emph { font-style: italic; } /* Emphasis (Bl -emphasis). */
+div.lit { } /* Literal (D1, Bd -literal, Dl, Bd -literal). */
div.symb { font-weight: bold; } /* Symbols (Bl -symbolic). */
-table.header { } /* Document header. */
table.footer { } /* Document footer. */
-
+table.header { } /* Document header. */
diff --git a/mdoc_html.c b/mdoc_html.c
index 03c3c504..ade7d89b 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.6 2009/09/24 11:05:45 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.7 2009/09/24 11:55:28 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/queue.h>
#include <assert.h>
@@ -1560,7 +1561,7 @@ mdoc_ft_pre(MDOC_ARGS)
}
tag.key = ATTR_CLASS;
- tag.val = "type";
+ tag.val = "ftype";
print_otag(h, TAG_SPAN, 1, &tag);
return(1);
}
@@ -1573,6 +1574,9 @@ mdoc_fn_pre(MDOC_ARGS)
struct tag *t;
struct htmlpair tag;
const struct mdoc_node *nn;
+ char nbuf[BUFSIZ];
+ const char *sp, *ep;
+ int sz;
if (SEC_SYNOPSIS == n->sec) {
if (n->next) {
@@ -1583,13 +1587,33 @@ mdoc_fn_pre(MDOC_ARGS)
print_otag(h, TAG_DIV, 0, NULL);
}
+ /* Split apart into type and name. */
+
tag.key = ATTR_CLASS;
- tag.val = "type";
+ tag.val = "ftype";
+ t = print_otag(h, TAG_SPAN, 1, &tag);
+
+ assert(n->child->string);
+ sp = n->child->string;
+ while ((ep = strchr(sp, ' '))) {
+ sz = MIN(ep - sp, BUFSIZ - 1);
+ (void)memcpy(nbuf, sp, sz);
+ nbuf[sz] = '\0';
+ print_text(h, nbuf);
+ sp = ++ep;
+ }
- /* FIXME: can be "type funcname" "type varname"... */
+ print_tagq(h, t);
+ tag.key = ATTR_CLASS;
+ tag.val = "fname";
t = print_otag(h, TAG_SPAN, 1, &tag);
- print_text(h, n->child->string);
+
+ if (sp) {
+ (void)strlcpy(nbuf, sp, BUFSIZ);
+ print_text(h, nbuf);
+ }
+
print_tagq(h, t);
h->flags |= HTML_NOSPACE;
diff --git a/mdoc_term.c b/mdoc_term.c
index 7331d0d9..aff4614d 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.81 2009/09/24 11:05:45 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.82 2009/09/24 11:55:28 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -1519,10 +1519,6 @@ termp_fn_pre(DECL_ARGS)
{
const struct mdoc_node *n;
- assert(node->child && MDOC_TEXT == node->child->type);
-
- /* FIXME: can be "type funcname" "type varname"... */
-
p->bold++;
term_word(p, node->child->string);
p->bold--;