summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/html.h
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-10-07 18:17:05 +0000
committerschwarze <schwarze@openbsd.org>2014-10-07 18:17:05 +0000
commitd649d931bf0407240f85927503fd3fa7dbacda6d (patch)
tree03f0d5afcb14cb74b334277c6101e4237d5a0c58 /usr.bin/mandoc/html.h
parentIf a tbl(7) layout contains unknown font modifiers, fall back to the (diff)
downloadwireguard-openbsd-d649d931bf0407240f85927503fd3fa7dbacda6d.tar.xz
wireguard-openbsd-d649d931bf0407240f85927503fd3fa7dbacda6d.zip
Switch HTML output to polyglot HTML5; have only one single -Thml mode.
Replace hard-coded widths and alignments with a minimal embedded stylesheet. Do not use <p> because it cannot appear inside block macros. Remove the "summary" attribute because it is not HTML5. Written by kristaps@ some months ago, finished during EuroBSDCon.
Diffstat (limited to 'usr.bin/mandoc/html.h')
-rw-r--r--usr.bin/mandoc/html.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/usr.bin/mandoc/html.h b/usr.bin/mandoc/html.h
index 2f7a874fdb1..784992c51dc 100644
--- a/usr.bin/mandoc/html.h
+++ b/usr.bin/mandoc/html.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: html.h,v 1.24 2014/09/17 19:53:35 schwarze Exp $ */
+/* $OpenBSD: html.h,v 1.25 2014/10/07 18:17:05 schwarze Exp $ */
/*
- * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -44,18 +44,16 @@ enum htmltag {
TAG_DT,
TAG_DD,
TAG_BLOCKQUOTE,
- TAG_P,
TAG_PRE,
TAG_B,
TAG_I,
TAG_CODE,
TAG_SMALL,
+ TAG_STYLE,
TAG_MAX
};
enum htmlattr {
- ATTR_HTTPEQUIV,
- ATTR_CONTENT,
ATTR_NAME,
ATTR_REL,
ATTR_HREF,
@@ -63,11 +61,9 @@ enum htmlattr {
ATTR_MEDIA,
ATTR_CLASS,
ATTR_STYLE,
- ATTR_WIDTH,
ATTR_ID,
- ATTR_SUMMARY,
- ATTR_ALIGN,
ATTR_COLSPAN,
+ ATTR_CHARSET,
ATTR_MAX
};
@@ -103,12 +99,6 @@ struct htmlpair {
#define PAIR_CLASS_INIT(p, v) PAIR_INIT(p, ATTR_CLASS, v)
#define PAIR_HREF_INIT(p, v) PAIR_INIT(p, ATTR_HREF, v)
#define PAIR_STYLE_INIT(p, h) PAIR_INIT(p, ATTR_STYLE, (h)->buf)
-#define PAIR_SUMMARY_INIT(p, v) PAIR_INIT(p, ATTR_SUMMARY, v)
-
-enum htmltype {
- HTML_HTML_4_01_STRICT,
- HTML_XHTML_1_0_STRICT
-};
struct html {
int flags;
@@ -133,7 +123,6 @@ struct html {
struct tag *metaf; /* current open font scope */
enum htmlfont metal; /* last used font */
enum htmlfont metac; /* current font mode */
- enum htmltype type; /* output media type */
int oflags; /* output options */
#define HTML_FRAGMENT (1 << 0) /* don't emit HTML/HEAD/BODY */
};
@@ -148,6 +137,7 @@ void print_text(struct html *, const char *);
void print_tblclose(struct html *);
void print_tbl(struct html *, const struct tbl_span *);
void print_eqn(struct html *, const struct eqn *);
+void print_paragraph(struct html *);
void bufcat_fmt(struct html *, const char *, ...);
void bufcat(struct html *, const char *);