]>
git.cameronkatri.com Git - mandoc.git/blob - html.h
1 /* $Id: html.h,v 1.112 2022/07/06 14:34:59 schwarze Exp $ */
3 * Copyright (c) 2017, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
4 * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * Internal interfaces for mandoc(1) HTML formatters.
19 * For use by the individual HTML formatters only.
87 #define HTML_NOSPACE (1 << 0) /* suppress next space */
88 #define HTML_IGNDELIM (1 << 1)
89 #define HTML_KEEP (1 << 2)
90 #define HTML_PREKEEP (1 << 3)
91 #define HTML_NONOSPACE (1 << 4) /* never add spaces */
92 #define HTML_SKIPCHAR (1 << 6) /* skip the next character */
93 #define HTML_NOSPLIT (1 << 7) /* do not break line before .An */
94 #define HTML_SPLIT (1 << 8) /* break line before .An */
95 #define HTML_NONEWLINE (1 << 9) /* No line break in nofill mode. */
96 #define HTML_BUFFER (1 << 10) /* Collect a word to see if it fits. */
97 #define HTML_TOCDONE (1 << 11) /* The TOC was already written. */
98 size_t indent
; /* current output indentation level */
99 int noindent
; /* indent disabled by <pre> */
100 size_t col
; /* current output byte position */
101 size_t bufcol
; /* current buf byte position */
102 char buf
[80]; /* output buffer */
103 struct tag
*tag
; /* last open tag */
104 struct rofftbl tbl
; /* current table */
105 struct tag
*tblt
; /* current open table scope */
106 char *base_man1
; /* bases for manpage href */
108 char *base_includes
; /* base for include href */
109 char *style
; /* style-sheet URI */
110 struct tag
*metaf
; /* current open font scope */
111 enum mandoc_esc metal
; /* last used font */
112 enum mandoc_esc metac
; /* current font mode */
113 int oflags
; /* output options */
114 #define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */
115 #define HTML_TOC (1 << 1) /* emit a table of contents */
123 void roff_html_pre(struct html
*, const struct roff_node
*);
125 void print_gen_comment(struct html
*, struct roff_node
*);
126 void print_gen_decls(struct html
*);
127 void print_gen_head(struct html
*);
128 struct tag
*print_otag(struct html
*, enum htmltag
, const char *, ...);
129 struct tag
*print_otag_id(struct html
*, enum htmltag
, const char *,
131 void print_tagq(struct html
*, const struct tag
*);
132 void print_stagq(struct html
*, const struct tag
*);
133 void print_tagged_text(struct html
*, const char *,
135 void print_text(struct html
*, const char *);
136 void print_tblclose(struct html
*);
137 void print_tbl(struct html
*, const struct tbl_span
*);
138 void print_eqn(struct html
*, const struct eqn_box
*);
139 void print_endline(struct html
*);
141 void html_close_paragraph(struct html
*);
142 enum roff_tok
html_fillmode(struct html
*, enum roff_tok
);
143 char *html_make_id(const struct roff_node
*, int);
144 int html_setfont(struct html
*, enum mandoc_esc
);