aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-09 07:10:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-09 07:10:37 +0000
commit4c4347f61f4092bdbcbcf3598d2f5a6b91d631a1 (patch)
tree3633c1eda24d9a68ca8453ba7653373170941564
parentb91662305e6d87cdb8d5494c0fc742b1dd45b29c (diff)
downloadmandoc-4c4347f61f4092bdbcbcf3598d2f5a6b91d631a1.tar.gz
mandoc-4c4347f61f4092bdbcbcf3598d2f5a6b91d631a1.tar.zst
mandoc-4c4347f61f4092bdbcbcf3598d2f5a6b91d631a1.zip
RS tags implemented for -Tman -Thtml.
-rw-r--r--man_html.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/man_html.c b/man_html.c
index d42bebb5..244a7c5e 100644
--- a/man_html.c
+++ b/man_html.c
@@ -1,4 +1,4 @@
-/* $Id: man_html.c,v 1.8 2009/10/08 23:00:15 kristaps Exp $ */
+/* $Id: man_html.c,v 1.9 2009/10/09 07:10:37 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -60,6 +60,7 @@ static int man_HP_pre(MAN_ARGS);
static int man_I_pre(MAN_ARGS);
static int man_IP_pre(MAN_ARGS);
static int man_PP_pre(MAN_ARGS);
+static int man_RS_pre(MAN_ARGS);
static int man_SB_pre(MAN_ARGS);
static int man_SH_pre(MAN_ARGS);
static int man_SM_pre(MAN_ARGS);
@@ -99,7 +100,7 @@ static const struct htmlman mans[MAN_MAX] = {
{ NULL, NULL }, /* fi */
{ NULL, NULL }, /* r */
{ NULL, NULL }, /* RE */
- { NULL, NULL }, /* RS */
+ { man_RS_pre, NULL }, /* RS */
{ man_ign_pre, NULL }, /* DT */
{ man_ign_pre, NULL }, /* UC */
};
@@ -565,6 +566,8 @@ man_IP_pre(MAN_ARGS)
if (MAN_BLOCK == n->type) {
bufcat_su(h, "margin-left", &su);
+ SCALE_VS_INIT(&su, 1);
+ bufcat_su(h, "margin-top", &su);
bufcat_style(h, "clear", "both");
PAIR_STYLE_INIT(&tag, h);
print_otag(h, TAG_DIV, 1, &tag);
@@ -621,6 +624,8 @@ man_HP_pre(MAN_ARGS)
if (MAN_BLOCK == n->type) {
bufcat_su(h, "margin-left", &su);
+ SCALE_VS_INIT(&su, 1);
+ bufcat_su(h, "margin-top", &su);
bufcat_style(h, "clear", "both");
PAIR_STYLE_INIT(&tag, h);
print_otag(h, TAG_DIV, 1, &tag);
@@ -668,3 +673,30 @@ man_ign_pre(MAN_ARGS)
return(0);
}
+
+
+/* ARGSUSED */
+static int
+man_RS_pre(MAN_ARGS)
+{
+ struct htmlpair tag;
+ struct roffsu su;
+
+ if (MAN_HEAD == n->type)
+ return(0);
+ else if (MAN_BODY == n->type)
+ return(1);
+
+ SCALE_HS_INIT(&su, INDENT);
+ bufcat_su(h, "margin-left", &su);
+
+ if (n->head->child) {
+ SCALE_VS_INIT(&su, 1);
+ a2width(n->head->child, &su);
+ bufcat_su(h, "margin-top", &su);
+ }
+
+ PAIR_STYLE_INIT(&tag, h);
+ print_otag(h, TAG_DIV, 1, &tag);
+ return(1);
+}