4 static void html_doc_beg(int fd
)
6 file_put(fd
, "<body>\n");
9 static void html_doc_end(int fd
)
11 file_put(fd
, "</body>\n");
14 static void html_head_beg(int fd
, int level
)
17 sprintf(buf
, "<h%d>", level
+ 1);
21 static void html_head_end(int fd
, int level
)
24 sprintf(buf
, "</h%d>", level
+ 1);
28 static void html_par_beg(int fd
)
30 file_put(fd
, "<p>\n");
33 static void html_par_end(int fd
)
37 static void html_put(int fd
, char *s
)
42 static void html_list_beg(int fd
)
44 file_put(fd
, "<ul>\n");
47 static void html_list_end(int fd
)
49 file_put(fd
, "</ul>\n");
52 static void html_item_beg(int fd
)
57 static void html_item_end(int fd
)
59 file_put(fd
, "</li>\n");
62 static void html_pre_beg(int fd
)
64 file_put(fd
, "<pre>");
67 static void html_pre_end(int fd
)
69 file_put(fd
, "</pre>");
72 static void html_formula_beg(int fd
)
74 file_put(fd
, "<p><i>");
77 static void html_formula_end(int fd
)
79 file_put(fd
, "</i>\n");
82 static void html_put_emph(int fd
, char *s
)
89 static void html_put_raw(int fd
, char *s
)
94 static void html_put_ref(int fd
, char *s
)
99 static void html_put_url(int fd
, char *url
, char *desc
)
101 char *msg
= desc
&& *desc
? desc
: url
;
102 file_put(fd
, "<a href=\"");
106 file_put(fd
, "</a>");
109 struct fmt_ops html_ops
= {
110 .doc_beg
= html_doc_beg
,
111 .doc_end
= html_doc_end
,
112 .head_beg
= html_head_beg
,
113 .head_end
= html_head_end
,
114 .par_beg
= html_par_beg
,
115 .par_end
= html_par_end
,
116 .list_beg
= html_list_beg
,
117 .list_end
= html_list_end
,
118 .item_beg
= html_item_beg
,
119 .item_end
= html_item_end
,
120 .pre_beg
= html_pre_beg
,
121 .pre_end
= html_pre_end
,
122 .formula_beg
= html_formula_beg
,
123 .formula_end
= html_formula_end
,
124 .put_emph
= html_put_emph
,
125 .put_raw
= html_put_raw
,
126 .put_ref
= html_put_ref
,
127 .put_url
= html_put_url
,