summaryrefslogtreecommitdiffstats
path: root/mandoc_html.3
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-15 11:29:53 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-15 11:29:53 +0000
commit28bf3097cb23e1f811b5273cd04e16d309f04607 (patch)
tree38ecfdeb14b8bad014fc814155f7a1dd2f311e86 /mandoc_html.3
parent7f62257df910dabf75acbc931ba339de0abde743 (diff)
downloadmandoc-28bf3097cb23e1f811b5273cd04e16d309f04607.tar.gz
Minimal support for deep linking into man(7) pages.
As the man(7) language does not provide semantic markup, only .SH, .SS, and .UR become anchors for now.
Diffstat (limited to 'mandoc_html.3')
-rw-r--r--mandoc_html.329
1 files changed, 28 insertions, 1 deletions
diff --git a/mandoc_html.3 b/mandoc_html.3
index deae701b..f675d400 100644
--- a/mandoc_html.3
+++ b/mandoc_html.3
@@ -48,6 +48,14 @@
.Fa "struct html *h"
.Fa "const char *word"
.Fc
+.Ft char *
+.Fo html_make_id
+.Fa "const struct roff_node *n"
+.Fc
+.Ft int
+.Fo html_strlen
+.Fa "const char *cp"
+.Fc
.Sh DESCRIPTION
The mandoc HTML formatter is not a formal library.
However, as it is compiled into more than one program, in particular
@@ -306,8 +314,27 @@ and
.Fn print_tagq
functions.
.Pp
+The function
+.Fn html_make_id
+takes a node containing one or more text children
+and returns a newly allocated string containing the concatenation
+of the child strings, with blanks replaced by underscores.
+If the node
+.Fa n
+contains any non-text child node,
+.Fn html_make_id
+returns
+.Dv NULL
+instead.
+The caller is responsible for freeing the returned string.
+.Pp
+The function
+.Fn html_strlen
+counts the number of characters in
+.Fa cp .
+It is used as a crude estimate of the width needed to display a string.
+.Pp
The functions
-.Fn html_strlen ,
.Fn print_eqn ,
.Fn print_tbl ,
and