aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-09-21 13:44:56 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-09-21 13:44:56 +0000
commit66128bd2b82f1fc879b3184cfcc13dbad7f6acbe (patch)
tree54dbba3e20d1a4149d4e91199e3f03ca3d2c5e02
parent45125ba202b3ffc9d0c79af5dd63dce1fabcc6bb (diff)
downloadmandoc-66128bd2b82f1fc879b3184cfcc13dbad7f6acbe.tar.gz
mandoc-66128bd2b82f1fc879b3184cfcc13dbad7f6acbe.tar.zst
mandoc-66128bd2b82f1fc879b3184cfcc13dbad7f6acbe.zip
Fixed body/divbody structure of html pages.
Added example style.css (example.style.css). Enabled using -Thtml to generate manuals in Makefile. Stopped making text manuals for webpage.
-rw-r--r--Makefile12
-rw-r--r--example.style.css40
-rw-r--r--html.c27
-rw-r--r--index.sgml18
-rw-r--r--mandoc.18
-rw-r--r--style.css59
6 files changed, 98 insertions, 66 deletions
diff --git a/Makefile b/Makefile
index 5848d7c1..586ad4c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.SUFFIXES: .html .xml .sgml .1.txt .3.txt .7.txt .1 .3 .7 .md5 .tar.gz .1.html .3.html .7.html
+.SUFFIXES: .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.html .3.html .7.html
BINDIR = $(PREFIX)/bin
INCLUDEDIR = $(PREFIX)/include
@@ -55,16 +55,14 @@ HTMLS = index.html ChangeLog.html mandoc.1.html mdoc.3.html \
man.3.html mdoc.7.html man.7.html mandoc_char.7.html \
manuals.7.html
XMLS = ChangeLog.xml
-STATICS = style.css external.png
+STATICS = index.css style.css external.png
MD5S = mdocml-$(VERSION).md5
TARGZS = mdocml-$(VERSION).tar.gz
MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
man.7 man.3
-TEXTS = mandoc.1.txt mdoc.3.txt mdoc.7.txt manuals.7.txt \
- mandoc_char.7.txt man.7.txt man.3.txt
BINS = mandoc
CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
- $(TARGZS) tags $(TEXTS) $(MD5S) $(XMLS)
+ $(TARGZS) tags $(MD5S) $(XMLS)
INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
$(DATAS) $(XSLS)
@@ -80,10 +78,10 @@ cleanlint:
dist: mdocml-$(VERSION).tar.gz
-www: all $(HTMLS) $(MD5S) $(TARGZS) $(TEXTS)
+www: all $(HTMLS) $(MD5S) $(TARGZS)
installwww: www
- install -m 0444 $(TEXTS) $(HTMLS) $(STATICS) $(PREFIX)/
+ install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
diff --git a/example.style.css b/example.style.css
new file mode 100644
index 00000000..ceb5cc74
--- /dev/null
+++ b/example.style.css
@@ -0,0 +1,40 @@
+div.body { } /* Wraps entire body file. */
+
+span.sec-head { font-weight: bold; } /* Sections (Sh). */
+div.sec-head { }
+div.sec-body { }
+div.sec-block { }
+
+span.ssec-head { font-weight: bold; } /* Sub-sections (Ss). */
+div.ssec-head { }
+div.ssec-body { }
+div.ssec-block { }
+
+span.addr { text-decoration: underline; } /* Address (Ad). */
+span.arg { font-style: italic; } /* Command argument (Ar). */
+span.author { } /* Author name (An). */
+span.config { font-weight: bold; } /* Config statement (Cd). */
+span.define { } /* Defines (Dv). */
+span.desc { } /* Nd. After em-dash. */
+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 { font-style: underline; } /* Function argument (Fa, Fn). */
+span.file { font-style: italic; } /* File (Pa). */
+span.flag { font-weight: bold; } /* Flag (Fl, Cm). */
+span.macro { } /* Macro-ish thing (Fd). */
+span.name { font-weight: bold; } /* Name of utility (Nm). */
+span.opt { } /* Options (Op, Oo/Oc). */
+span.type { font-weight: italic; } /* Variable types (Vt, Ft, Fn). */
+span.unix { } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */
+span.utility { font-weight: bold; } /* Name of utility (Ex). */
+
+a.link-man { } /* Manual links (Xr). */
+a.link-sec { } /* Section links (Sx). */
+
+div.lit-block { font-family: monospace; } /* Literal block (D1, Bd -literal, Dl). */
+
+table.header { } /* Document header. */
+table.footer { } /* Document footer. */
+
diff --git a/html.c b/html.c
index 17d22b7e..257b53de 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.45 2009/09/21 13:43:21 kristaps Exp $ */
+/* $Id: html.c,v 1.46 2009/09/21 13:44:56 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -558,12 +558,18 @@ static void
print_mdoc(MDOC_ARGS)
{
struct tag *t;
+ struct htmlpair tag;
t = print_otag(h, TAG_HEAD, 0, NULL);
print_mdoc_head(m, n, h);
print_tagq(h, t);
t = print_otag(h, TAG_BODY, 0, NULL);
+
+ tag.key = ATTR_CLASS;
+ tag.val = "body";
+ print_otag(h, TAG_DIV, 1, &tag);
+
print_mdoc_nodelist(m, n, h);
print_tagq(h, t);
}
@@ -915,7 +921,7 @@ static void
print_gen_doctype(struct html *h)
{
- printf("<!DOCTYPE HTML PUBLIC \"%s\" \"%s\">\n", DOCTYPE, DTD);
+ printf("<!DOCTYPE HTML PUBLIC \"%s\" \"%s\">", DOCTYPE, DTD);
}
@@ -1059,14 +1065,10 @@ mdoc_root_pre(MDOC_ARGS)
"%s(%d)", m->title, m->msec);
tag[0].key = ATTR_CLASS;
- tag[0].val = "body";
- t = print_otag(h, TAG_DIV, 1, tag);
-
- tag[0].key = ATTR_CLASS;
tag[0].val = "header";
tag[1].key = ATTR_STYLE;
tag[1].val = "width: 100%;";
- print_otag(h, TAG_TABLE, 2, tag);
+ t = print_otag(h, TAG_TABLE, 2, tag);
tt = print_otag(h, TAG_TR, 0, NULL);
tag[0].key = ATTR_STYLE;
@@ -1085,7 +1087,7 @@ mdoc_root_pre(MDOC_ARGS)
tag[0].val = "width: 33%; text-align: right;";
print_otag(h, TAG_TD, 1, tag);
print_text(h, b);
- print_stagq(h, t);
+ print_tagq(h, t);
return(1);
}
@@ -1261,6 +1263,7 @@ mdoc_op_pre(MDOC_ARGS)
/* XXX - this can contain block elements! */
print_text(h, "\\(lB");
+ h->flags |= HTML_NOSPACE;
tag.key = ATTR_CLASS;
tag.val = "opt";
print_otag(h, TAG_SPAN, 1, &tag);
@@ -1422,8 +1425,12 @@ mdoc_tbl_block_pre(MDOC_ARGS, int t, int w, int o, int c)
break;
}
- if ( ! c && n->prev && n->prev->body->child)
- bufcat("padding-top: 1em;");
+ if ( ! c && MDOC_Column != t) {
+ if (n->prev && n->prev->body->child)
+ bufcat("padding-top: 1em;");
+ else if (NULL == n->prev)
+ bufcat("padding-top: 1em;");
+ }
tag.key = ATTR_STYLE;
tag.val = buf;
diff --git a/index.sgml b/index.sgml
index 9f118c26..22dc4666 100644
--- a/index.sgml
+++ b/index.sgml
@@ -133,7 +133,7 @@
</h1>
<p>
- These manuals are generated automatically (with <a href="mandoc.1.txt">mandoc(1)</a>) and refer to the
+ These manuals are generated automatically (with <a href="mandoc.1.html">mandoc(1)</a> -Thtml) and refer to the
current snapshot.
</p>
@@ -142,31 +142,31 @@
<col>
<tbody>
<tr>
- <td><a href="mandoc.1.txt">mandoc(1)</a></td>
+ <td><a href="mandoc.1.html">mandoc(1)</a></td>
<td>format and display UNIX manuals</td>
</tr>
<tr>
- <td><a href="mandoc_char.7.txt">mandoc_char(7)</a></td>
+ <td><a href="mandoc_char.7.html">mandoc_char(7)</a></td>
<td>mandoc special characters</td>
</tr>
<tr>
- <td><a href="mdoc.7.txt">mdoc(7)</a></td>
+ <td><a href="mdoc.7.html">mdoc(7)</a></td>
<td>mdoc language reference</td>
</tr>
<tr>
- <td><a href="man.7.txt">man(7)</a></td>
+ <td><a href="man.7.html">man(7)</a></td>
<td>man language reference</td>
</tr>
<tr>
- <td><a href="manuals.7.txt">manuals(7)</a></td>
+ <td><a href="manuals.7.html">manuals(7)</a></td>
<td>a guide to writing UNIX manuals</td>
</tr>
<tr>
- <td><a href="mdoc.3.txt">mdoc(3)</a></td>
+ <td><a href="mdoc.3.html">mdoc(3)</a></td>
<td>mdoc macro compiler library</td>
</tr>
<tr>
- <td><a href="man.3.txt">man(3)</a></td>
+ <td><a href="man.3.html">man(3)</a></td>
<td>man macro compiler library</td>
</tr>
</tbody>
@@ -195,7 +195,7 @@
<tr>
<td>
<div class="foot">
- Copyright &#169; 2008, 2009 Kristaps D&#382;onsons, $Date: 2009/09/21 13:06:13 $
+ Copyright &#169; 2008, 2009 Kristaps D&#382;onsons, $Date: 2009/09/21 13:44:56 $
</div>
</td>
</tr>
diff --git a/mandoc.1 b/mandoc.1
index 58af31c6..318f0798 100644
--- a/mandoc.1
+++ b/mandoc.1
@@ -1,4 +1,4 @@
-.\" $Id: mandoc.1,v 1.37 2009/09/21 13:06:13 kristaps Exp $
+.\" $Id: mandoc.1,v 1.38 2009/09/21 13:44:56 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
.\"
@@ -277,6 +277,12 @@ To page manuals to the terminal:
.D1 % mandoc mandoc.1 mdoc.3 mdoc.7 | less
.
.Pp
+To produce HTML manuals with
+.Pa http://localhost/
+as the base URI:
+.Pp
+.D1 % mandoc \-Thtml -obase=http://localhost/ mdoc.7 > mdoc.7.html
+.Pp
To check over a large set of manuals:
.
.Pp
diff --git a/style.css b/style.css
index ceb5cc74..40c71590 100644
--- a/style.css
+++ b/style.css
@@ -1,40 +1,21 @@
-div.body { } /* Wraps entire body file. */
-
-span.sec-head { font-weight: bold; } /* Sections (Sh). */
-div.sec-head { }
-div.sec-body { }
-div.sec-block { }
-
-span.ssec-head { font-weight: bold; } /* Sub-sections (Ss). */
-div.ssec-head { }
-div.ssec-body { }
-div.ssec-block { }
-
-span.addr { text-decoration: underline; } /* Address (Ad). */
-span.arg { font-style: italic; } /* Command argument (Ar). */
-span.author { } /* Author name (An). */
-span.config { font-weight: bold; } /* Config statement (Cd). */
-span.define { } /* Defines (Dv). */
-span.desc { } /* Nd. After em-dash. */
-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 { font-style: underline; } /* Function argument (Fa, Fn). */
-span.file { font-style: italic; } /* File (Pa). */
-span.flag { font-weight: bold; } /* Flag (Fl, Cm). */
-span.macro { } /* Macro-ish thing (Fd). */
-span.name { font-weight: bold; } /* Name of utility (Nm). */
-span.opt { } /* Options (Op, Oo/Oc). */
-span.type { font-weight: italic; } /* Variable types (Vt, Ft, Fn). */
-span.unix { } /* Unices (Ux, Ox, Nx, Fx, Bx, Bsx, Dx). */
-span.utility { font-weight: bold; } /* Name of utility (Ex). */
-
-a.link-man { } /* Manual links (Xr). */
-a.link-sec { } /* Section links (Sx). */
-
-div.lit-block { font-family: monospace; } /* Literal block (D1, Bd -literal, Dl). */
-
-table.header { } /* Document header. */
-table.footer { } /* Document footer. */
+div.body { color: #333333;
+ max-width: 800px;
+ padding-left: 10px;
+ font-size: smaller;
+ font-family: Verdana, Tahoma, Arial, sans-serif; }
+span.sec-head { font-weight: bold; color: blue; }
+span.ssec-head { font-weight: bold; color: blue; }
+span.addr { text-decoration: underline; }
+span.arg { font-style: italic; }
+span.config { font-weight: bold; }
+span.diag { font-weight: bold; }
+span.emph { font-style: italic; }
+span.farg { font-style: underline; }
+span.file { font-style: italic; }
+span.flag { font-weight: bold; }
+span.name { font-weight: bold; }
+span.type { font-weight: italic; }
+span.utility { font-weight: bold; }
+table.header { border-bottom: 1px dotted #cccccc; }
+table.footer { border-top: 1px dotted #cccccc; }