summaryrefslogtreecommitdiffstats
path: root/html.h
Commit message (Collapse)AuthorAgeFilesLines
* Do not write duplicate id= attributes, they violate HTML syntax.Ingo Schwarze2018-05-251-1/+1
| | | | | 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-0/+1
| | | | | | | | | 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-1/+2
| | | | | 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-2/+2
| | | | | | 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-0/+1
| | | | | 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-0/+2
| | | | | | | 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-0/+2
| | | | | 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-0/+1
| | | | suggested by bentley@ long ago, but needed lots of cleanup first
* for .Rs, use <cite>Ingo Schwarze2017-02-051-0/+1
|
* Improve <table> syntax:Ingo Schwarze2017-02-051-1/+1
| | | | | | | | 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-5/+1
| | | | no functional change
* Fix -man -Thtml formatting after .nf (which has nothing to doIngo Schwarze2017-01-261-0/+1
| | | | | | | | | | | | | | | | 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-1/+0
| | | | in particular, stop abuse of <blockquote>
* Implement line breaking of the generated HTML code at space charactersIngo Schwarze2017-01-191-2/+5
| | | | | | | | | 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-0/+3
| | | | | 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-15/+0
| | | | | | | | | 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-35/+2
| | | | | | | | | | 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-4/+2
| | | | | | | 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-3/+0
| | | | | | | | | | | | 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-1/+0
| | | | | | | | | | | | | * 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-0/+1
| | | | | 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-2/+5
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* remove unneccessary inclusion protection; patch from deraadt@Ingo Schwarze2014-12-011-4/+0
|
* Make the character table available to libroff so it can check theIngo Schwarze2014-10-281-1/+1
| | | | | | | | 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-1/+1
|
* Re-write of eqn(7) parser and MathML output.Kristaps Dzonsons2014-10-101-0/+1
| | | | | | | | | | 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-0/+3
|
* Add support for some MathML elements and attributes in our HTML5.Kristaps Dzonsons2014-09-281-0/+15
|
* Don't pretend we have a separate XHTML and HTML mode any more.Kristaps Dzonsons2014-09-271-6/+0
|
* Remove <p> in favour of <div class="spacer">.Kristaps Dzonsons2014-09-271-1/+1
| | | | | | | 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-1/+0
|
* HTML5-isation: remove more alignments.Kristaps Dzonsons2014-09-271-1/+0
|
* Kick out "summary" attribute, which isn't HTML5.Kristaps Dzonsons2014-09-271-2/+0
|
* Kick out two attibutes we don't use any more in HTML5.Kristaps Dzonsons2014-09-271-2/+0
|
* First, add space for default styling for HTML5 (non-fragment) output.Kristaps Dzonsons2014-09-271-0/+1
| | | | | 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-0/+1
|
* implement .An -[no]split for -ThtmlIngo Schwarze2014-09-171-0/+2
|
* Revert previous, as requested by kristaps@.Ingo Schwarze2014-08-141-1/+0
| | | | | | | | | | | | | 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-0/+1
| | | | | | | | | | | | | | | | | 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-6/+6
| | | | | 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-0/+3
| | | | | 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-0/+1
| | | | | 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-0/+1
| | | | | | | | | | | | | | | | | | 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@
* Add the -Ofragment option to -T[]x]html. This accomodates for embeddingKristaps Dzonsons2011-10-051-3/+5
| | | | | manual output in existing HTML or XHTML documents, e.g., when invoking mandoc from an SSI or CGI.
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-1/+1
| | | | found while syncing to OpenBSD
* Flip on equation printing for -T[x]html.Kristaps Dzonsons2011-07-231-0/+1
|
* Cleanups in -T[x]html: make html_idcat() use the buffer and be calledKristaps Dzonsons2011-05-171-6/+6
| | | | | | bufcat_id(), then collapse it into a little function without so much crap. Next, make bufinit() only be called when we really need to do so, and not simply before pre/post calls.
* Clean-ups in -T[x]html: inline print_num(), as it was just a singleKristaps Dzonsons2011-05-171-2/+1
| | | | | | | | | | conditional; same for print_xmltype() and print_doctype(), same reason; make bufncat() be static, as it was only being called from html.c; have bufcat() simply call through to strlcat(). Finally, assert() whenever we truncate. Also rename buffmt() -> bufcat_fmt() to differentiate from buffmt_man et al., which do not concatenate.
* Give -Thtml and -Txhtml the gift of recognising escapes when calculatingKristaps Dzonsons2011-05-141-0/+1
| | | | | widths (e.g., `Bl -tag -width "\s[blahblah]bar"). This has long since been done for -Tascii but escaped noticed with -T[x]html.
* Move "chars" interface out of out.h and into mandoc.h. This doesn'tKristaps Dzonsons2011-04-291-1/+1
| | | | | | | | | | change any code but for renaming functions and types to be consistent with other mandoc.h stuff. The reason for moving into libmandoc is that the rendering of special characters is part of mandoc itself---not an external part. From mandoc(1)'s perspective, this changes nothing, but for other utilities, it's important to have these part of libmandoc. Note this isn't documented [yet] in mandoc.3 because there are some parts I'd like to change around beforehand.