summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
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
commit5827a70535876bf8f6a58191951c114f0c56b47d (patch)
treec70e07b67ec726e75b3d8f603ce5df539ad5f8a9 /mdoc_html.c
parente31ba3ca2b454ee69e0708aa1fce28e3c3337584 (diff)
downloadmandoc-5827a70535876bf8f6a58191951c114f0c56b47d.tar.gz
mandoc-5827a70535876bf8f6a58191951c114f0c56b47d.tar.zst
mandoc-5827a70535876bf8f6a58191951c114f0c56b47d.zip
Sync'd example style-sheet to be more like OpenBSD's default (KISS).
-Thtml and -Tascii now have equivalent functionality.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c85
1 files changed, 78 insertions, 7 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index 20d589e0..03c3c504 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.5 2009/09/24 09:50:31 kristaps Exp $ */
+/* $Id: mdoc_html.c,v 1.6 2009/09/24 11:05:45 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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);
+}