summaryrefslogtreecommitdiffstats
path: root/mandoc_html.3
Commit message (Collapse)AuthorAgeFilesLines
* Improve accessibility of -T html -O toc output by using the <nav> elementIngo Schwarze2022-06-241-0/+4
| | | | | | | | | | | | | in the DPUB-ARIA doc-toc role. Patch from Anna Vyalkova <cyber at sysrq dot in> slightly tweaked by me. This is hopefully the start of a collaboration to improve accessibility of Unix manual pages using the WAI-ARIA, HTML-ARIA, and DPUB-ARIA standards. Progress appears to be possible without changing *anything* with respect to the way manual pages are written. Instead, it seems sufficient to properly translate semantic cues already implied by existing mdoc(7) markup into the appropriate HTML elements and ARIA attributes. Overall, the total length of HTML output is likely to increase slightly, but not much.
* Resurrect the documentation of the print_otag() 's' attribute specifier,Ingo Schwarze2020-04-241-0/+17
| | | | | reverting a minor part of rev. 1.21. Contrary to what i thought, that attribute *is* still supported for a small number of unusual cases.
* Correctly handle non-unique tags even when NODE_ID and NODE_HREF fallIngo Schwarze2020-04-191-14/+15
| | | | apart, NODE_ID occurring earlier than NODE_HREF.
* Major update:Ingo Schwarze2020-04-181-30/+135
| | | | | Complete includes, add several functions, no more <?xml?>, no more style attributes, NODE_HREF flag, mention roff_html.c.
* Split tagging into a validation part including prioritizationIngo Schwarze2020-03-131-16/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in tag.{h,c} and {mdoc,man}_validate.c and into a formatting part including command line argument checking in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c. Immediate functional benefits include: * Improved prioritization of automatic tags for .Em and .Sy. * Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged. * Explicit tagging of .Er and .Fl now works in HTML output. * Automatic tagging of .IP and .TP now works in HTML output. But mainly, this patch provides clean earth to build further improvements on. Technical changes: * Main program: Write a tag file for ASCII and UTF-8 output only. * All formatters: There is no more need to delay writing the tags. * mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection. * HTML formatter: If available, use the "string" attribute as the tag. * HTML formatter: New function to write permalinks, to reduce code duplication. Style cleanup in the vicinity while here: * mdoc(7) terminal formatter: To set up bold font for children, defer to termp_bold_pre() rather than calling term_fontpush() manually. * mdoc(7) terminal formatter: Garbage collect some duplicate functions. * mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions. * Where possible, use switch statements rather than if cascades. * Get rid of some more Yoda notation. The necessity for such changes was first discussed with kn@, but i didn't bother him with a request to review the resulting -673/+782 line patch.
* Remove the HTML title= attributes which harmed accessibility andIngo Schwarze2019-01-111-5/+0
| | | | | | | violated the principle of separation of content and presentation. Instead, implement the tooltips purely in CSS. Thanks to John Gardner <gardnerjohng at gmail dot com> for suggesting most of the styling in the new ::before rules.
* Support more than one style attribute one the same HTML element.Ingo Schwarze2018-11-261-0/+8
| | | | | In fact, this is already required when a table uses non-default horizontal and vertical alignment in the same cell.
* Delete substantial amounts of codeIngo Schwarze2018-06-251-28/+3
| | | | now that we no longer use variable style= attributes.
* Delete support for style=margin-left attributes, which are no longer used.Ingo Schwarze2018-06-251-9/+0
|
* Delete support for style=width attributes, which are no longer used.Ingo Schwarze2018-06-251-24/+0
|
* Delete support for the style=text-indent attribute, which is no longer used.Ingo Schwarze2018-06-251-4/+0
|
* delete support for the HTML style=height property, which is no longer usedIngo Schwarze2018-06-101-4/+0
|
* Delete support for the print_otag(sw) * and - modifiers,Ingo Schwarze2018-05-291-10/+2
| | | | which are no longer used because we write fewer style= attributes.
* preserve comments before .Dd and .TH (typically Copyright and license)Ingo Schwarze2018-04-131-1/+15
| | | | | in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner <wiz at NetBSD>
* In .Bl -tag and -hang, do not print a margin-left style attributeIngo Schwarze2017-07-151-3/+6
| | | | | | for each individual item if the -width argument matches the default of 6n. Suggested by Steffen Nurpmeso <steffen at sdaoden dot eu> on <groff at GNU dot org> in April 2017.
* Handle .Bl -compact via CSS rather than writing individual styleIngo Schwarze2017-07-141-13/+0
| | | | | | | | attributes into .It blocks; suggested by Steffen Nurpmeso <steffen at sdaoden dot eu> on <groff at GNU dot org> in April 2017. Delete margin-bottom and margin-top style names and the 'v' argument letter from print_otag() because they are no longer used.
* Make the tag column in .Bl -tag lists wider:Ingo Schwarze2017-05-121-5/+13
| | | | | | 1. I forgot about the 2n padding between tag and body. 2. The factor 1.1 was too small for bold fold, make it *1.15 + 1n. Ugliness spotted by tb@.
* Minimal support for deep linking into man(7) pages.Ingo Schwarze2017-03-151-1/+28
| | | | | As the man(7) language does not provide semantic markup, only .SH, .SS, and .UR become anchors for now.
* Print title="..." in addition to id="..." attributes for macro keysIngo Schwarze2017-03-131-0/+5
| | | | | that can be searched for by apropos(1), such that you see the semantic function in a tooltip when hovering with the mouse.
* Simplify usage of print_otag() even more:Ingo Schwarze2017-01-281-3/+14
| | | | accept NULL to skip the attribute or format.
* Improve HTML formatting of .Bl -tag.Ingo Schwarze2017-01-251-0/+4
| | | | | | | | | | | | | | | | | | | | | In particular, when using the style sheet, put the body on the same line as the head for short heads, or on the next line for long heads, in a way that preserves both correct indentation and correct vertical spacing with and without -compact, and with one or more heads per body (hi, Zaphod) - eight use cases so far - and with and without -tag, and with and without -offset, 32 use cases grand total. Using many ideas from zhuk@, from <David dot Dahlberg at fkie dot fraunhofer dot de>, and from Benny Lofgren <bl dash lists at lofgren dot biz>, and a few of my own. This is an excellent demonstration that CSS is an extremely hostile language, much more trapful and much harder to use than, say, C. When matthew@ reported this in July 2014 (!), it was already a known issue, and i no longer remember for how long. My first serious attempt at fixing it (in November 2015) failed miserably. I'd love to see simplifications of both the generated HTML code and of the style sheet, but without breaking any of the 32 use cases, please.
* Completely delete the buf field of struct html and all the buf*()Ingo Schwarze2017-01-171-25/+21
| | | | | | | | | 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-17/+112
| | | | | | | | | | 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.
* Partially document the core of the HTML formatter.Ingo Schwarze2014-07-231-0/+249
Stuff i learnt during my audit for XSS vulnerabilities.