aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.h
Commit message (Collapse)AuthorAgeFilesLines
* drop flag HTML_LITERAL which is no longer usedIngo Schwarze2018-12-311-2/+1
|
* Yet another round of improvements to manual font selection.Ingo Schwarze2018-12-161-1/+2
| | | | | | | | | Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP. In regress.pl, only strip leading whitespace in math mode.
* Implement the \f(CW and \f(CR (constant width font) escape sequencesIngo Schwarze2018-10-251-1/+2
| | | | | | | | | for HTML output. Somewhat relevant because pod2man(1) relies on this. Missing feature reported by Pali dot Rohar at gmail dot com. Note that constant width font was already correctly selected before this when required by semantic markup. Only attempting physical markup with the low-level escape sequence was ineffective.
* Add an option -T html -O toc to add a brief table of contents nearIngo Schwarze2018-10-021-1/+3
| | | | | the top of HTML pages containing at least two non-standard sections. Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
* Support a second argument to -O man,Ingo Schwarze2018-10-021-2/+3
| | | | | | selecting the format according to local existence of the file. Suggested by kristaps@ during EuroBSDCon 2018. Written on the train Frankfurt-Karlsruhe returning from EuroBSDCon.
* Delete substantial amounts of codeIngo Schwarze2018-06-251-2/+1
| | | | now that we no longer use variable style= attributes.
* Do not write <colgroup> elements. Their only purpose is to enforceIngo Schwarze2018-06-251-3/+1
| | | | | | author-specified column widths, which can harm responsive design and provide no real benefit: HTML rendering engines usually do just fine automatically selecting appropriate column widths.
* Do not write duplicate id= attributes, they violate HTML syntax.Ingo Schwarze2018-05-251-2/+2
| | | | | Append suffixes for disambiguation. Issue first reported by Jakub Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
* Fix a long-standing issue:Ingo Schwarze2018-05-091-1/+2
| | | | | | | | | Some macros (Nd, Oo) can contain blocks but rendered as elements that can only contain phrasing content, resulting in invalid HTML nesting. Switch them to <div>. Also move the related "display: inline" style from the HTML to the CSS. Reminded during a conversation with John Gardner.
* preserve comments before .Dd and .TH (typically Copyright and license)Ingo Schwarze2018-04-131-2/+3
| | | | | in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner <wiz at NetBSD>
* 1. Eliminate struct eqn, instead use the existing membersIngo Schwarze2017-07-081-3/+3
| | | | | | of struct roff_node which is allocated for each equation anyway. 2. Do not keep a list of equation parsers, one parser is enough. Minus fifty lines of code, no functional change.
* Write text boxes as <mi>, <mn>, or <mo> as appropriate,Ingo Schwarze2017-06-231-1/+2
| | | | | and write fontstyle or fontweight attributes where required. Missing features reported by bentley@.
* Start roff formatter modules for HTML and termininal output,Ingo Schwarze2017-05-041-1/+3
| | | | | | | used by both the mdoc and man formatters, with the ultimate goal of reducing code duplication between the two macro formatters. Made possible by the parser unification. Add the first formatting function (for the .br request).
* Minimal support for deep linking into man(7) pages.Ingo Schwarze2017-03-151-1/+3
| | | | | As the man(7) language does not provide semantic markup, only .SH, .SS, and .UR become anchors for now.
* mark up .Ar, .Fa, .Va, .Ft, and .Vt with <var> rather than <i>;Ingo Schwarze2017-02-051-1/+2
| | | | suggested by bentley@ long ago, but needed lots of cleanup first
* for .Rs, use <cite>Ingo Schwarze2017-02-051-1/+2
|
* Improve <table> syntax:Ingo Schwarze2017-02-051-2/+2
| | | | | | | | The <col> element can only appear inside <colgroup>, so use <colgroup>. The <tbody> element is optional and useless, so don't use it. Even if we would ever need <thead> or <tfoot>, <tbody> would still be optional and useless; besides, we will likely never need <thead> or <tfoot>, simply because our languages don't support such functionality.
* eliminate one useless struct and one level of indirection;Ingo Schwarze2017-01-291-6/+2
| | | | no functional change
* Fix -man -Thtml formatting after .nf (which has nothing to doIngo Schwarze2017-01-261-1/+2
| | | | | | | | | | | | | | | | with "literal", by the way, it means "no fill"): * Use <pre> such that whitespace is preserved. * Preserve lines breaks. * For font alternating macros, avoid node recursion which required scary juggling with the fill state. Instead, simply print the text children directly. Missing feature first noticed by kristaps@ in 2011, the again reported by afresh1@ in 2016, and finally reported here: https://github.com/Debian/debiman/issues/21 , which i only found because of Shane Kerr's comment here: https://plus.google.com/110314300533310775053/posts/H1eaw9Yskoc
* clean up markup of .Bd, .D1, .Dl, .Li, and .Ql;Ingo Schwarze2017-01-191-2/+1
| | | | in particular, stop abuse of <blockquote>
* Implement line breaking of the generated HTML code at space charactersIngo Schwarze2017-01-191-3/+6
| | | | | | | | | in filled text. This does not affect HTML semantics, but makes the HTML code even more humanly readable. While here, - collapse multiple consecutive space characters in filled text - and insert a blank between style entries.
* Make HTML output more human readable by overhauling line break logicIngo Schwarze2017-01-181-1/+4
| | | | | around tags and by introducing some simple indentation. No change of HTML semantics intended.
* Completely delete the buf field of struct html and all the buf*()Ingo Schwarze2017-01-171-16/+1
| | | | | | | | | interfaces. Such a static buffer was a bad idea in the first place, causing unfixable truncation that was only prevented by triggering an assertion failure. Instead, let the small number of remaining users allocate and free their own, temporary dynamic buffers, or for the case of .Xr and .In, pass the original data to be assembled in print_otag().
* Simplify the usage of print_otag() by making it accept a variableIngo Schwarze2017-01-171-36/+3
| | | | | | | | | | number of arguments. Delete struct htmlpair and all the PAIR_*() macros. Delete enum htmlattr, handle that in print_otag() instead. Minus 190 lines of code; no functional change except better ordering of attributes (class before style) in three cases.
* Use __attribute__((__format__ throughout.Ingo Schwarze2016-07-191-5/+3
| | | | | | | Triggered by a smaller patch from Christos Zoulas. While here, unify style, move several config tests to config.h, and delete the useless MANDOC_CONFIG_H.
* In private header files, __BEGIN_DECLS and __END_DECLS are pointless.Ingo Schwarze2015-11-071-4/+1
| | | | | | | | | | | | Because these work slightly differently on different systems, they are becoming a maintenance burden in the portable version, so delete them. Besides, one of the chief design goals of the mandoc toolbox is to make sure that nothing related to documentation requires C++. Consequently, linking mandoc against any kind of C++ program would defeat the purpose and is not supported. I don't understand why kristaps@ added them in the first place.
* Major character table cleanup:Ingo Schwarze2015-10-131-2/+1
| | | | | | | | | | | | | * Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
* Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze2014-12-021-1/+2
| | | | | In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
* header cleanup:Ingo Schwarze2014-12-011-3/+6
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* remove unneccessary inclusion protection; patch from deraadt@Ingo Schwarze2014-12-011-5/+1
|
* Make the character table available to libroff so it can check theIngo Schwarze2014-10-281-2/+2
| | | | | | | | validity of character escape names and warn about unknown ones. This requires mchars_spec2cp() to report unknown names again. Fortunately, that doesn't require changing the calling code because according to groff, invalid character escapes should not produce output anyway, and now that we warn about them, that's fine.
* sync Copyright years after merge to OpenBSD; no code changeIngo Schwarze2014-10-101-2/+2
|
* Re-write of eqn(7) parser and MathML output.Kristaps Dzonsons2014-10-101-1/+2
| | | | | | | | | | This adds parser-level support for the grammar described by the eqn second-edition technical paper, "Typesetting Mathematics — User's Guide" (Kernighan, Cherry). The reason for this re-write is the grouping rules, which were not possible given the existing implementation. The re-write has also considerably simplified the HTML (and, if it ever is completed, terminal) front-end.
* Change "to" and "from" commands to use munder, mover, and munderover.Kristaps Dzonsons2014-09-281-1/+4
|
* Add support for some MathML elements and attributes in our HTML5.Kristaps Dzonsons2014-09-281-1/+16
|
* Don't pretend we have a separate XHTML and HTML mode any more.Kristaps Dzonsons2014-09-271-7/+1
|
* Remove <p> in favour of <div class="spacer">.Kristaps Dzonsons2014-09-271-2/+2
| | | | | | | This is good because <p> is brittle: it can't appear within other block macros. This fixes a regression of the original HTML5 patch as noted by schwarze@ on the tech@ list, 14/8/2014.
* Remove last hard-coded width attribute.Kristaps Dzonsons2014-09-271-2/+1
|
* HTML5-isation: remove more alignments.Kristaps Dzonsons2014-09-271-2/+1
|
* Kick out "summary" attribute, which isn't HTML5.Kristaps Dzonsons2014-09-271-3/+1
|
* Kick out two attibutes we don't use any more in HTML5.Kristaps Dzonsons2014-09-271-3/+1
|
* First, add space for default styling for HTML5 (non-fragment) output.Kristaps Dzonsons2014-09-271-1/+2
| | | | | This uses a <style /> block right before the <link /> for the stylesheet. Use this to kick out hardcoded header and footer table widths.
* First steps in HTML5: use UTF8 meta-charset and HTML5 doctype identifier.Kristaps Dzonsons2014-09-271-1/+2
|
* implement .An -[no]split for -ThtmlIngo Schwarze2014-09-171-1/+3
|
* Revert previous, as requested by kristaps@.Ingo Schwarze2014-08-141-2/+1
| | | | | | | | | | | | | The .Bf block can contain subblocks, so it has to render as an element that can contain flow content. But <em> cannot contain flow content, only phrasing content. Rendering .Em and .Bf differently would by unfortunate, and closing out .Bf before subblocks and re-opening it afterwards would merely complicate both the C code of the program and the generated HTML code. Besides, converting .Em to semantic HTML markup would require some content to be put into <em> and some into <i>, but we cannot automatically distinguish which is which, so strictly speaking, we can't use semantic HTML here but have to fall back to physical markup. Wonders of HTML...
* Use <em> for .Em and .Bf -emphasis.Ingo Schwarze2014-08-131-1/+2
| | | | | | | | | | | | | | | | | The vast majority of .Em in real-world manuals is stress emphasis, for which <em> is the correct markup. Admittedly, there are some instances of .Em usage for alternate quality, for which <i> would be a better match. Most of these are technical terms that neither allow semantic markup nor are keywords - for the latter, .Sy would be preferable. A typical example is that the shell breaks input into .Em words . Alternate voice or mood, which would also require <i>, is almost absent from manuals. We cannot satisfy both stress emphasis and alternate quality, so pick the one that fits more often and looks less wrong when off. Patch from Guy Harris <guy at alum dot mit dot edu>. ok joerg@ bentley@
* KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze2014-04-201-7/+7
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Tag functions with format strings as arguments as printf-like.Joerg Sonnenberger2014-01-051-1/+4
| | | | | Fix one case where a non-literal is used as format string. Fix another case where a variable is formatted using the wrong type.
* Implement the roff(7) font-escape sequence \f(BI "bold+italic".Ingo Schwarze2013-08-081-1/+2
| | | | | This improves the formatting of about 40 base manuals and reduces groff-mandoc formatting differences in base by about 5%.
* Implement the roff \z escape sequence, intended to output the nextIngo Schwarze2012-05-311-1/+2
| | | | | | | | | | | | | | | | | | character without advancing the cursor position; implement it to simply skip the next character, as it will usually be overwritten. With this change, the pod2man(1) preamble user-defined string \*:, intended to render as a diaeresis or umlaut diacritic above the preceding character, is rendered in a slightly less ugly way, though still not correctly. It was rendered as "z.." and is now rendered as ".". Given that the definition of \*: uses elaborate manual \h positioning, there is little chance for mandoc(1) to ever render it correctly, but at least we can refrain from printing out a spurious "z", and we can make the \z do something semi-reasonable for easier cases. "just commit" kristaps@