Print this page
9718 update mandoc to 1.14.4
   1 /*      $Id: html.h,v 1.87 2017/07/08 14:51:04 schwarze Exp $ */
   2 /*
   3  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
   4  * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
   5  *
   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.
   9  *
  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.
  17  */
  18 
  19 enum    htmltag {
  20         TAG_HTML,
  21         TAG_HEAD,
  22         TAG_BODY,
  23         TAG_META,
  24         TAG_TITLE,
  25         TAG_DIV,

  26         TAG_H1,
  27         TAG_H2,
  28         TAG_SPAN,
  29         TAG_LINK,
  30         TAG_BR,
  31         TAG_A,
  32         TAG_TABLE,
  33         TAG_COLGROUP,
  34         TAG_COL,
  35         TAG_TR,
  36         TAG_TD,
  37         TAG_LI,
  38         TAG_UL,
  39         TAG_OL,
  40         TAG_DL,
  41         TAG_DT,
  42         TAG_DD,
  43         TAG_PRE,
  44         TAG_VAR,
  45         TAG_CITE,
  46         TAG_B,
  47         TAG_I,
  48         TAG_CODE,
  49         TAG_SMALL,
  50         TAG_STYLE,
  51         TAG_MATH,
  52         TAG_MROW,
  53         TAG_MI,
  54         TAG_MN,


 102         struct tag       *tag; /* last open tag */
 103         struct rofftbl    tbl; /* current table */
 104         struct tag       *tblt; /* current open table scope */
 105         char             *base_man; /* base for manpage href */
 106         char             *base_includes; /* base for include href */
 107         char             *style; /* style-sheet URI */
 108         struct tag       *metaf; /* current open font scope */
 109         enum htmlfont     metal; /* last used font */
 110         enum htmlfont     metac; /* current font mode */
 111         int               oflags; /* output options */
 112 #define HTML_FRAGMENT    (1 << 0) /* don't emit HTML/HEAD/BODY */
 113 };
 114 
 115 
 116 struct  roff_node;
 117 struct  tbl_span;
 118 struct  eqn_box;
 119 
 120 void              roff_html_pre(struct html *, const struct roff_node *);
 121 

 122 void              print_gen_decls(struct html *);
 123 void              print_gen_head(struct html *);
 124 struct tag       *print_otag(struct html *, enum htmltag, const char *, ...);
 125 void              print_tagq(struct html *, const struct tag *);
 126 void              print_stagq(struct html *, const struct tag *);
 127 void              print_text(struct html *, const char *);
 128 void              print_tblclose(struct html *);
 129 void              print_tbl(struct html *, const struct tbl_span *);
 130 void              print_eqn(struct html *, const struct eqn_box *);
 131 void              print_paragraph(struct html *);
 132 void              print_endline(struct html *);
 133 
 134 char             *html_make_id(const struct roff_node *);
 135 int               html_strlen(const char *);
   1 /*      $Id: html.h,v 1.92 2018/06/25 16:54:59 schwarze Exp $ */
   2 /*
   3  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
   4  * Copyright (c) 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
   5  *
   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.
   9  *
  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.
  17  */
  18 
  19 enum    htmltag {
  20         TAG_HTML,
  21         TAG_HEAD,
  22         TAG_BODY,
  23         TAG_META,
  24         TAG_TITLE,
  25         TAG_DIV,
  26         TAG_IDIV,
  27         TAG_H1,
  28         TAG_H2,
  29         TAG_SPAN,
  30         TAG_LINK,
  31         TAG_BR,
  32         TAG_A,
  33         TAG_TABLE,


  34         TAG_TR,
  35         TAG_TD,
  36         TAG_LI,
  37         TAG_UL,
  38         TAG_OL,
  39         TAG_DL,
  40         TAG_DT,
  41         TAG_DD,
  42         TAG_PRE,
  43         TAG_VAR,
  44         TAG_CITE,
  45         TAG_B,
  46         TAG_I,
  47         TAG_CODE,
  48         TAG_SMALL,
  49         TAG_STYLE,
  50         TAG_MATH,
  51         TAG_MROW,
  52         TAG_MI,
  53         TAG_MN,


 101         struct tag       *tag; /* last open tag */
 102         struct rofftbl    tbl; /* current table */
 103         struct tag       *tblt; /* current open table scope */
 104         char             *base_man; /* base for manpage href */
 105         char             *base_includes; /* base for include href */
 106         char             *style; /* style-sheet URI */
 107         struct tag       *metaf; /* current open font scope */
 108         enum htmlfont     metal; /* last used font */
 109         enum htmlfont     metac; /* current font mode */
 110         int               oflags; /* output options */
 111 #define HTML_FRAGMENT    (1 << 0) /* don't emit HTML/HEAD/BODY */
 112 };
 113 
 114 
 115 struct  roff_node;
 116 struct  tbl_span;
 117 struct  eqn_box;
 118 
 119 void              roff_html_pre(struct html *, const struct roff_node *);
 120 
 121 void              print_gen_comment(struct html *, struct roff_node *);
 122 void              print_gen_decls(struct html *);
 123 void              print_gen_head(struct html *);
 124 struct tag       *print_otag(struct html *, enum htmltag, const char *, ...);
 125 void              print_tagq(struct html *, const struct tag *);
 126 void              print_stagq(struct html *, const struct tag *);
 127 void              print_text(struct html *, const char *);
 128 void              print_tblclose(struct html *);
 129 void              print_tbl(struct html *, const struct tbl_span *);
 130 void              print_eqn(struct html *, const struct eqn_box *);
 131 void              print_paragraph(struct html *);
 132 void              print_endline(struct html *);
 133 
 134 char             *html_make_id(const struct roff_node *, int);