CVS log for mandoc/mdoc_html.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.350 / (download) - annotate - [select for diffs], Wed Jul 6 16:05:40 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.349: +3 -3 lines
Diff to previous 1.349 (colored) to selected 1.307 (colored)

https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/ says:
"Start names with a capital letter;
it helps some screen readers speak them with appropriate inflection."
Anna Vyalkova already did that correctly when sending patches,
but i ruined it when committing, so fix it now.

Revision 1.349 / (download) - annotate - [select for diffs], Wed Jul 6 15:26:23 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.348: +2 -2 lines
Diff to previous 1.348 (colored) to selected 1.307 (colored)

assign the ARIA role "doc-subtitle" to the .Nd element;
discussed with Anna Vyalkova <cyber at sysrq dot in>

Revision 1.348 / (download) - annotate - [select for diffs], Wed Jul 6 14:34:59 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.347: +4 -4 lines
Diff to previous 1.347 (colored) to selected 1.307 (colored)

While the HTML standard allows multiple <h1> elements in the same
document, <h1> is intended for top level headers, and most of the
sections in a manual page can hardly be considered top-level.
It is more usual to use <h1> only for the main title of the document
of for the site name.

Consequently, move .Sh/.SH from <h1> to <h2> and .Ss/.SS from <h2>
to <h3>, freeing <h1> for use by header.html in man.cgi(8).

Discussed with Anna Vyalkova <cyber at sysrq dot in>.

Revision 1.347 / (download) - annotate - [select for diffs], Tue Jul 5 21:25:29 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.346: +18 -15 lines
Diff to previous 1.346 (colored) to selected 1.307 (colored)

Finally get rid of the archaic <table> markup for header and footer lines
and use flexbox CSS instead.  Improve accessibility by adding role
and aria-label attributes to these header and footer lines.
Using ideas from both Anna Vyalkova <cyber at sysrq dot in> and myself.

As a welcome side effect, this also resolves the long-standing issue
that the rendering was always 65em wide, requiring horizontal scrolling
when the window was narrower.  Now, rendering nicely adapts to browser
windows of arbitrary narrowness.

Revision 1.346 / (download) - annotate - [select for diffs], Mon Jul 4 14:37:33 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.345: +3 -3 lines
Diff to previous 1.345 (colored) to selected 1.307 (colored)

Put the HTML comment containing the Copyright header (if any)
between the <head> and the <body> rather than before the <head>
because the <meta charset="utf-8"/> element ought to be within
the first 1024 bytes of the HTML code.
Issue found with validator.w3.org.

Revision 1.345 / (download) - annotate - [select for diffs], Sun Jul 3 14:29:45 2022 UTC (20 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.344: +2 -2 lines
Diff to previous 1.344 (colored) to selected 1.307 (colored)

Instead of the custom <div class="manual-text">, use the standard
HTML <main> element.  The benefit is that it has the ARIA landmark
role "main" by default.  To ease the transition for people using
their own CSS file instead of mandoc.css, retain the custom class
for now.

I had this idea in a discussion with Anna Vyalkova <cyber at sysrq dot in>.
Patch from Anna, slightly tweaked by me.

Revision 1.344 / (download) - annotate - [select for diffs], Sat Jun 25 12:44:25 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.343: +20 -11 lines
Diff to previous 1.343 (colored) to selected 1.307 (colored)

If an .Xr macro contains a section argument, write an aria-label attribute
such that users of screen readers aren't forced to listen to lengthy and
distracting readings like "mdoc, left parenthesis, 7, right parenthesis".

Based on a patch from Anna Vyalkova <cyber at sysrq dot in>,
significantly tweaked by me.

Revision 1.343 / (download) - annotate - [select for diffs], Fri Jun 24 11:15:53 2022 UTC (21 months ago) by schwarze
Branch: MAIN
Changes since 1.342: +4 -3 lines
Diff to previous 1.342 (colored) to selected 1.307 (colored)

Improve accessibility of -T html -O toc output by using the <nav> element
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.

Revision 1.342 / (download) - annotate - [select for diffs], Tue Mar 30 19:26:20 2021 UTC (2 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.341: +6 -3 lines
Diff to previous 1.341 (colored) to selected 1.307 (colored)

In HTML output, correctly render .Bd -unfilled in proportionally-spaced
font, rather than with the monospace font appropriate for .Bd -literal.
This fixes a minibug reported by anton@.

Implemented by no longer relying on the typical browser default of
"pre { font-family: monospace }" but instead letting <pre> elements
inherit the font family from their parent, then adding an explicit CSS .Li
class only for those displays where the manual page author requested it
by using the -literal option on the .Bd macro.

Revision 1.341 / (download) - annotate - [select for diffs], Fri Oct 16 17:22:43 2020 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.340: +5 -6 lines
Diff to previous 1.340 (colored) to selected 1.307 (colored)

In HTML output, avoid printing a newline right after <pre>
and right before </pre> because that resulted in vertical
whitespace not requested by the manual page author.

Formatting bug reported by
Aman Verma <amanraoverma plus vim at gmail dot com> on discuss@.

Revision 1.340 / (download) - annotate - [select for diffs], Sun Apr 19 15:16:56 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.339: +9 -4 lines
Diff to previous 1.339 (colored) to selected 1.307 (colored)

Correctly handle non-unique tags even when NODE_ID and NODE_HREF fall
apart, NODE_ID occurring earlier than NODE_HREF.

Revision 1.339 / (download) - annotate - [select for diffs], Sat Apr 18 20:40:10 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.338: +7 -4 lines
Diff to previous 1.338 (colored) to selected 1.307 (colored)

When a .Tg is attached to a paragraph, attach the permalink
to the first word, or the first few words if they are short.

Revision 1.338 / (download) - annotate - [select for diffs], Mon Apr 6 10:16:17 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.337: +20 -15 lines
Diff to previous 1.337 (colored) to selected 1.307 (colored)

Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.
In HTML output, improve the logic for writing inside permalinks:
skip them when there is no child content or when there is a risk
that the children might contain flow content.

Revision 1.337 / (download) - annotate - [select for diffs], Wed Apr 1 20:21:08 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.336: +1 -3 lines
Diff to previous 1.336 (colored) to selected 1.307 (colored)

Just like we are already doing it in HTML output, automatically tag
section and subsection headers in terminal output, too.  Even though
admittedly, commands like "/SEE" and "/   Subsec" work, too, there
is no downside, and besides, with the recent improvements in the
tagging framework, implementation cost is negligible.

Revision 1.336 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:28 2020 UTC (4 years ago) by schwarze
Branch: MAIN
Changes since 1.335: +41 -159 lines
Diff to previous 1.335 (colored) to selected 1.307 (colored)

Split tagging into a validation part including prioritization
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.

Revision 1.335 / (download) - annotate - [select for diffs], Thu Feb 27 22:28:13 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.334: +2 -2 lines
Diff to previous 1.334 (colored) to selected 1.307 (colored)

The HTML standard does not allow self-closing syntax for non-void elements.
Consequently, write an explicit end tag for <mark> elements.

Revision 1.334 / (download) - annotate - [select for diffs], Thu Feb 27 01:43:52 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.333: +38 -32 lines
Diff to previous 1.333 (colored) to selected 1.307 (colored)

Introduce the concept of nodes that are semantically transparent:
they are skipped when looking for previous or following high-level
macros.  Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm
and .Tg, and man(7) .DT and .PD.  Use this concept for a variety
of improved decisions in various validators and formatters.

While here,
* remove a few const qualifiers on struct arguments that caused trouble;
* get rid of some more Yoda notation in the vicinity;
* and apply some other stylistic improvements in the vicinity.

I found this class of issues while considering .Tg patches from kn@.

Revision 1.333 / (download) - annotate - [select for diffs], Sun Jan 19 18:02:00 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.332: +14 -2 lines
Diff to previous 1.332 (colored) to selected 1.307 (colored)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.332 / (download) - annotate - [select for diffs], Wed Dec 11 18:44:05 2019 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.331: +8 -4 lines
Diff to previous 1.331 (colored) to selected 1.307 (colored)

In HTML, display straight quotes, not curly quotes, for Qq/Qo/Qc macros.
This is the intended behavior and already the case in terminal output.
Incorrect output noticed by Eldred Habert.
Patch from bentley@.

Revision 1.331 / (download) - annotate - [select for diffs], Sun Sep 15 00:08:55 2019 UTC (4 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.330: +27 -21 lines
Diff to previous 1.330 (colored) to selected 1.307 (colored)

Fix line breaking in no-fill mode (.Bd -unfilled/<pre>),
which apparently didn't work since the .Pp/<p> reorg.
The new logic is more similar to what the terminal formatter does:

1. Before a node that starts a new mdoc(7) input line,
start a new HTML output line.
2. An empty input line or a .Pp causes an empty output line.
3. Nothing needs to be done at the end of a node.

Severe misformatting was reported in table(5) by
Edgar Pettijohn <edgar at pettijohn dash web dot com> on misc@.

Revision 1.330 / (download) - annotate - [select for diffs], Tue Sep 3 15:09:44 2019 UTC (4 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.329: +2 -4 lines
Diff to previous 1.329 (colored) to selected 1.307 (colored)

Format .Nd with more logically with <span> rather than <div>; after all,
it is supposed to be a one-line description.  For the case where .Nd
generates flow content (which is very bad style but syntactically
valid), rely on the new feature of html_close_paragraph() to close
out the <span> prematurely, effectively moving the flow content out
of the .Nd for HTML presentation.  For the final closing, also rely
on the new html_close_paragraph() functionality, this time triggered
by the subsequent block, which will typically be .Sh SYNOPSIS.

Revision 1.329 / (download) - annotate - [select for diffs], Sun Sep 1 15:12:19 2019 UTC (4 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.328: +2 -2 lines
Diff to previous 1.328 (colored) to selected 1.307 (colored)

delete the TAG_IDIV crutch, which is no longer used

Revision 1.328 / (download) - annotate - [select for diffs], Fri Mar 1 10:57:18 2019 UTC (5 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.327: +6 -2 lines
Diff to previous 1.327 (colored) to selected 1.307 (colored)

Wrap .Sh/.SH sections and .Ss/.SS subsections in HTML <section> elements
as recommended for accessibility by the HTML 5 standard.
Triggered by a similar, but slightly different suggestion
from Laura Morales <lauretas at mail dot com>.

Revision 1.327 / (download) - annotate - [select for diffs], Fri Jan 18 14:36:21 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.326: +11 -8 lines
Diff to previous 1.326 (colored) to selected 1.307 (colored)

The .UR and .MT blocks in man(7) are represented by <a> elements
which establish phrasing context, but they can contain paragraph
breaks (which is relevant for terminal formatting, so we can't just
change the structure of the syntax tree), which are respresented
by <p> elements and cannot occur inside <a>.

Fix this by prematurely closing the <a> element in the HTML formatter.
This menas that the clickable text in HTML output is shorter than
what is represented as the link text in terminal output, but in
HTML, it is frankly impossible to have the clickable area of a
hyperlink extend across a paragraph break.  The difference in
presentation is not a major problem, and besides, paragraph breaks
inside .UR are rather poor style in the first place.

The implementation is quite tricky.  Naively closing out the <a>
prematurely would result in accessing a stale pointer when later
reaching the physical end of the .UR block.  So this commit separates
visual and structural closing of "struct tag" stack items.  Visual
closing means that the HTML element is closed but the "struct tag"
remains on the stack, to avoid later access to a stale pointer and
to avoid closing the same HTML element a second time later.

This also needs reference counting of pointers to "struct tag" stack
items because often more than one child holds a pointer to the same
parent item, and only the outermost child can safely do the physical
closing.

In the whole corpus of nearly half a million manual pages on
man.openbsd.org, this problem occurs in exactly one page: the
groff(1) version 1.20.1 manual contained in DragonFly-3.8.2, which
contains a formatting error triggering the bug.

Revision 1.326 / (download) - annotate - [select for diffs], Fri Jan 11 16:36:19 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.325: +3 -3 lines
Diff to previous 1.325 (colored) to selected 1.307 (colored)

do not access a NULL pointer when formatting a completely empty document

Revision 1.325 / (download) - annotate - [select for diffs], Fri Jan 11 12:56:43 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.324: +43 -43 lines
Diff to previous 1.324 (colored) to selected 1.307 (colored)

Remove the HTML title= attributes which harmed accessibility and
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.

Revision 1.324 / (download) - annotate - [select for diffs], Thu Jan 10 07:40:10 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.323: +1 -13 lines
Diff to previous 1.323 (colored) to selected 1.307 (colored)

After years of gnashing of teeth, i finally found a way to avoid
having to write empty list elements for non-compact .Bl -tag lists:

1. Add margin-bottom to the <dd>.
Note that margin-top on the <dt> doesn't work because it would put
a short <dt> lower than the <dd>; margin-bottom on the <dt> doesn't
work because it would put vertical space before the <dd> for a long
<dt>; and margin-top on the <dd> doesn't work because it would put
a short <dt> higher than the <dd>.  Only margin-bottom on the <dd>
has none of these adverse effects.

2. Of course, margin-bottom on the <dd> fails to take care of the
vertical spacing before the first list element, so implement that
separately by margin-top on the <dl>.

3. For .Bl -tag -compact, reset both to zero.

Revision 1.323 / (download) - annotate - [select for diffs], Mon Jan 7 07:26:29 2019 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.322: +132 -94 lines
Diff to previous 1.322 (colored) to selected 1.307 (colored)

Represent mdoc(7) .Pp (and .sp, and some SYNOPSIS and .Rs features)
by the <p> HTML element and use the html_fillmode() mechanism
for .Bd -unfilled, just like it was done for man(7) earlier, finally
getting rid both of the horrible <div class="Pp"></div> hack and
of the worst HTML syntax violations caused by nested displays.

Care is needed because in some situations, paragraphs have to remain
open across several subsequent macros, whereas in other situations,
they must get closed together with a block containing them.

Some implementation details include:
* Always close paragraphs before emitting HTML flow content.
* Let html_close_paragraph() also close <pre> for extra safety.
* Drop the old, now unused function print_paragraph().
* Minor adjustments in the top-level man(7) node formatter for symmetry.
* Bugfix: .Ss heads suspend no-fill mode, even though .Ss doesn't end it.
* Bugfix: give up on .Op semantic markup for now, see the comment.

Revision 1.322 / (download) - annotate - [select for diffs], Mon Dec 31 10:35:56 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.321: +4 -13 lines
Diff to previous 1.321 (colored) to selected 1.307 (colored)

Cleanup, no functional change:
Stop trying to keep fill mode state locally in the mdoc HTML formatter,
rely on the state stored in the nodes instead.

Note that the .Bd -literal code is buggy.  Nested literal displays
result in nested <pre> elements, which violates HTML syntax.
But i'm not yet fixing bugs in this commit, i'm merely deleting
code which has no effect.

Revision 1.321 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.320: +6 -6 lines
Diff to previous 1.320 (colored) to selected 1.307 (colored)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.320 / (download) - annotate - [select for diffs], Tue Dec 25 00:06:25 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.319: +2 -2 lines
Diff to previous 1.319 (colored) to selected 1.307 (colored)

bugfix: make the static class buffer long enough
for .Bl -bullet -compact -offset indent

Revision 1.319 / (download) - annotate - [select for diffs], Sat Dec 22 19:49:13 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.318: +3 -2 lines
Diff to previous 1.318 (colored) to selected 1.307 (colored)

In the TOC, close <a> before opening <ul>.
Simplified version of a bugfix patch from rapha@.

Revision 1.318 / (download) - annotate - [select for diffs], Sun Dec 16 00:17:02 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.317: +2 -1 lines
Diff to previous 1.317 (colored) to selected 1.307 (colored)

Yet another round of improvements to manual font selection.

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.

Revision 1.317 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:46 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.316: +1 -2 lines
Diff to previous 1.316 (colored) to selected 1.307 (colored)

Cleanup, no functional change:
Split the top level parser interface out of the utility header
mandoc.h, into a new header mandoc_parse.h, for use in the main
program and in the main parser only.
Move enum mandoc_os into roff.h because struct roff_man is the
place where it is stored.
This allows removal of mandoc.h from seven files in low-level
parsers and in formatters.

Revision 1.316 / (download) - annotate - [select for diffs], Mon Dec 3 21:00:10 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.315: +10 -4 lines
Diff to previous 1.315 (colored) to selected 1.307 (colored)

In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)
to the standard forms (Pp, Ft, PP) up front, such that later code
does not need to look for the obsolete versions.
This reduces the risk of incomplete handling.

Revision 1.315 / (download) - annotate - [select for diffs], Thu Oct 4 13:23:04 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.314: +4 -2 lines
Diff to previous 1.314 (colored) to selected 1.307 (colored)

When a subsection header contains no letters but only special
characters, skip the TOC entry.  Issue reported by kristaps@.

Revision 1.314 / (download) - annotate - [select for diffs], Tue Oct 2 19:44:15 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.313: +23 -7 lines
Diff to previous 1.313 (colored) to selected 1.307 (colored)

add DESCRIPTION and .Ss to the toc; suggested by espie@

Revision 1.313 / (download) - annotate - [select for diffs], Tue Oct 2 14:56:47 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.312: +32 -2 lines
Diff to previous 1.312 (colored) to selected 1.307 (colored)

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.

Revision 1.312 / (download) - annotate - [select for diffs], Tue Oct 2 12:33:37 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.311: +2 -2 lines
Diff to previous 1.311 (colored) to selected 1.307 (colored)

Support a second argument to -O man,
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.

Revision 1.311 / (download) - annotate - [select for diffs], Fri Aug 17 20:33:37 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.310: +8 -8 lines
Diff to previous 1.310 (colored) to selected 1.307 (colored)

Remove more pointer arithmetic passing via regions outside the array
that is undefined according to the C standard.  Robert Elz <kre at
munnari dot oz dot au> pointed out i wasn't quite done yet.

Revision 1.310 / (download) - annotate - [select for diffs], Fri Jul 27 17:49:31 2018 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.309: +1 -3 lines
Diff to previous 1.309 (colored) to selected 1.307 (colored)

garbage collect the unused "#define INDENT"

Revision 1.309 / (download) - annotate - [select for diffs], Mon Jun 25 16:54:59 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.308: +3 -4 lines
Diff to previous 1.308 (colored) to selected 1.307 (colored)

Delete substantial amounts of code
now that we no longer use variable style= attributes.

Revision 1.308 / (download) - annotate - [select for diffs], Mon Jun 25 14:06:07 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.307: +2 -2 lines
Diff to previous 1.307 (colored)

Drop explicit, constant style=margin-left attribute on .Bf blocks.
Since <div> uses HTML_NLAROUND, it is no longer needed.

Revision 1.307 / (download) - annotate - [selected], Mon Jun 25 13:45:57 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.306: +2 -22 lines
Diff to previous 1.306 (colored)

Do not write <colgroup> elements.  Their only purpose is to enforce
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.

Revision 1.306 / (download) - annotate - [select for diffs], Sun Jun 10 16:15:43 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.305: +10 -17 lines
Diff to previous 1.305 (colored) to selected 1.307 (colored)

In HTML output, for lists that have an -indent argument, just use
a uniform indentation in CSS adapted to the viewport width and
ignore the value of the argument taken from mdoc(7).  While
author-specified widths somewhat work as a micro-optimization in
terminal and typeset output, they are nothing but harmful in HTML
style= attributes because they break responsive design, whereas
using a reasonable default indent almost never results in ugly
output.  Admittedly, the author-specified width might occasionally
look even better, but only slightly so, and only for some viewport
sizes.
Based on guidance provided by John Gardner.

Revision 1.305 / (download) - annotate - [select for diffs], Tue May 29 01:55:50 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.304: +6 -7 lines
Diff to previous 1.304 (colored) to selected 1.307 (colored)

Ignore author-specified -width arguments for -tag and -hang lists
in HTML output.  For terminal and typeset output, such arguments
kind of work to achieve presentational micro-optimization.
But for HTML, they only do harm.

Large increases usually look ugly.  Large reductions are impossible
since the default is not large in the first place.  Small tweaks in
either direction are not important; at least not important enough
to justify making responsive design impossible.

Triggered by John Gardner's suggestion to further reduce style=
attributes in the HTML code, in particular those containing hard-coded
lengths.

Revision 1.304 / (download) - annotate - [select for diffs], Fri May 25 20:23:51 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.303: +6 -17 lines
Diff to previous 1.303 (colored) to selected 1.307 (colored)

Do not write duplicate id= attributes, they violate HTML syntax.
Append suffixes for disambiguation.  Issue first reported by Jakub
Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).

Revision 1.303 / (download) - annotate - [select for diffs], Mon May 21 01:11:31 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.302: +2 -2 lines
Diff to previous 1.302 (colored) to selected 1.307 (colored)

Use <span> for .Ms rather than <b>; discussed with John Gardner.

Revision 1.302 / (download) - annotate - [select for diffs], Mon May 21 00:30:23 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.301: +2 -2 lines
Diff to previous 1.301 (colored) to selected 1.307 (colored)

Use <span> for .Ad rather than <i>; also suggested by John Gardner.

Revision 1.301 / (download) - annotate - [select for diffs], Mon May 21 00:00:37 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.300: +2 -2 lines
Diff to previous 1.300 (colored) to selected 1.307 (colored)

Use <span> rather than abusing <i> for .Pa;
suggested by John Gardner <gardnerjohng at gmail dot com>.

Revision 1.300 / (download) - annotate - [select for diffs], Wed May 9 00:46:10 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.299: +11 -15 lines
Diff to previous 1.299 (colored) to selected 1.307 (colored)

Fix a long-standing issue:
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.

Revision 1.299 / (download) - annotate - [select for diffs], Tue May 8 21:42:34 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.298: +13 -54 lines
Diff to previous 1.298 (colored) to selected 1.307 (colored)

Eliminate the class=It-* attributes.
Cleaner HTML, more idiomatic CSS, and minus 30 lines of C code.
Suggested by John Gardner <gardnerjohng at gmail dot com>.

Revision 1.298 / (download) - annotate - [select for diffs], Tue May 8 17:52:55 2018 UTC (5 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.297: +11 -11 lines
Diff to previous 1.297 (colored) to selected 1.307 (colored)

Switch the emitted HTML element from <b> to <code> for the fixed
syntax element macros .Nm, .Fl, .Cm, .Ic, .In, .Fd, .Fn, and .Cd.
Adjust both the internal and external style sheets such that
rendering remains unchanged in typical browsers.

Based on feedback from John Gardner <gardnerjohng at gmail dot com>.

Revision 1.297 / (download) - annotate - [select for diffs], Tue Apr 24 00:36:52 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.296: +12 -12 lines
Diff to previous 1.296 (colored) to selected 1.307 (colored)

replace my vague and idiosyncratic term "selflink"
with the clearer and more usual "permalink";
suggested by John Gardner <gardnerjohng at gmail dot com>

Revision 1.296 / (download) - annotate - [select for diffs], Fri Apr 13 16:28:07 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.295: +20 -13 lines
Diff to previous 1.295 (colored) to selected 1.307 (colored)

preserve comments before .Dd and .TH (typically Copyright and license)
in full HTML output, but not with -Ofragment, e.g. in man.cgi(8);
suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.295 / (download) - annotate - [select for diffs], Wed Apr 11 17:11:13 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.294: +2 -2 lines
Diff to previous 1.294 (colored) to selected 1.307 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.294 / (download) - annotate - [select for diffs], Sat Jul 15 17:57:51 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.293: +5 -5 lines
Diff to previous 1.293 (colored) to selected 1.307 (colored)

In .Bl -tag and -hang, do not print a margin-left style attribute
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.

Revision 1.293 / (download) - annotate - [select for diffs], Sat Jul 15 17:29:31 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.292: +2 -2 lines
Diff to previous 1.292 (colored) to selected 1.307 (colored)

use the same width increase logic for .Bl -hang as for .Bl -tag

Revision 1.292 / (download) - annotate - [select for diffs], Fri Jul 14 16:06:44 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.291: +19 -26 lines
Diff to previous 1.291 (colored) to selected 1.307 (colored)

Handle .Bl -compact via CSS rather than writing individual style
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.

Revision 1.291 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:32 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.290: +2 -1 lines
Diff to previous 1.290 (colored) to selected 1.307 (colored)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.290 / (download) - annotate - [select for diffs], Mon Jun 19 12:57:08 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.289: +7 -3 lines
Diff to previous 1.289 (colored) to selected 1.307 (colored)

Fix a regression in the previous revision:
When there is no link description, reuse the URI.
Reported by tj@ and bentley@.

Revision 1.289 / (download) - annotate - [select for diffs], Tue May 30 16:31:29 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.288: +18 -10 lines
Diff to previous 1.288 (colored) to selected 1.307 (colored)

fix formatting of intermediate punctuation in .Lk

Revision 1.288 / (download) - annotate - [select for diffs], Wed May 17 17:54:45 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.287: +1 -18 lines
Diff to previous 1.287 (colored) to selected 1.307 (colored)

Delete pointless width calculation for SYNOPSIS .Nm block heads.
Just let HTML <table> do its work of selecting the needed width.
<Anton dot Lindqvist at gmail dot com> reported that the manually
calculated width was insufficient in some manual pages.

Revision 1.287 / (download) - annotate - [select for diffs], Fri May 12 17:58:21 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.286: +5 -5 lines
Diff to previous 1.286 (colored) to selected 1.307 (colored)

Make the tag column in .Bl -tag lists wider:
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@.

Revision 1.286 / (download) - annotate - [select for diffs], Tue May 9 14:10:01 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.285: +4 -4 lines
Diff to previous 1.285 (colored) to selected 1.307 (colored)

Trailing \c suppresses the output line break even if
the next line is a text line starting with whitespace.
Quirk found in the sysutils/rancid port.

Revision 1.285 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.284: +3 -27 lines
Diff to previous 1.284 (colored) to selected 1.307 (colored)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.284 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.283: +1 -2 lines
Diff to previous 1.283 (colored) to selected 1.307 (colored)

move .ll to the roff modules

Revision 1.283 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.282: +2 -1 lines
Diff to previous 1.282 (colored) to selected 1.307 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.282 / (download) - annotate - [select for diffs], Thu May 4 22:16:09 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.281: +8 -18 lines
Diff to previous 1.281 (colored) to selected 1.307 (colored)

Start roff formatter modules for HTML and termininal output,
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).

Revision 1.281 / (download) - annotate - [select for diffs], Thu May 4 17:48:29 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.280: +15 -4 lines
Diff to previous 1.280 (colored) to selected 1.307 (colored)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.280 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.279: +8 -5 lines
Diff to previous 1.279 (colored) to selected 1.307 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.279 / (download) - annotate - [select for diffs], Mon Apr 17 12:53:29 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.278: +15 -9 lines
Diff to previous 1.278 (colored) to selected 1.307 (colored)

Fix handling of trailing punctuation in .Lk.
This macro is unusual in so far as trailing punction needs to remain
inside the scope because it must be inside, not after the display
of long URIs in terminal output mode.
Improves formatting of fw_update(1), help(1), less(1), sendbug(1),
acx(4), inet6(4), ipsec(4), oce(4), isakmpd.conf(5), afterboot(8),
release(8), traceroute(8).

Revision 1.278 / (download) - annotate - [select for diffs], Fri Mar 17 12:10:16 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.277: +5 -3 lines
Diff to previous 1.277 (colored) to selected 1.307 (colored)

Fix regression in mdoc_html.c 1.275, man_html 1.134:
For .Sh, .Ss, .SH, .SS, only write selflink if an id could be constructed.
Crash reported by Raf Czlonka <rczlonka at gmail dot com>,
analysis of root cause by natano@

Revision 1.277 / (download) - annotate - [select for diffs], Wed Mar 15 11:29:53 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.276: +6 -29 lines
Diff to previous 1.276 (colored) to selected 1.307 (colored)

Minimal support for deep linking into man(7) pages.
As the man(7) language does not provide semantic markup,
only .SH, .SS, and .UR become anchors for now.

Revision 1.276 / (download) - annotate - [select for diffs], Tue Mar 14 01:35:15 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.275: +3 -2 lines
Diff to previous 1.275 (colored) to selected 1.307 (colored)

Slightly increase widths calculated from string lengths (mainly
for .Bl -tag lists and SYNOPSIS .Nm blocks), such that the text
still fits even if it is printed in bold font.
This is an ugly band aid - but implementing font-dependent width
measurements would be a major project and even more difficult
for HTML than for PostScript.

Issue reported by Jan Stary <hans at stare dot cz>.

Revision 1.275 / (download) - annotate - [select for diffs], Mon Mar 13 20:22:18 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.274: +81 -11 lines
Diff to previous 1.274 (colored) to selected 1.307 (colored)

Port ctags-style, less(1) :t internal searching from terminal output
to HTML output.  For certain macros appearing at the beginning of .It
heads, write HTML id="..." attributes such that deep linking works.
Write HTML <a> attributes such that you can easily copy out link
targets with the mouse.  Try: http://man.openbsd.org/vmctl.8#create

Feature suggested by <guettliml at Thomas dash Guettler dot de>,
some details of the design and implementation by me.

Revision 1.274 / (download) - annotate - [select for diffs], Mon Mar 13 19:01:38 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.273: +43 -43 lines
Diff to previous 1.273 (colored) to selected 1.307 (colored)

Print title="..." in addition to id="..." attributes for macro keys
that can be searched for by apropos(1), such that you see the
semantic function in a tooltip when hovering with the mouse.

Revision 1.273 / (download) - annotate - [select for diffs], Fri Mar 3 13:55:31 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.272: +2 -2 lines
Diff to previous 1.272 (colored) to selected 1.307 (colored)

remove a few redundant conditions that jsg@ found with cppcheck

Revision 1.272 / (download) - annotate - [select for diffs], Wed Feb 22 08:54:41 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13
Changes since 1.271: +2 -1 lines
Diff to previous 1.271 (colored) to selected 1.307 (colored)

Handle an odd edge case where .It is preceded by .Sm.
NULL dereference in man.cgi reported by Gabriel Guzman <gabe at
guzman dash nunez dot com> on misc@.

Revision 1.271 / (download) - annotate - [select for diffs], Thu Feb 16 03:00:23 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1
Changes since 1.270: +1 -3 lines
Diff to previous 1.270 (colored) to selected 1.307 (colored)

Remove the ENDBODY_NOSPACE flag, simplifying the code.

Comparing to groff output, it appears that all cases where it was used
and made a difference actually require the opposite, ENDBODY_SPACE.

I have no idea why i added it back in 2010; maybe to compensate for
some other bug that has long been fixed.

Revision 1.270 / (download) - annotate - [select for diffs], Mon Feb 6 03:44:58 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.269: +1 -3 lines
Diff to previous 1.269 (colored) to selected 1.307 (colored)

The .Nm macro does not only use the default name when it has no
argument, but also when the first argument is a child macro.
Arcane issue found in the FreeBSD cxgbetool(8) manual that Baptiste
Daroussin <bapt at FreeBSD> sent me long ago for a different reason.

While solving this, switch to the new technique of doing text
production in the validator, reducing code duplication in the
formatters, which also makes -Ttree output clearer.

Revision 1.269 / (download) - annotate - [select for diffs], Sun Feb 5 21:00:43 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.268: +11 -3 lines
Diff to previous 1.268 (colored) to selected 1.307 (colored)

Wrap .St content in a <span class="St">.
Also add forgotten <span class="Ux"> to .At rendering.

Revision 1.268 / (download) - annotate - [select for diffs], Sun Feb 5 20:34:57 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.267: +2 -2 lines
Diff to previous 1.267 (colored) to selected 1.307 (colored)

fix font selection for .Bf without argument

Revision 1.267 / (download) - annotate - [select for diffs], Sun Feb 5 20:22:04 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.266: +10 -10 lines
Diff to previous 1.266 (colored) to selected 1.307 (colored)

mark up .Ar, .Fa, .Va, .Ft, and .Vt with <var> rather than <i>;
suggested by bentley@ long ago, but needed lots of cleanup first

Revision 1.266 / (download) - annotate - [select for diffs], Sun Feb 5 19:29:19 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.265: +2 -2 lines
Diff to previous 1.265 (colored) to selected 1.307 (colored)

for .Rs, use <cite>

Revision 1.265 / (download) - annotate - [select for diffs], Sun Feb 5 18:15:39 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.264: +13 -9 lines
Diff to previous 1.264 (colored) to selected 1.307 (colored)

Improve <table> syntax:
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.

Revision 1.264 / (download) - annotate - [select for diffs], Sun Jan 29 14:02:42 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.263: +3 -3 lines
Diff to previous 1.263 (colored) to selected 1.307 (colored)

eliminate one useless struct and one level of indirection;
no functional change

Revision 1.263 / (download) - annotate - [select for diffs], Sat Jan 28 22:36:38 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.262: +21 -48 lines
Diff to previous 1.262 (colored) to selected 1.307 (colored)

Simplify usage of print_otag() even more:
accept NULL to skip the attribute or format.

Revision 1.262 / (download) - annotate - [select for diffs], Sat Jan 28 18:43:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.261: +17 -17 lines
Diff to previous 1.261 (colored) to selected 1.307 (colored)

.Bl -column with zero columns is legal, so don't segfalt on it.
Bug introduced in rev. 1.248 triggered for example in gssapi(3),
analyzed and reported by Michael <Stapelberg at debian dot org>.
Simplify the code a bit more while here.

Revision 1.261 / (download) - annotate - [select for diffs], Wed Jan 25 02:14:43 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.260: +46 -4 lines
Diff to previous 1.260 (colored) to selected 1.307 (colored)

Improve HTML formatting of .Bl -tag.

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.

Revision 1.260 / (download) - annotate - [select for diffs], Sat Jan 21 02:09:51 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.259: +15 -10 lines
Diff to previous 1.259 (colored) to selected 1.307 (colored)

Avoid writing constant style attributes over and over again.
Move them to the style sheet.

Revision 1.259 / (download) - annotate - [select for diffs], Sat Jan 21 01:20:32 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.258: +8 -8 lines
Diff to previous 1.258 (colored) to selected 1.307 (colored)

clean up the remaining class attributes

Revision 1.258 / (download) - annotate - [select for diffs], Fri Jan 20 23:51:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.257: +44 -43 lines
Diff to previous 1.257 (colored) to selected 1.307 (colored)

Standardize class attributes for semantic macros.
Correct markup for .Va and iprove markup for .Dv, .Er, .Ev while here.

Revision 1.257 / (download) - annotate - [select for diffs], Fri Jan 20 21:37:56 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.256: +18 -24 lines
Diff to previous 1.256 (colored) to selected 1.307 (colored)

standardize .Rs class attributes

Revision 1.256 / (download) - annotate - [select for diffs], Fri Jan 20 19:58:07 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.255: +104 -72 lines
Diff to previous 1.255 (colored) to selected 1.307 (colored)

standardize .Bl and .It class attributes

Revision 1.255 / (download) - annotate - [select for diffs], Thu Jan 19 16:59:30 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.254: +10 -14 lines
Diff to previous 1.254 (colored) to selected 1.307 (colored)

clean up markup of .Bd, .D1, .Dl, .Li, and .Ql;
in particular, stop abuse of <blockquote>

Revision 1.254 / (download) - annotate - [select for diffs], Thu Jan 19 15:48:39 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.253: +7 -7 lines
Diff to previous 1.253 (colored) to selected 1.307 (colored)

clean up .Sx and .Xr HTML markup

Revision 1.253 / (download) - annotate - [select for diffs], Thu Jan 19 15:27:34 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.252: +8 -10 lines
Diff to previous 1.252 (colored) to selected 1.307 (colored)

Clean up CSS rules for sections and paragraphs.
Start using real macro names for CSS classes.

Revision 1.252 / (download) - annotate - [select for diffs], Thu Jan 19 13:35:02 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.251: +8 -10 lines
Diff to previous 1.251 (colored) to selected 1.307 (colored)

Start cleanup: trim useless HTML comments, <div> elements,
and CSS rules on the <html> and <body> levels.

Revision 1.251 / (download) - annotate - [select for diffs], Thu Jan 19 01:00:14 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.250: +1 -3 lines
Diff to previous 1.250 (colored) to selected 1.307 (colored)

Implement line breaking of the generated HTML code at space characters
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.

Revision 1.250 / (download) - annotate - [select for diffs], Wed Jan 18 19:22:22 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.249: +1 -2 lines
Diff to previous 1.249 (colored) to selected 1.307 (colored)

Make HTML output more human readable by overhauling line break logic
around tags and by introducing some simple indentation.
No change of HTML semantics intended.

Revision 1.249 / (download) - annotate - [select for diffs], Tue Jan 17 15:32:44 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.248: +78 -74 lines
Diff to previous 1.248 (colored) to selected 1.307 (colored)

Completely delete the buf field of struct html and all the buf*()
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().

Revision 1.248 / (download) - annotate - [select for diffs], Tue Jan 17 01:47:51 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.247: +159 -403 lines
Diff to previous 1.247 (colored) to selected 1.307 (colored)

Simplify the usage of print_otag() by making it accept a variable
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.

Revision 1.247 / (download) - annotate - [select for diffs], Wed Jan 11 17:39:53 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.246: +5 -113 lines
Diff to previous 1.246 (colored) to selected 1.307 (colored)

Do text production for .Bt, .Ex, .Rv, .Ud at the validation stage
rather than in the formatters.  Use NODE_NOSRC flag for .Lb and
NODE_NOSRC and NODE_NOPRT for .St.  Results in a more rigorous
syntax tree and in 135 lines less code.

This work was triggered by a question from Abhinav Upadhyay <er dot
abhinav dot upadhyay at gmail dot com> (NetBSD) on discuss@.

Revision 1.246 / (download) - annotate - [select for diffs], Tue Jan 10 23:36:34 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.245: +2 -30 lines
Diff to previous 1.245 (colored) to selected 1.307 (colored)

Use new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At.
More rigorous AST and 40 lines less code.

Revision 1.245 / (download) - annotate - [select for diffs], Tue Jan 10 21:59:47 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.244: +2 -35 lines
Diff to previous 1.244 (colored) to selected 1.307 (colored)

For the .Ux/.Ox family of macros, do text production at the validation
stage rather than in each and every individual formatter, using the
new NODE_NOSRC flag.  More rigorous and also ten lines less code.

Revision 1.244 / (download) - annotate - [select for diffs], Tue Jan 10 13:47:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.243: +19 -19 lines
Diff to previous 1.243 (colored) to selected 1.307 (colored)

unify names of AST node flags; no change of cpp output

Revision 1.243 / (download) - annotate - [select for diffs], Tue Jan 10 12:53:07 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.242: +4 -1 lines
Diff to previous 1.242 (colored) to selected 1.307 (colored)

Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Use them to mark generated nodes and nodes that shall not produce output.
Let -Ttree output mode display these new flags.
Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments.
Use NODE_NOPRT for .Dd, .Dt, and .Os.

These will help to make handling of text production macros more rigorous.

Revision 1.242 / (download) - annotate - [select for diffs], Mon Jan 9 12:48:58 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.241: +2 -2 lines
Diff to previous 1.241 (colored) to selected 1.307 (colored)

The .No macro is not supposed to produce fixed-width font, it is not
the same as .Li, so don't use <code>.
Bug reported by <Anton dot Lindqvist at gmail dot com> on tech@.

Revision 1.241 / (download) - annotate - [select for diffs], Sun Jan 8 22:51:55 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.240: +9 -9 lines
Diff to previous 1.240 (colored) to selected 1.307 (colored)

Indentation must be measured in units of the surrounding text,
not in units of the contained text.  Consequently, "display"
and "lit" class tags must not be on the same element:  First,
"display" must set up the indentation, still using the outer
units, and only after that, "lit" may change the font.

This fixes .Bd -literal which got the wrong indentation.
Bug reported by tb@.

Revision 1.240 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:09 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.239: +26 -25 lines
Diff to previous 1.239 (colored) to selected 1.307 (colored)

Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a
tiny loop - not only making data smaller, but code shorter as well.

This gets rid of an implicit invariant that confused both static
analysis tools and human auditors.  No functional change.

Revision 1.239 / (download) - annotate - [select for diffs], Mon Jan 4 12:45:29 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.238: +2 -4 lines
Diff to previous 1.238 (colored) to selected 1.307 (colored)

Generate simpler in-page links: just replace spaces with underscores.
Patch from bentley@.

Revision 1.238 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:15 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.237: +1 -55 lines
Diff to previous 1.237 (colored) to selected 1.307 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.237 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:19 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.236: +96 -96 lines
Diff to previous 1.236 (colored) to selected 1.307 (colored)

modernize style: "return" is not a function

Revision 1.236 / (download) - annotate - [select for diffs], Sat Sep 26 00:54:04 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.235: +1 -6 lines
Diff to previous 1.235 (colored) to selected 1.307 (colored)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.235 / (download) - annotate - [select for diffs], Sat Sep 26 00:32:35 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.234: +5 -9 lines
Diff to previous 1.234 (colored) to selected 1.307 (colored)

resolve code duplication and do style cleanup in mdoc_nm_pre(),
no functional change

Revision 1.234 / (download) - annotate - [select for diffs], Sat Sep 26 00:22:07 2015 UTC (8 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.233: +4 -3 lines
Diff to previous 1.233 (colored) to selected 1.307 (colored)

Fix multiple aspects of SYNOPSIS .Nm formatting:
* Don't break lines before non-block .Nm elements.
* Use proper <b> markup for the heads of .Nm blocks.
* Make the width measurements work by doing them on the head children.

Revision 1.233 / (download) - annotate - [select for diffs], Sun Aug 30 19:00:14 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.232: +3 -4 lines
Diff to previous 1.232 (colored) to selected 1.307 (colored)

If an .Fo macro lacks its mandatory argument, don't die on an assertion.
Bug found by jsg@ with afl.

Revision 1.232 / (download) - annotate - [select for diffs], Sat Apr 18 17:53:21 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.231: +11 -18 lines
Diff to previous 1.231 (colored) to selected 1.307 (colored)

Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.

Revision 1.231 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:40 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +2 -2 lines
Diff to previous 1.230 (colored) to selected 1.307 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.230 / (download) - annotate - [select for diffs], Thu Apr 16 20:22:27 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.229: +3 -7 lines
Diff to previous 1.229 (colored) to selected 1.307 (colored)

Restore the page headers and page footers that accidentally got lost
in rev. 1.225.  Regression reported by florian@.

Revision 1.229 / (download) - annotate - [select for diffs], Thu Apr 2 23:48:20 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored) to selected 1.307 (colored)

Third step towards parser unification:
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.

Revision 1.228 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:17 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.227: +7 -7 lines
Diff to previous 1.227 (colored) to selected 1.307 (colored)

Second step towards parser unification:
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.

Revision 1.227 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:50 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.226: +55 -54 lines
Diff to previous 1.226 (colored) to selected 1.307 (colored)

First step towards parser unification:
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.

Revision 1.226 / (download) - annotate - [select for diffs], Tue Mar 3 21:11:34 2015 UTC (9 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.225: +3 -1 lines
Diff to previous 1.225 (colored) to selected 1.307 (colored)

If an eqn(7) starts on a new input line, be sure to output whitespace
in front of it.  Issue found by tedu@ in glOrtho(3).

There are also cases of excessive whitespace before and after
equations.  This patch neither fixes them nor makes them worse.

Revision 1.225 / (download) - annotate - [select for diffs], Thu Feb 12 12:24:33 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.224: +6 -5 lines
Diff to previous 1.224 (colored) to selected 1.307 (colored)

Delete the mdoc_node.pending pointer and the function calculating
it, make_pending(), which was the most difficult function of the
whole mdoc(7) parser.  After almost five years of maintaining this
hellhole, i just noticed the pointer isn't needed after all.

Blocks are always rewound in the reverse order they were opened;
that even holds for broken blocks.  Consequently, it is sufficient
to just mark broken blogs with the flag MDOC_BROKEN and breaking
blocks with the flag MDOC_ENDED.  When rewinding, instead of iterating
the pending pointers, just iterate from each broken block to its
parents, rewinding all that are MDOC_ENDED and stopping after
processing the first ancestor that it not MDOC_BROKEN.  For ENDBODY
markers, use the mdoc_node.body pointer in place of the former
mdoc_node.pending.

This also fixes an assertion failure found by jsg@ with afl,
test case #467 (Bo Bl It Bd Bc It), where (surprise surprise)
the pending pointer got corrupted.

Improved functionality, minus one function, minus one struct field,
minus 50 lines of code.

Revision 1.224 / (download) - annotate - [select for diffs], Wed Feb 11 14:15:12 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.223: +3 -4 lines
Diff to previous 1.223 (colored) to selected 1.307 (colored)

do not access a NULL pointer if an .Eo block lacks a tail;
found by jsg@ with afl, test case #16

Revision 1.223 / (download) - annotate - [select for diffs], Thu Feb 5 01:46:56 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.222: +1 -4 lines
Diff to previous 1.222 (colored) to selected 1.307 (colored)

fix handling of empty .An macros

Revision 1.222 / (download) - annotate - [select for diffs], Thu Feb 5 00:14:13 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.221: +4 -7 lines
Diff to previous 1.221 (colored) to selected 1.307 (colored)

Simplify by deleting the "lastline" member of struct mdoc_node.
Minus one struct member, minus 17 lines of code, no functional change.

Revision 1.221 / (download) - annotate - [select for diffs], Sun Feb 1 23:10:35 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.220: +52 -14 lines
Diff to previous 1.220 (colored) to selected 1.307 (colored)

fix .Eo/.Ec spacing

Revision 1.220 / (download) - annotate - [select for diffs], Fri Jan 30 22:04:44 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.219: +5 -4 lines
Diff to previous 1.219 (colored) to selected 1.307 (colored)

Have pity on the poor stack.
Replace tail recursion by iteration when walking the syntax trees.
No functional change.

Revision 1.219 / (download) - annotate - [select for diffs], Fri Jan 23 14:21:01 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +6 -6 lines
Diff to previous 1.218 (colored) to selected 1.307 (colored)

Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra"
when the only child is .Mt, not when the preceding node is .An,
to improve robustness.  Triggered by a question from Svyatoslav
Mishyn <juef at openmailbox dot org> (Crux Linux).

Revision 1.218 / (download) - annotate - [select for diffs], Tue Dec 23 13:48:57 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.217: +7 -3 lines
Diff to previous 1.217 (colored) to selected 1.307 (colored)

support negative horizontal widths in man(7);
minus twenty lines of code in spite of enhanced functionality

Revision 1.217 / (download) - annotate - [select for diffs], Tue Dec 23 09:31:46 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.216: +3 -3 lines
Diff to previous 1.216 (colored) to selected 1.307 (colored)

some scaling unit fixes:
- .sp with an invalid argument is .sp 1v, not .sp 0v
- in man(1), trailing garbage doesn't make scaling units invalid

Revision 1.216 / (download) - annotate - [select for diffs], Tue Dec 2 10:08:06 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.215: +3 -2 lines
Diff to previous 1.215 (colored) to selected 1.307 (colored)

Fix the implementation and documentation of \c (continue text input line).
In particular, make it work in no-fill mode, too.
Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).

Revision 1.215 / (download) - annotate - [select for diffs], Mon Dec 1 08:05:52 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.214: +2 -3 lines
Diff to previous 1.214 (colored) to selected 1.307 (colored)

header cleanup:
* add missing forward declarations
* remove needless header inclusions
* some style unification

Revision 1.214 / (download) - annotate - [select for diffs], Sun Nov 30 05:29:00 2014 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.213: +3 -2 lines
Diff to previous 1.213 (colored) to selected 1.307 (colored)

Multiple fixes with respect to .Pf:
* The first argument of .Pf is not parsed.
* Normal delimiter handling does not apply to the first argument of .Pf.
* Warn if nothing follows a prefix (inspired by groff_mdoc(7)).
* In that case, do not suppress spacing.

Revision 1.213 / (download) - annotate - [select for diffs], Thu Nov 27 22:27:56 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.212: +14 -9 lines
Diff to previous 1.212 (colored) to selected 1.307 (colored)

Multiple fixes with respect to .Eo:
1. Correctly parse stray .Ec without preceding .Eo,
avoiding an assertion violation found by jsg@ with afl.
2. Correctly parse .Ec arguments when breaking another block.
3. Correct spacing around closing delimiter when breaking another block.
4. Sync some related formatting control from -Tascii to -Thtml.

Revision 1.212 / (download) - annotate - [select for diffs], Thu Nov 27 16:20:31 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +2 -2 lines
Diff to previous 1.211 (colored) to selected 1.307 (colored)

Fix the obsolete .Db (toggle debug mode) macro to ignore its arguments
and not trigger an assertion when there is more than one argument;
the latter found by jsg@ with afl.

Revision 1.211 / (download) - annotate - [select for diffs], Wed Nov 19 22:00:37 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.210: +5 -3 lines
Diff to previous 1.210 (colored) to selected 1.307 (colored)

Let .Ao and .Aq render as "<>" after .An and as "\(la\(ra" elsewhere,
just like groff; minibug noticed by bentley@.

Revision 1.210 / (download) - annotate - [select for diffs], Mon Nov 17 06:44:58 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.209: +13 -2 lines
Diff to previous 1.209 (colored) to selected 1.307 (colored)

Multiple fixes with respect to in-line macros:
* .No selects the default font; relevant e.g. in .Bf blocks
* no need to force empty .Li elements
* closing delimiters as leading macro arguments do not suppress space
* opening delimiters at the end of a macro line do not suppress space
* correctly handle delimiter spacing in -Tman
As a side effect, these fixes let mandoc warn about empty .No macros
as requested by bentley@.

Revision 1.209 / (download) - annotate - [select for diffs], Thu Oct 30 20:10:02 2014 UTC (9 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.208: +14 -28 lines
Diff to previous 1.208 (colored) to selected 1.307 (colored)

Major bugsquashing with respect to -offset and -width:
1. Support specifying the .Bd and .Bl -offset as a macro default width;
while here, simplify the code handling the same for .Bl -width.
2. Correct handling of .Bl -offset arguments:  unlike .Bd -offset, the
arguments "left", "indent", and "indent-two" have no special meaning.
3. Fix the scaling of string length -offset and -width arguments in -Thtml.
Triggered by an incomplete documentation patch from bentley@.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Oct 10 15:26:29 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.207: +2 -2 lines
Diff to previous 1.207 (colored) to selected 1.307 (colored)

sync Copyright years after merge to OpenBSD; no code change

Revision 1.207 / (download) - annotate - [select for diffs], Sat Sep 27 11:17:19 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.206: +2 -2 lines
Diff to previous 1.206 (colored) to selected 1.307 (colored)

Don't pretend we have a separate XHTML and HTML mode any more.

Revision 1.206 / (download) - annotate - [select for diffs], Sat Sep 27 10:56:18 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.205: +6 -6 lines
Diff to previous 1.205 (colored) to selected 1.307 (colored)

Remove <p> in favour of <div class="spacer">.
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.

Revision 1.205 / (download) - annotate - [select for diffs], Sat Sep 27 09:26:01 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.204: +1 -8 lines
Diff to previous 1.204 (colored) to selected 1.307 (colored)

Remove last hard-coded width attribute.

Revision 1.204 / (download) - annotate - [select for diffs], Sat Sep 27 09:20:03 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.203: +24 -25 lines
Diff to previous 1.203 (colored) to selected 1.307 (colored)

HTML5-isation: remove more alignments.

Revision 1.203 / (download) - annotate - [select for diffs], Sat Sep 27 09:13:39 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.202: +3 -5 lines
Diff to previous 1.202 (colored) to selected 1.307 (colored)

Continue in HTML5-ing by kicking out some hard-coded alignments.

Revision 1.202 / (download) - annotate - [select for diffs], Sat Sep 27 09:05:57 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.201: +5 -7 lines
Diff to previous 1.201 (colored) to selected 1.307 (colored)

Kick out "summary" attribute, which isn't HTML5.

Revision 1.201 / (download) - annotate - [select for diffs], Sat Sep 27 09:02:19 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.200: +5 -7 lines
Diff to previous 1.200 (colored) to selected 1.307 (colored)

First, add space for default styling for HTML5 (non-fragment) output.
This uses a <style /> block right before the <link /> for the stylesheet.
Use this to kick out hardcoded header and footer table widths.

Revision 1.200 / (download) - annotate - [select for diffs], Wed Sep 17 19:55:59 2014 UTC (9 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.199: +28 -4 lines
Diff to previous 1.199 (colored) to selected 1.307 (colored)

implement .An -[no]split for -Thtml

Revision 1.199 / (download) - annotate - [select for diffs], Thu Aug 21 12:57:17 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.198: +5 -4 lines
Diff to previous 1.198 (colored) to selected 1.307 (colored)

Right after .Fl, a middle delimiter triggers an empty scope,
just like a closing delimiter.  This didn't work in groff-1.15,
but it now works in groff-1.22.

After being closed by delimiters, .Nm scopes do not reopen.

Do not suppress white space after .Fl if the next node is a text node
on the same input line; that can happen for middle delimiters.

Fixing an issue reported by jmc@.

Revision 1.198 / (download) - annotate - [select for diffs], Thu Aug 14 00:31:43 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.197: +7 -5 lines
Diff to previous 1.197 (colored) to selected 1.307 (colored)

Revert previous, as requested by kristaps@.
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...

Revision 1.197 / (download) - annotate - [select for diffs], Wed Aug 13 15:25:22 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.196: +5 -7 lines
Diff to previous 1.196 (colored) to selected 1.307 (colored)

Use <em> for .Em and .Bf -emphasis.

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@

Revision 1.196 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.195: +1 -3 lines
Diff to previous 1.195 (colored) to selected 1.307 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.

Revision 1.195 / (download) - annotate - [select for diffs], Wed Aug 6 15:09:05 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.194: +9 -4 lines
Diff to previous 1.194 (colored) to selected 1.307 (colored)

Bring the handling of defective prologues even closer to groff,
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED.  Warn about it.
* Missing section in .Dt does not default to 1.  But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings.  Warn about it.

Revision 1.194 / (download) - annotate - [select for diffs], Fri Aug 1 19:25:52 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.193: +3 -3 lines
Diff to previous 1.193 (colored) to selected 1.307 (colored)

Clarity with respect to floating point handling:
Write double constants as double rather than integer literals.
Remove useless explicit (double) cast done at one place and nowhere else.
No functional change.

Revision 1.193 / (download) - annotate - [select for diffs], Wed Jul 30 00:19:16 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +31 -25 lines
Diff to previous 1.192 (colored) to selected 1.307 (colored)

Various improvements related to .Ex and .Rv:
* let .Nm fall back to the empty string, not to UNKNOWN
* never let .Rv copy an argument from .Nm
* avoid spurious \fR after empty .Nm in -Tman
* correct handling of .Ex and .Rv in -Tman
* correct the wording of the output for .Rv without arguments
* use non-breaking spaces in .Ex and .Rv output where required
* split MANDOCERR_NONAME into a warning for .Ex and an error for .Nm

Revision 1.192 / (download) - annotate - [select for diffs], Wed Jul 2 19:55:10 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +8 -15 lines
Diff to previous 1.191 (colored) to selected 1.307 (colored)

When .Sm is called without an argument, groff toggles the spacing mode,
so let us do the same for compatibility.  Using this feature is of
course not recommended except in manual page obfuscation contests.

Revision 1.191 / (download) - annotate - [select for diffs], Wed Jul 2 03:48:07 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +24 -9 lines
Diff to previous 1.190 (colored) to selected 1.307 (colored)

Implement the obsolete macros .En .Es .Fr .Ot for backward compatibility,
since this is hardly more complicated than explicitly ignoring them
as we did in the past.  Of course, do not use them!

Revision 1.190 / (download) - annotate - [select for diffs], Wed Apr 23 16:08:33 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.189: +22 -17 lines
Diff to previous 1.189 (colored) to selected 1.307 (colored)

Audit strlcpy(3)/strlcat(3) usage.

* Repair three instances of silent truncation, use asprintf(3).
* Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+...
to use asprintf(3) instead to make them less error prone.
* Cast the return value of four instances where the destination
buffer is known to be large enough to (void).
* Completely remove three useless instances of strlcpy(3)/strlcat(3).
* Mark two places in -Thtml with XXX that can cause information loss
and crashes but are not easy to fix, requiring design changes of
some internal interfaces.
* The file mandocdb.c remains to be audited.

Revision 1.189 / (download) - annotate - [select for diffs], Sun Apr 20 20:18:12 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.188: +7 -3 lines
Diff to previous 1.188 (colored) to selected 1.307 (colored)

fix unchecked snprintf(3) in page header printing:
the length of the title is unknown, and speed doesn't matter here,
so use asprintf/free rather than a static buffer

Revision 1.188 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:05 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +185 -305 lines
Diff to previous 1.187 (colored) to selected 1.307 (colored)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.187 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:48 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.186: +12 -2 lines
Diff to previous 1.186 (colored) to selected 1.307 (colored)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.186 / (download) - annotate - [select for diffs], Tue Dec 24 20:45:27 2013 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3
Changes since 1.185: +2 -2 lines
Diff to previous 1.185 (colored) to selected 1.307 (colored)

It turns out SYNOPSIS mode does not imply .Bk in general,
but only within .Nm blocks.  Simplify the code accordingly.

Triggered by research done by Franco Fichtner.

Revision 1.185 / (download) - annotate - [select for diffs], Tue Dec 24 19:11:46 2013 UTC (10 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +4 -8 lines
Diff to previous 1.184 (colored) to selected 1.307 (colored)

When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins)
to the line where the second one starts.
This fixes the bug that .Bk allowed output line breaks right after block
macros spanning more than one input line, even when the next macro follows
on the same line.

Revision 1.184 / (download) - annotate - [select for diffs], Sat Nov 17 00:26:33 2012 UTC (11 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_2
Changes since 1.183: +30 -29 lines
Diff to previous 1.183 (colored) to selected 1.307 (colored)

Cleanup naming of local variables to make the code easier on the eye:
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.

ok kristaps@ some time ago

Revision 1.183 / (download) - annotate - [select for diffs], Sun Aug 12 10:04:09 2012 UTC (11 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.182: +4 -4 lines
Diff to previous 1.182 (colored) to selected 1.307 (colored)

.Sq should use curly right quotes in HTML output to match its curly
left quotes.

Also, properly reinitialize the styles attribute string buffer for
each column in a table so that the attributes don't accumulate.

Patch from Matthew@ Dempsky, tweaked by me; OpenBSD rev. 1.66.

Revision 1.182 / (download) - annotate - [select for diffs], Thu Nov 3 20:37:00 2011 UTC (12 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.181: +6 -2 lines
Diff to previous 1.181 (colored) to selected 1.307 (colored)

Correct .Eo spacing:
no space between the delimiters and the enclosed text.
The mdoc_html.c part was added by kristaps; ok kristaps@.

Revision 1.181 / (download) - annotate - [select for diffs], Sun Oct 16 12:20:34 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +2 -2 lines
Diff to previous 1.180 (colored) to selected 1.307 (colored)

Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

Revision 1.180 / (download) - annotate - [select for diffs], Sun Oct 9 22:10:53 2011 UTC (12 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +18 -38 lines
Diff to previous 1.179 (colored) to selected 1.307 (colored)

Always print <table> column widths in -T[x]html;
if desired, they can be overridden in the CSS file.
Suggested by kristaps@, and i always like to simplify code.

Revision 1.179 / (download) - annotate - [select for diffs], Wed Oct 5 21:35:17 2011 UTC (12 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_0
Changes since 1.178: +17 -16 lines
Diff to previous 1.178 (colored) to selected 1.307 (colored)

Add the -Ofragment option to -T[]x]html.  This accomodates for embedding
manual output in existing HTML or XHTML documents, e.g., when invoking
mandoc from an SSI or CGI.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Aug 26 09:03:17 2011 UTC (12 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7
Changes since 1.177: +6 -2 lines
Diff to previous 1.177 (colored) to selected 1.307 (colored)

Make sure that `Ql' literalises its arguments in -T[x]html.  Found when
doing manpages.bsd.lv stuff.

Revision 1.177 / (download) - annotate - [select for diffs], Thu Aug 18 09:16:01 2011 UTC (12 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.176: +3 -6 lines
Diff to previous 1.176 (colored) to selected 1.307 (colored)

Align `-offset indent' and `D1' by forcing BLOCKQUOTE to have a 5ex
margin.  This is dubious: the HTML4 spec specifically says that
BLOCKQUOTE shouldn't be abused for indentation, which is exactly what we
do.  However, `D1' needs indentation and it's the only way to force text
browsers to do so.  Alternatives?

Also remove the unused HALFINDENT defines while here.

Revision 1.176 / (download) - annotate - [select for diffs], Thu Aug 18 09:02:22 2011 UTC (12 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.175: +2 -2 lines
Diff to previous 1.175 (colored) to selected 1.307 (colored)

Have `Li' be correctly monospaced in -T[x]html.  Also make sure that
`Li' prints as a CODE tag and the style-sheet has the `lit' class apply
to multiple tag types.

Revision 1.175 / (download) - annotate - [select for diffs], Wed Aug 10 14:07:23 2011 UTC (12 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_6
Changes since 1.174: +22 -12 lines
Diff to previous 1.174 (colored) to selected 1.307 (colored)

Allow `Sx' and `Ss' to have child nodes.  Fixes manuals in NetBSD.
Originally pointed out by joerg@ then again by Thomas Klausner by way of
Nicolas Joy.  Note: don't use these constructions as you can't link to
the sections with `Sx'.

Revision 1.174 / (download) - annotate - [select for diffs], Sat Jul 23 22:57:13 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_5
Changes since 1.173: +2 -5 lines
Diff to previous 1.173 (colored) to selected 1.307 (colored)

Flip on equation printing for -T[x]html.

Revision 1.173 / (download) - annotate - [select for diffs], Thu Jul 21 11:34:53 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.172: +3 -3 lines
Diff to previous 1.172 (colored) to selected 1.307 (colored)

Flip eqn into using parsed nodes.  I've temporarily disabled printing
these in the front-ends except for -Ttree, which will display the parsed
tree.

While here, fix that quoted strings aren't scanned for replacement parts.

Revision 1.172 / (download) - annotate - [select for diffs], Mon Jul 4 09:42:38 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_4
Changes since 1.171: +3 -1 lines
Diff to previous 1.171 (colored) to selected 1.307 (colored)

The bufcat() function in -T[x]html was eating one byte off the end of its
concatenated string.  This for some reason hasn't been found before now... ?
Anyway, fixed, and make the IDs created again be correctly prefixed by a
letter as per the HTML spec.

Revision 1.171 / (download) - annotate - [select for diffs], Wed Jun 29 15:38:09 2011 UTC (12 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.170: +4 -3 lines
Diff to previous 1.170 (colored) to selected 1.307 (colored)

First fix how `sp 1' doesn't imply `1v' (it now does) and that 1
followed by non-digits, e.g. `1g', really means `1'.  Next, fix some
spacing issues where `sp' was invoked in -man after sections or
subsections.  Make sure this behaviour is mirrored in -Thtml.

Revision 1.170 / (download) - annotate - [select for diffs], Thu Jun 16 22:21:28 2011 UTC (12 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.169: +5 -4 lines
Diff to previous 1.169 (colored) to selected 1.307 (colored)

Have -T[x]html print out the link target for `Lk' if no link title is
provided.  From a patch by Tim van der Molen.

Revision 1.169 / (download) - annotate - [select for diffs], Tue May 17 11:38:18 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_3
Changes since 1.168: +2 -1 lines
Diff to previous 1.168 (colored) to selected 1.307 (colored)

Clean-up fallout: differentiate ID's and HREF's (where to put the `#').
Make buffmt functions internally bufinit(), too.

Revision 1.168 / (download) - annotate - [select for diffs], Tue May 17 11:34:31 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.167: +26 -29 lines
Diff to previous 1.167 (colored) to selected 1.307 (colored)

Cleanups in -T[x]html: make html_idcat() use the buffer and be called
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.

Revision 1.167 / (download) - annotate - [select for diffs], Tue May 17 11:19:45 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored) to selected 1.307 (colored)

Clean-ups in -T[x]html: inline print_num(), as it was just a single
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.

Revision 1.166 / (download) - annotate - [select for diffs], Sat May 14 16:28:23 2011 UTC (12 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.165: +6 -6 lines
Diff to previous 1.165 (colored) to selected 1.307 (colored)

Give -Thtml and -Txhtml the gift of recognising escapes when calculating
widths (e.g., `Bl -tag -width "\s[blahblah]bar").  This has long since
been done for -Tascii but escaped noticed with -T[x]html.

Revision 1.165 / (download) - annotate - [select for diffs], Sat Apr 23 09:10:50 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_2
Changes since 1.164: +2 -2 lines
Diff to previous 1.164 (colored) to selected 1.307 (colored)

Revert last change: this screwed up displaying in other pages (didn't
test it enough).

Revision 1.164 / (download) - annotate - [select for diffs], Sat Apr 23 08:56:29 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.163: +2 -2 lines
Diff to previous 1.163 (colored) to selected 1.307 (colored)

Make the `Nm' -Thtml attribute be min-width instead of width.  This is a
quick fix for, say, rc.d(8) in OpenBSD, which has nested macros on the
`Nm' SYNOPSIS line that were skipped over by the length calculator.  This
should [maybe?] be a recursive length check, but still it'd need to be
a min-width to accomodate for (say) `Qq' and the like printing excess
characters post-length-calculation.

Revision 1.163 / (download) - annotate - [select for diffs], Mon Apr 4 22:38:26 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.162: +2 -1 lines
Diff to previous 1.162 (colored) to selected 1.307 (colored)

Suppress a space following the "(" for -T[x]html `Fn'.  Found by random
perusal of online manuals.

Revision 1.162 / (download) - annotate - [select for diffs], Mon Apr 4 16:48:18 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_1
Changes since 1.161: +53 -5 lines
Diff to previous 1.161 (colored) to selected 1.307 (colored)

Have `Fd' in -T[x]html generate an "include" link if it detects one
being used.

Revision 1.161 / (download) - annotate - [select for diffs], Mon Apr 4 16:44:56 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.160: +3 -2 lines
Diff to previous 1.160 (colored) to selected 1.307 (colored)

Fix a bug that slip in: PAIR_XXXX macros expanded to run the increment
twice.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Apr 4 16:15:58 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.159: +20 -15 lines
Diff to previous 1.159 (colored) to selected 1.307 (colored)

Fully fix the `Rv' and `Ex' handlers for -T[x]html and -Tascii.  This
includes an unreported bug where `Ex' wasn't properly adding a newline.

Revision 1.159 / (download) - annotate - [select for diffs], Mon Apr 4 16:01:47 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.158: +27 -20 lines
Diff to previous 1.158 (colored) to selected 1.307 (colored)

Make `Rv' do the Right Thing regarding commas and "and" when listing its
output.  This also makes it easier to read.  While here, remove
superfluous assignment to local variables for this and `Mt'.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Apr 4 15:45:12 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.157: +12 -10 lines
Diff to previous 1.157 (colored) to selected 1.307 (colored)

Fix possible segfaults in `Lk' -T[x]html handler, which made some
assumptions about its children.  Also remove superfluous reassignment to
local variable.

Revision 1.157 / (download) - annotate - [select for diffs], Mon Apr 4 15:41:05 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.156: +21 -23 lines
Diff to previous 1.156 (colored) to selected 1.307 (colored)

Clean-up in -T[x]html: remove some unnecessary assignments to local
variables.

Revision 1.156 / (download) - annotate - [select for diffs], Mon Apr 4 15:33:03 2011 UTC (12 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.155: +29 -12 lines
Diff to previous 1.155 (colored) to selected 1.307 (colored)

Clean up handling of `In' for -T[x]html such that it only links to the
first argument.  groff of course doesn't do links, but it will uglify
subsequent arguments in the list (we warn about >1, anyway).

Revision 1.155 / (download) - annotate - [select for diffs], Tue Mar 22 14:05:45 2011 UTC (13 years ago) by kristaps
Branch: MAIN
Changes since 1.154: +22 -5 lines
Diff to previous 1.154 (colored) to selected 1.307 (colored)

Move mandoc_isdelim() back into libmdoc.h.  This fixes an unreported
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;')
and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its
own line) would also be punctuated.  This introduces a small amount of
complexity of mdoc_{html,term}.c must manage their own spacing with
running print_word() or print_text().  The check for delimiting now
happens in mdoc_macro.c's dword().

Revision 1.154 / (download) - annotate - [select for diffs], Mon Mar 7 01:35:51 2011 UTC (13 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.153: +2 -5 lines
Diff to previous 1.153 (colored) to selected 1.307 (colored)

Clean up date handling,
as a first step to get rid of the frequent petty warnings in this area:
 - always store dates as strings, not as seconds since the Epoch
 - for input, try the three most common formats everywhere
 - for unrecognized format, just pass the date though verbatim
 - when there is no date at all, still use the current date
Originally triggered by a one-line patch from Tim van der Molen,
<tbvdm at xs4all dot nl>, which is included here.
Feedback and OK on manual parts from jmc@.
"please check this in" kristaps@

Revision 1.153 / (download) - annotate - [select for diffs], Wed Feb 9 09:52:47 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.152: +8 -2 lines
Diff to previous 1.152 (colored) to selected 1.307 (colored)

EQN blocks are now printed in all modes.  This is simply a printing of
the concatenated string (in -T[x]html, it gets a SPAN, too).

Revision 1.152 / (download) - annotate - [select for diffs], Sun Feb 6 23:02:31 2011 UTC (13 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.151: +5 -3 lines
Diff to previous 1.151 (colored) to selected 1.307 (colored)

Fix a regression caused by mdoc_term.c 1.214 / mdoc_html.c 1.148:
Inside .Bk or inside the SYNOPSIS, Unix variant macros cleared
the keep flag.

Revision 1.151 / (download) - annotate - [select for diffs], Sun Feb 6 21:44:36 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.150: +3 -1 lines
Diff to previous 1.150 (colored) to selected 1.307 (colored)

Add initial libmdoc and libman top-most machinery for accepting TBL
directives.  For now this will just ignore them (except for -Ttree,
which just notes that an EQN's been accepted).

Revision 1.150 / (download) - annotate - [select for diffs], Wed Feb 2 21:40:45 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.149: +3 -2 lines
Diff to previous 1.149 (colored) to selected 1.307 (colored)

If `Ns' is specified on its own line, it should be ignored.  This is
shitty groff behaviour.  Do the same, but raise a warning to this
effect.  This from a TODO noted by schwarze@.

Revision 1.149 / (download) - annotate - [select for diffs], Sat Jan 29 14:49:44 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.148: +17 -3 lines
Diff to previous 1.148 (colored) to selected 1.307 (colored)

When in a <PRE>, don't print out the <BR> before lines that have leading
whitespace.

Revision 1.148 / (download) - annotate - [select for diffs], Tue Jan 25 16:20:24 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.147: +8 -2 lines
Diff to previous 1.147 (colored) to selected 1.307 (colored)

Arguments to `Bsx' and friends are separated by a non-breaking space.
This removes a TODO raised by schwarze@.

Revision 1.147 / (download) - annotate - [select for diffs], Tue Jan 25 15:46:05 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.146: +3 -8 lines
Diff to previous 1.146 (colored) to selected 1.307 (colored)

Push capitalisation of `Bx' second argument into validator, where it belongs.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Jan 25 15:28:56 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.145: +9 -4 lines
Diff to previous 1.145 (colored) to selected 1.307 (colored)

Properly uppercase the first-letter of the `Bx' second argument.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Jan 25 15:17:18 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.144: +15 -7 lines
Diff to previous 1.144 (colored) to selected 1.307 (colored)

Have `Bx' accept two arguments, not just one, and join these arguments
with "xxBSD-yy"

Revision 1.144 / (download) - annotate - [select for diffs], Thu Jan 13 14:30:13 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.143: +20 -4 lines
Diff to previous 1.143 (colored) to selected 1.307 (colored)

Change how -Thtml behaves with tables: use multiple rows, with widths
set by COL, until an external macro is encountered.  At this point in
time, close out the table and process the macro.  When the first table
row is again re-encountered, re-start the table.  This requires a bit of
tracking added to "struct html", but the change is very small and
follows the logic of meta-fonts.  This all follows a bug-report by
joerg@.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Jan 12 10:43:22 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.142: +3 -1 lines
Diff to previous 1.142 (colored) to selected 1.307 (colored)

If the first character of free-form text is whitespace, then a newline
shall precede outputted text (surprise!).

Revision 1.142 / (download) - annotate - [select for diffs], Fri Jan 7 13:20:58 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.141: +5 -4 lines
Diff to previous 1.141 (colored) to selected 1.307 (colored)

Quiesce lint with some type handling.  Does not change anything.

Revision 1.141 / (download) - annotate - [select for diffs], Tue Jan 4 10:29:41 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.140: +5 -2 lines
Diff to previous 1.140 (colored) to selected 1.307 (colored)

Add skeleton for -T[x]html tbl stuff.  Also start to put in some bits about
the up-coming version, although we're not quite there yet.

Revision 1.140 / (download) - annotate - [select for diffs], Sat Jan 1 12:18:37 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.139: +3 -1 lines
Diff to previous 1.139 (colored) to selected 1.307 (colored)

Add table processing structures to -mdoc.  This consists of an
external-facing function mdoc_addspan(), then various bits to prohibit
printing and scanning (this requires some if's to be converted into
switch's).

Revision 1.139 / (download) - annotate - [select for diffs], Fri Dec 24 22:47:37 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.138: +3 -3 lines
Diff to previous 1.138 (colored) to selected 1.307 (colored)

Make `Fo' use a B instead of SPAN (left-over).

Revision 1.138 / (download) - annotate - [select for diffs], Fri Dec 24 14:14:00 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8
Changes since 1.137: +1 -2 lines
Diff to previous 1.137 (colored) to selected 1.307 (colored)

Apparently the U tag is deprecated, so use a SPAN instead (blah).  Bump
version date for release.

Revision 1.137 / (download) - annotate - [select for diffs], Fri Dec 24 14:00:40 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.136: +25 -25 lines
Diff to previous 1.136 (colored) to selected 1.307 (colored)

As per schwarze@'s suggestions, roll back the refcount structure in
favour of a simpler shim for normalised data in the node allocation and
free routines.  This removes the need to bump and copy references within
validator handlers, removes a pointer redirect, and also kills the
refcount structure itself.  Data is assumed to "live" either in a
MDOC_BLOCK or MDOC_ELEM and is copied accordingly.

Revision 1.136 / (download) - annotate - [select for diffs], Thu Dec 23 00:45:03 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.135: +6 -6 lines
Diff to previous 1.135 (colored) to selected 1.307 (colored)

Ensure -Thtml has DIV as child of BLOCKQUOTE.

Revision 1.135 / (download) - annotate - [select for diffs], Wed Dec 22 11:15:16 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.134: +32 -32 lines
Diff to previous 1.134 (colored) to selected 1.307 (colored)

Implement reference-counted version of original union mdoc_data.  This
simplifies clean-up and allows for more types without extra hassle.

Also made in-line literal types in -T[x]html use CODE instead of SPAN to
match how literal blocks use PRE.

Revision 1.134 / (download) - annotate - [select for diffs], Mon Dec 20 13:39:24 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.133: +14 -13 lines
Diff to previous 1.133 (colored) to selected 1.307 (colored)

Fix list-type being clobbered by margins.  Last default styles in place.
Added `Sx' to be default-italic (as in OpenBSD's cvsweb).  Added `diag'
formatting, which had been lost.

Revision 1.133 / (download) - annotate - [select for diffs], Mon Dec 20 13:07:55 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.132: +18 -11 lines
Diff to previous 1.132 (colored) to selected 1.307 (colored)

More use default tags, this time I and U.  Also fix a stack overflow
segfault in the last commit.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Dec 20 10:40:11 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.131: +53 -21 lines
Diff to previous 1.131 (colored) to selected 1.307 (colored)

Give header and footer table cells default widths (using WIDTH and ALIGN
atttributes) if no style is specified.

Give the default-bold elements a B tag instead of a SPAN tag, as this
can be overriden in the stylesheet.

Prune some unused attributes from html.h.

Revision 1.131 / (download) - annotate - [select for diffs], Sun Dec 19 12:14:36 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.130: +3 -2 lines
Diff to previous 1.130 (colored) to selected 1.307 (colored)

Migrate schwarze@'s `Bk' argument patch to -T[x]html.

Revision 1.130 / (download) - annotate - [select for diffs], Fri Dec 17 12:57:49 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.129: +3 -3 lines
Diff to previous 1.129 (colored) to selected 1.307 (colored)

Don't use EM for default widths; use BU instead.

Revision 1.129 / (download) - annotate - [select for diffs], Fri Dec 17 11:19:42 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.128: +4 -5 lines
Diff to previous 1.128 (colored) to selected 1.307 (colored)

Prevent double-printing of `D1' or `Dl' DIV.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Dec 17 11:01:24 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.127: +5 -2 lines
Diff to previous 1.127 (colored) to selected 1.307 (colored)

Add a "list" top-level tag, too.

Revision 1.127 / (download) - annotate - [select for diffs], Fri Dec 17 10:43:51 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.126: +10 -4 lines
Diff to previous 1.126 (colored) to selected 1.307 (colored)

Remove useless DIVs in favour of BRs.  Fix `Ex' by having it print a prior
BR.  Fix `Rv' by only having it print a BR if there's a prior.

Revision 1.126 / (download) - annotate - [select for diffs], Fri Dec 17 10:37:26 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.125: +22 -30 lines
Diff to previous 1.125 (colored) to selected 1.307 (colored)

Make literal `Bd' use a PRE in -Thtml.  Make `Bd' output in general use
only a single DIV or PRE.  Tag all displays with display class.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Dec 17 08:17:40 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.124: +23 -43 lines
Diff to previous 1.124 (colored) to selected 1.307 (colored)

Have synopsis_pre() in -Thtml emit P or BR, not DIVs.

Banish header and footer TABLE styling to example.style.css.

Revision 1.124 / (download) - annotate - [select for diffs], Fri Dec 17 01:02:00 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.123: +34 -56 lines
Diff to previous 1.123 (colored) to selected 1.307 (colored)

Make SYNOPSIS `Nm' use a TABLE in -T[x]html mode.  Also fix `Nd' using
desc-body instead of desc as its CSS key.

Revision 1.123 / (download) - annotate - [select for diffs], Fri Dec 17 00:18:29 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.122: +24 -71 lines
Diff to previous 1.122 (colored) to selected 1.307 (colored)

Significantly clean up Sh, Ss, SH, and SS handling in -Thtml.  Now a
top-level DIV is used with only an H1 or H2 as the section header.  This
makes manuals much more readable in lynx, less complicated, and
relegates left-margin widths to example.style.css.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Dec 16 22:57:20 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.121: +18 -7 lines
Diff to previous 1.121 (colored) to selected 1.307 (colored)

Get widths to be propertly represented in -T[x]html.

Revision 1.121 / (download) - annotate - [select for diffs], Wed Dec 15 23:44:02 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.120: +1 -6 lines
Diff to previous 1.120 (colored) to selected 1.307 (colored)

Remove `Pp' and `Lp' checks in front-ends to make sure we're not
printing as the first or last child of an `Ss' or `Sh': this is now
ensured within the validator.

Revision 1.120 / (download) - annotate - [select for diffs], Wed Dec 15 17:19:41 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.119: +34 -30 lines
Diff to previous 1.119 (colored) to selected 1.307 (colored)

Use a single P tag for paragraph breaks (which can be configured for
paragraph breaking in CSS).

Use -man's handling of `sp' and `br', which accomodates for scaling
widths (-mdoc wasn't).

Revision 1.119 / (download) - annotate - [select for diffs], Wed Dec 15 16:35:21 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.118: +16 -21 lines
Diff to previous 1.118 (colored) to selected 1.307 (colored)

Make sure that new list types don't emit whitespace before or after (we
have to do this manually).

Revision 1.118 / (download) - annotate - [select for diffs], Wed Dec 15 16:08:18 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.117: +11 -7 lines
Diff to previous 1.117 (colored) to selected 1.307 (colored)

Clarify purpose of "lit".

Make `Dl' and `D1' both use BLOCKQUOTE instead of DIVs.

Revision 1.117 / (download) - annotate - [select for diffs], Wed Dec 15 15:59:23 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.116: +1 -7 lines
Diff to previous 1.116 (colored) to selected 1.307 (colored)

Remove stupid outer DIV tag in favour of regular BODY and HTML that can
be handled in CSS.

Clarified "lit" tag (will be the subject of future clarification).

Removed CSS2 note in mandoc.1, which is no longer the case.

Revision 1.116 / (download) - annotate - [select for diffs], Wed Dec 15 15:32:01 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.115: +13 -12 lines
Diff to previous 1.115 (colored) to selected 1.307 (colored)

Added list-type style tips.

Revision 1.115 / (download) - annotate - [select for diffs], Wed Dec 15 14:52:16 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.114: +153 -241 lines
Diff to previous 1.114 (colored) to selected 1.307 (colored)

In-progress move from -T[x]html using DIVs for its lists to using DL,
OL, and UL.  Issue raised by Will Backman, solution proposed by
schwarze@.

Revision 1.114 / (download) - annotate - [select for diffs], Sun Dec 5 15:37:30 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_7
Changes since 1.113: +5 -1 lines
Diff to previous 1.113 (colored) to selected 1.307 (colored)

Merge schwarze@'s changes allowing nested displays.  Tweak the patch by
making sure output doesn't add a superfluous newline with the nested displays.
Also add a COMPATIBILITY note.

Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).

Revision 1.113 / (download) - annotate - [select for diffs], Mon Nov 29 13:02:47 2010 UTC (13 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.112: +2 -2 lines
Diff to previous 1.112 (colored) to selected 1.307 (colored)

Move `Mt', `Ar', and `Li' handling from mdoc_action.c into mdoc_validate.c.

Clarify that `Mt' gets a default `~' (as per groff 1.20) and document it
in mdoc.7.

Made `Lk' be removed in mdoc_macro.c if it has no arguments.  This fixes
segfaults in mdoc_{term,html}.c that nobody's managed to raise yet.

Revision 1.112 / (download) - annotate - [select for diffs], Sat Oct 23 23:31:10 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +2 -2 lines
Diff to previous 1.111 (colored) to selected 1.307 (colored)

let .Bsx print just "BSD/OS" like in modern groff
from Ulrich Spoerlein <uqs at spoerlein dot net>

Revision 1.111 / (download) - annotate - [select for diffs], Sun Oct 10 09:59:48 2010 UTC (13 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.110: +13 -2 lines
Diff to previous 1.110 (colored) to selected 1.307 (colored)

`Sm' no longer produces a linebreak when used in `Bd'.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Oct 1 21:51:13 2010 UTC (13 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.109: +5 -6 lines
Diff to previous 1.109 (colored) to selected 1.307 (colored)

* need a space before .No even if it starts with a closing delimiter
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No
* do not let opening delimiters fall out of the front of .Ns (from kristaps@)
This fixes a few spacing issues in csh(1) and ksh(1).
OK kristaps@

Revision 1.109 / (download) - annotate - [select for diffs], Fri Oct 1 12:09:55 2010 UTC (13 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.108: +2 -1 lines
Diff to previous 1.108 (colored) to selected 1.307 (colored)

Fix small regression where `Op' had an extra space between the "[" and the SPAN.

Revision 1.108 / (download) - annotate - [select for diffs], Mon Sep 27 11:21:39 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.107: +21 -1 lines
Diff to previous 1.107 (colored) to selected 1.307 (colored)

Suppress whitespace following Pp, Lp, sp, and the other newline-emitting
macros within an unfilled or literal `Bd'.

Revision 1.107 / (download) - annotate - [select for diffs], Sun Sep 26 10:32:14 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.106: +143 -214 lines
Diff to previous 1.106 (colored) to selected 1.307 (colored)

Consolidated all -T[x]html punctuation macros into one function.

Revision 1.106 / (download) - annotate - [select for diffs], Sat Sep 25 16:41:33 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.105: +4 -2 lines
Diff to previous 1.105 (colored) to selected 1.307 (colored)

A `%T' invoked outside of `Rs' should not produce trailing punctuation.
This from a TODO entry.  Also stripped the superfluous NOSPACE, which is
handled in term_word() or print_text() anyway.

Revision 1.105 / (download) - annotate - [select for diffs], Sat Sep 25 15:51:30 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.104: +4 -7 lines
Diff to previous 1.104 (colored) to selected 1.307 (colored)

Add `Rs' vertical-space in -T[x]html "SEE ALSO" section.  Remove
corresponding TODO entry.

Also have the "." after an `Rs' block trigger inter-sentence spacing.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Sep 4 20:18:53 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.103: +2 -2 lines
Diff to previous 1.103 (colored) to selected 1.307 (colored)

Churny commit to quiet lint.  No functional changes.

Revision 1.103 / (download) - annotate - [select for diffs], Sat Sep 4 19:01:52 2010 UTC (13 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.102: +10 -1 lines
Diff to previous 1.102 (colored) to selected 1.307 (colored)

Properly handle -mdoc %A in all outputs.  This has two-author entires
separated by only "and" while two or more are with ", and" for the last
author.

Also remove relevant TODO and add regression tests.

Revision 1.102 / (download) - annotate - [select for diffs], Fri Aug 20 01:02:07 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored) to selected 1.307 (colored)

Implement a simple, consistent user interface for error handling.
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK  kristaps@;  Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.

Revision 1.101 / (download) - annotate - [select for diffs], Sat Aug 7 17:20:17 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.100: +5 -5 lines
Diff to previous 1.100 (colored) to selected 1.307 (colored)

same as mdoc_term.c rev. 1.180:
preserve blank lines at the end of .Bd -literal
patch from kristaps@, who asked me to commit this

Revision 1.100 / (download) - annotate - [select for diffs], Tue Jul 27 08:38:04 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5
Changes since 1.99: +5 -8 lines
Diff to previous 1.99 (colored) to selected 1.307 (colored)

Fix how `Bd -unfilled' and `Bd -literal' break lines.  This unbreaks
displays to work as old groff shows them; however, new groff still does
some fancy shit.

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jul 23 00:08:57 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF
Changes since 1.98: +20 -2 lines
Diff to previous 1.98 (colored) to selected 1.307 (colored)

Add support for `Sm' in -T[x]html -mdoc.

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jul 19 11:11:54 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.97: +2 -2 lines
Diff to previous 1.97 (colored) to selected 1.307 (colored)

Remove some FIXMEs: `Ms' accepts arbitrary text, so it can't/shouldn't
be converted into a symbol.

The `Pp' issue has also been fixed.

Revision 1.97 / (download) - annotate - [select for diffs], Mon Jul 19 11:06:31 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.96: +6 -1 lines
Diff to previous 1.96 (colored) to selected 1.307 (colored)

Fix spurrious newline emitted by `Pp' when specified before or after
`Sh'/`Ss'.  Reported by Jason McIntyre.

Revision 1.96 / (download) - annotate - [select for diffs], Tue Jul 13 23:53:20 2010 UTC (13 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored) to selected 1.307 (colored)

correct lots of copyright notices;
ok kristaps@

Revision 1.95 / (download) - annotate - [select for diffs], Wed Jul 7 15:04:54 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_4
Changes since 1.94: +1 -2 lines
Diff to previous 1.94 (colored) to selected 1.307 (colored)

Re-constitution of `ds' symbol processing.  First, push the
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff.  Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros).  Remove term.c's invocation of the
roff_getstrn() function.  Removed function documentation in roff.3 and
added roff.7 `ds' documentation.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Jul 6 12:37:17 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.93: +48 -2 lines
Diff to previous 1.93 (colored) to selected 1.307 (colored)

Give -T[x]html `Bk -words' capability.

Revision 1.93 / (download) - annotate - [select for diffs], Sun Jul 4 21:59:30 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.92: +4 -14 lines
Diff to previous 1.92 (colored) to selected 1.307 (colored)

Cache column sizes and char pointer into mdoc_bl.  Finally get rid of
the loops here and there to track down the MDOC_Column arguments.

Revision 1.92 / (download) - annotate - [select for diffs], Fri Jul 2 12:54:33 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.91: +17 -30 lines
Diff to previous 1.91 (colored) to selected 1.307 (colored)

Stash `Bf' parameters into struct mdoc_bf.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jul 2 10:42:46 2010 UTC (13 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.90: +62 -9 lines
Diff to previous 1.90 (colored) to selected 1.307 (colored)

Implemented -Thtml bits for handling `Nm' blocks.

Revision 1.90 / (download) - annotate - [select for diffs], Thu Jul 1 22:56:17 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.89: +17 -14 lines
Diff to previous 1.89 (colored) to selected 1.307 (colored)

Make struct_bl and struct_bd into pointers.  This removes the need to do
copying on internals after modification.  Even more importantly, if an
ENDBODY token is provided, it would have been impossible for post-change
copying of the data to take place in the BLOCK.  This allows it to
happen by dint of pointers.

Also did some bikeshedding in mdoc_term.c: checking against enum type
and explicitly casting to the "post" function to void.  This is for my
own readability.

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jul 1 14:34:03 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.88: +3 -3 lines
Diff to previous 1.88 (colored) to selected 1.307 (colored)

More reality-checks for the p->end type.

Revision 1.88 / (download) - annotate - [select for diffs], Tue Jun 29 19:20:38 2010 UTC (13 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.87: +3 -3 lines
Diff to previous 1.87 (colored) to selected 1.307 (colored)

Support for badly nested blocks, written around the time of
the Rostock mandoc hackathon and tested and polished since,
supporting constructs like:

.Ao Bo    Ac    Bc        (exp breaking exp)
.Aq Bo    eol   Bc        (imp breaking exp)
.Ao Bq    Ac    eol       (exp breaking imp)
.Ao Bo So Bc    Ac  Sc    (double break, inner before outer)
.Ao Bo So Ac    Bc  Sc    (double break, outer before inner)
.Ao Bo    Ac So Bc  Sc    (broken breaker)
.Ao Bo So Bc Do Ac  Sc Dc (broken double breaker)

There are still two known issues which are tricky:

1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol)
fails outright, triggering a bogus syntax error.
2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc
or Ao Ao Bq Ac Ac eol) still has a minor rendering error left:
"<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">".

We can fix these later in the tree, let's not grow this diff too large.

"get it in" kristaps@

Revision 1.87 / (download) - annotate - [select for diffs], Sun Jun 27 16:18:13 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_3
Changes since 1.86: +6 -6 lines
Diff to previous 1.86 (colored) to selected 1.307 (colored)

Following clue-stick applied by schwarze@, back out const-ness of regset
passed in to libmdoc and libman.

Fix mdoc.3 and man.3 EXAMPLE sections to include regset.

Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values
as if SEC_SYNOPSIS were the current section.

Revision 1.86 / (download) - annotate - [select for diffs], Sat Jun 26 15:36:37 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.85: +2 -1 lines
Diff to previous 1.85 (colored) to selected 1.307 (colored)

Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept a
const struct regset pointer.  No functionality.

Revision 1.85 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:28 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored) to selected 1.307 (colored)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.84 / (download) - annotate - [select for diffs], Sun Jun 13 21:41:58 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.83: +4 -4 lines
Diff to previous 1.83 (colored) to selected 1.307 (colored)

Switch on cached -width usage in front-ends.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Jun 12 12:38:01 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.82: +5 -9 lines
Diff to previous 1.82 (colored) to selected 1.307 (colored)

Cached `Bl -offset' into mdoc_bl.  Removed erroneous "-offset defaults
to 6n if no value is specified" and added regression tests for `Bl'
testing against the empty -offset argument.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Jun 12 12:10:55 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.81: +3 -5 lines
Diff to previous 1.81 (colored) to selected 1.307 (colored)

Moved `Bl -compact' into cached data.  This allowed the removal of
scanning the argv list in print_bvspace(), and thus the parent pointer.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jun 12 11:58:22 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80 (colored) to selected 1.307 (colored)

`Bl' is now using a struct instead of a single enum mdoc_list for its
cached values.  You can probably guess where this is going.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Jun 12 11:21:44 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.79: +10 -22 lines
Diff to previous 1.79 (colored) to selected 1.307 (colored)

Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed in
the "data" union in mdoc_node.  Allows me to remove some ugly loops in
the front-end and duplicate tests in mdoc_action.c.  Add a regression
test to make sure we're not doing anything bad (more to come).

Revision 1.79 / (download) - annotate - [select for diffs], Sat Jun 12 10:09:19 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.78: +5 -15 lines
Diff to previous 1.78 (colored) to selected 1.307 (colored)

Added enum mdoc_disp (similar to enum mdoc_list).  Display types are now
only calculated once in mdoc_validate.c.

Noted that `Bd -file xxx' is not supported:  it now raises a fatal
warning.  This is noted in mdoc.7.

Empty `Bd' now defaults to LIST_ragged, which is not quite what groff
does, but close enough (gross just throws away the `Bd' and gets upset
when it encounters an `Ed').

Revision 1.78 / (download) - annotate - [select for diffs], Mon Jun 7 11:01:15 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_1
Changes since 1.77: +67 -61 lines
Diff to previous 1.77 (colored) to selected 1.307 (colored)

Normalise SYNOPSIS behaviour after I gave up on following groff's
inconsistent behaviour.  In short:

       Some macros are displayed differently in the SYNOPSIS
       section, particularly Nm, Cd, Fd, Fn, Fo, In, Vt, and Ft.
       All of these macros are output on their own line.  If two
       such dissimilar macros are pair-wise invoked (except for Ft
       before Fo or Fn), they are separated by a vertical space,
       unless in the case of Fo, Fn, and Ft, which are always
       separated by vertical space.

Behaviour ok Jason McIntyre, ingo@.  Fallout will be treated
case-by-case.

I had to clear out some regressions that were testing against groff's
stranger behaviours: these will now break, as we don't care about such
invocations.

Also removed the newline for `Cd' invocation in a non-SYNOPSIS context.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Jun 6 10:50:56 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.76: +24 -14 lines
Diff to previous 1.76 (colored) to selected 1.307 (colored)

Fixed -Tascii and -Thtml rendering of `Ft' and `Fo'.

Revision 1.76 / (download) - annotate - [select for diffs], Fri Jun 4 22:26:13 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.75: +5 -1 lines
Diff to previous 1.75 (colored) to selected 1.307 (colored)

Fix following the first: `Ft' is given special treatment if specified before
`Fn'.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jun 4 22:16:27 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.74: +3 -2 lines
Diff to previous 1.74 (colored) to selected 1.307 (colored)

Fixed `Fn' newline behaviour and added some regression tests to this
extent.

Documented `Fn'.  Please note the COMPATIBILITY note regarding historic
groff.

Revision 1.74 / (download) - annotate - [select for diffs], Fri Jun 4 21:49:39 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.73: +5 -17 lines
Diff to previous 1.73 (colored) to selected 1.307 (colored)

Documented `In' in full.

Fixed `In' to behave properly: it wasn't properly breaking lines,
formatting, or really anything else.  Noted COMPATIBILITY with
OpenBSD's groff, which pukes all over `In'.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jun 4 21:05:39 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.72: +12 -13 lines
Diff to previous 1.72 (colored) to selected 1.307 (colored)

Fixed `Fd' to format in the right way.  Found when confused by what the
hell `Fd' is supposed to do anyway (answer: it's a historical macro and
we shouldn't be doing anything with it anyway).

Revision 1.72 / (download) - annotate - [select for diffs], Thu Jun 3 13:44:36 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.71: +5 -6 lines
Diff to previous 1.71 (colored) to selected 1.307 (colored)

Consolidated list processing to a single loop in mdoc_validate.c.  This
relieves having to repeat running over the argument list in
mdoc_action.c and mdoc_validate.c.

Default to LIST_item for type-less lists (groff technically doesn't do
this: it just ignores the `It' lines altogether).

Make MANDOC_LISTTYPE be a recoverable error.

Revision 1.71 / (download) - annotate - [select for diffs], Mon May 31 10:28:04 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.70: +2 -1 lines
Diff to previous 1.70 (colored) to selected 1.307 (colored)

Remove enum mdocargerr from phrase() (unused).

Add `Ta' macro, which is basically a NULL case everywhere but in
mdoc_macro.c, where it closes out an existing `It' body scope and opens
a new one, then continues parsing as in phrase() (TODO: merge these
two?).

Fix where scope-breaking was silently just dying instead of printing an
error.

Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context.

We now support arbitrarily complex `It' contents for `Bl -column'.

Revision 1.70 / (download) - annotate - [select for diffs], Sun May 30 22:56:02 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.69: +20 -23 lines
Diff to previous 1.69 (colored) to selected 1.307 (colored)

Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD.  This
will make it easy for re-entrant parsing of `Ta' macros to fit in with
standard closure rules.

Added some more regressions for `Bl -column'.  Note that one should
fail, as documented in the TODO file.

Recorded change of AST BNF in mdoc.3.

Revision 1.69 / (download) - annotate - [select for diffs], Sat May 29 18:58:52 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.68: +1 -3 lines
Diff to previous 1.68 (colored) to selected 1.307 (colored)

Moved printing of empty word [back] into mdoc_action.c so that it's not
mirrored across front-ends.

Revision 1.68 / (download) - annotate - [select for diffs], Sat May 29 18:47:54 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.67: +3 -1 lines
Diff to previous 1.67 (colored) to selected 1.307 (colored)

Commit of patch floated on discuss@ a few days ago: if an in_line scope
has not been opened and closing punctuation is encountered AND the macro
is marked as accepting no-content (or `Li'), then open an empty scope.

Added regression tests for `Fl' and `Li' testing this behaviour.

Also, squeeze hyph0.in tests into the last characters of each line so
that groff doesn't hyphenate and break the test.

Revision 1.67 / (download) - annotate - [select for diffs], Mon May 24 12:17:09 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.66: +3 -3 lines
Diff to previous 1.66 (colored) to selected 1.307 (colored)

Fix segfault in mixing old enum types for -Thtml -mdoc.

Revision 1.66 / (download) - annotate - [select for diffs], Mon May 17 23:57:06 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.65: +35 -80 lines
Diff to previous 1.65 (colored) to selected 1.307 (colored)

Increase performance by stashing the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can known whether to
dump list line arguments into the body (`Bl -column' overflowing).

Remove a2list() and arg_listtype() because of this.

Revision 1.65 / (download) - annotate - [select for diffs], Mon May 17 22:11:42 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.64: +7 -3 lines
Diff to previous 1.64 (colored) to selected 1.307 (colored)

Enable the unified error/warning enumeration in mandoc.h that's
stringified in main.c.

Allow `An' to handle an argument and child (with a warning).

Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a
warning).

Allow inconsistent column syntax to only raise a warning.

Revision 1.64 / (download) - annotate - [select for diffs], Mon May 17 02:38:13 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.63: +4 -3 lines
Diff to previous 1.63 (colored) to selected 1.307 (colored)

Documented ie/el.
Installing roff.7 and added it to index.sgml.
Small fix for `D1' and `Bd' in -Thtml.

Revision 1.63 / (download) - annotate - [select for diffs], Sat May 15 16:24:38 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored) to selected 1.307 (colored)

LIBRARY can also occur in section 9.
All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc.
Useful warning printed if unknown manual section.
Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.

Revision 1.62 / (download) - annotate - [select for diffs], Thu May 13 06:22:11 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_25
Changes since 1.61: +8 -7 lines
Diff to previous 1.61 (colored) to selected 1.307 (colored)

Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.
Fixed assumption that parse-point == 1 equates to beginning of line (false if whitespace separates macro and control character).
Fixed line-break for non-first-macro in several SYNOPSIS macros.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Apr 8 08:17:55 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_24
Changes since 1.60: +3 -11 lines
Diff to previous 1.60 (colored) to selected 1.307 (colored)

Fixed %T: it now correctly underlines, instead of quoting (noted by Jason McIntyre and posted on Ingo Schwarze' mandoc-todo list).

Revision 1.60 / (download) - annotate - [select for diffs], Wed Apr 7 07:49:38 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_23
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored) to selected 1.307 (colored)

Bug in printing of reserved words with form \*[xxx] fixed (found by Joerg Sonnenberger).

Revision 1.59 / (download) - annotate - [select for diffs], Tue Apr 6 11:28:17 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.58: +3 -1 lines
Diff to previous 1.58 (colored) to selected 1.307 (colored)

Let `Bl' accept arguments on the head line with a warning (these are ignored in the front-end device) (noted by Theo de Raadt).

Revision 1.58 / (download) - annotate - [select for diffs], Tue Apr 6 07:27:42 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored) to selected 1.307 (colored)

`Fl' now correctly suppresses the trailing space if followed by macros on the same line.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Apr 5 08:51:56 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.56: +42 -37 lines
Diff to previous 1.56 (colored) to selected 1.307 (colored)

Fix in `Mt' mailto from a patch by Tim van der Molen.
Fixed PAIR_xxx_INIT macros -- this are to be unified.
Have `Vt', `Fn', `Ft', and `Fo' print whitespace afterward, instead of before.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Apr 3 14:25:12 2010 UTC (13 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.55: +4 -1 lines
Diff to previous 1.55 (colored) to selected 1.307 (colored)

Merged patch by Ingo Schwarze allowing `Xr' to pass through with no arguments (emits warning of course).

Revision 1.55 / (download) - annotate - [select for diffs], Mon Mar 29 19:28:04 2010 UTC (14 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_22, VERSION_1_9_21, VERSION_1_9_20
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored) to selected 1.307 (colored)

Integrate Ingo Schwarze's patch for mdoc_iscdelim() (tri-state for opening and closing macro punctuation).
Modify blk_part_exp() to correctly handle leading punctuation before HEAD.
Significantly clean up and document blk_part_exp().
Modify blk_part_imp() for to correctly handle leading punctuation before HEAD.
Significantly clean up and document blk_part_imp().
Integrate Ingo Schwarze's patch for args() (using new mdoc_iscdelim() format).
Documented bad `Ec' handling for later work in mdoc_term.c/mdoc_html.c.

Revision 1.54 / (download) - annotate - [select for diffs], Sat Jan 30 08:42:20 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_19, VERSION_1_9_18, VERSION_1_9_17, VERSION_1_9_16, VERSION_1_9_15
Changes since 1.53: +6 -3 lines
Diff to previous 1.53 (colored) to selected 1.307 (colored)

Fix in handling Vt in SYNOPSIS with trailing punctuation.  Spotted by Joerg Sonnenberger.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Jan 29 14:39:38 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored) to selected 1.307 (colored)

Fixed Makefile for `make lint' dep. on config.h
Added -Txhtml for XHTML output (minimal increase to programme logic).  Because groff has it and it bothers me that we don't.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Jan 1 17:14:29 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre2
Changes since 1.51: +9 -7 lines
Diff to previous 1.51 (colored) to selected 1.307 (colored)

Big check-in of compatibility layer.  This should work on most major architectures. Thanks to Joerg Sonnenberger.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jan 1 13:35:30 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre1
Changes since 1.50: +5 -17 lines
Diff to previous 1.50 (colored) to selected 1.307 (colored)

Documented `Fl' in mdoc.7.
Backed out stipulation that `Fl ""' is ignored: this is not the case in !OpenBSD groffs.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 1 13:17:58 2010 UTC (14 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.49: +25 -4 lines
Diff to previous 1.49 (colored) to selected 1.307 (colored)

`Fl' has each argument be in a separate scope (thanks Ingo Schwarze).
Situation of `Fl [arg]* "" [arg]*' is fixed: empty arguments are ignored.  Note that OpenBSD crashes when this happens.
Situation of `Fl' is fixed wrt trailing whitespace.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Dec 2 10:16:55 2009 UTC (14 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored) to selected 1.307 (colored)

Fixed handling of exampledir (pointed out by Ulrich Sporlein, forgotten, discovered again).

Revision 1.48 / (download) - annotate - [select for diffs], Mon Nov 16 08:46:59 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_14
Changes since 1.47: +2 -4 lines
Diff to previous 1.47 (colored) to selected 1.307 (colored)

Enabled -Thtml -mdoc to work with \f (see compat notes in mandoc.1).

Revision 1.47 / (download) - annotate - [select for diffs], Sat Nov 14 12:04:59 2009 UTC (14 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.46: +6 -7 lines
Diff to previous 1.46 (colored) to selected 1.307 (colored)

Removed superfluous HTML_NEWLINE.

Revision 1.46 / (download) - annotate - [select for diffs], Sat Oct 31 08:34:12 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_13
Changes since 1.45: +6 -3 lines
Diff to previous 1.45 (colored) to selected 1.307 (colored)

Fixed -Thtml printing of -ohang lists (-mdoc).
Fixed validation of -ohang lists as having no widths.

Revision 1.45 / (download) - annotate - [select for diffs], Sat Oct 31 06:50:25 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored) to selected 1.307 (colored)

Patch on DragonFly BSD syntax (thanks Sascha Wildner).
Noted inclusion into DragonFly BSD (thanks Sascha Wildner).

Revision 1.44 / (download) - annotate - [select for diffs], Sat Oct 31 06:10:58 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_12
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored) to selected 1.307 (colored)

Using perror() instead of fprintf for failure from library functions.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Oct 30 18:53:08 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.42: +5 -4 lines
Diff to previous 1.42 (colored) to selected 1.307 (colored)

More lint fixes.
Removed err.h from inclusions (less main.c--still in progress).

Revision 1.42 / (download) - annotate - [select for diffs], Wed Oct 28 08:00:18 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.41: +11 -10 lines
Diff to previous 1.41 (colored) to selected 1.307 (colored)

Fixed `sp', `br', `Pp', etc. so as not to have an empty div (-Thtml, -man, -mdoc).
Made html_idcat be completely correct (messy standard) (-Thtml).
Fixed warnings about -ohang and -item lists (-Thtml, -mdoc).
Fixed typo in index.sgml.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Oct 28 05:08:17 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.40: +16 -14 lines
Diff to previous 1.40 (colored) to selected 1.307 (colored)

Fixed un-reset buffer in `.In', -Thtml, -mdoc.
Added html_id[cat,cpy] for transforming id's into well-formed attribute strings (no %s, etc.).

Revision 1.40 / (download) - annotate - [select for diffs], Tue Oct 27 04:50:15 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.39: +10 -5 lines
Diff to previous 1.39 (colored) to selected 1.307 (colored)

Added "summary" tag to tables in order to silence HTML-tidy's complaints.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Oct 26 08:18:16 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_11, VERSION_1_9_10
Changes since 1.38: +7 -7 lines
Diff to previous 1.38 (colored) to selected 1.307 (colored)

Portability: replaced queue macros in html.c (Joerg Sonnenberger).
Fixed "-o" residue.
Added "-O" to usage() (-o didn't appear there either).

Revision 1.38 / (download) - annotate - [select for diffs], Mon Oct 26 04:09:45 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.37: +28 -18 lines
Diff to previous 1.37 (colored) to selected 1.307 (colored)

Full `%U' support.
`Lk' display fixed.
Renamed arg2xxxx as a2xxxx for consistency.
Renamed print_foot to print_man_foot for consistency.
Removed default printing of `~' when `Lk' not provided (not sure where I got that from).

Revision 1.37 / (download) - annotate - [select for diffs], Sat Oct 24 05:52:13 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.36: +4 -1 lines
Diff to previous 1.36 (colored) to selected 1.307 (colored)

Added `%U' to -mdoc (doesn't render in a nice way yet).

Revision 1.36 / (download) - annotate - [select for diffs], Thu Oct 22 18:55:32 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.35: +4 -8 lines
Diff to previous 1.35 (colored) to selected 1.307 (colored)

Fixed maddening mismatch between groff and strftime mismatch of day ("%e").  Noted by Ulrich Sporlein.

Revision 1.35 / (download) - annotate - [select for diffs], Tue Oct 20 05:45:21 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_9
Changes since 1.34: +8 -6 lines
Diff to previous 1.34 (colored) to selected 1.307 (colored)

More updates to mdoc.7.

Revision 1.34 / (download) - annotate - [select for diffs], Mon Oct 19 11:02:24 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.33: +3 -1 lines
Diff to previous 1.33 (colored) to selected 1.307 (colored)

Continued work on mdoc.7.
Noted buffer overwrite bug in -Thtml -mdoc (will fix later).

Revision 1.33 / (download) - annotate - [select for diffs], Mon Oct 19 10:18:06 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored) to selected 1.307 (colored)

Fixed -mdoc -Thtml with -item lists not to default-indent when width isn't specified.
Many more cleanups to mdoc.7 (ongoing completion and documentation of all macros).

Revision 1.32 / (download) - annotate - [select for diffs], Sun Oct 18 19:03:37 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.31: +6 -6 lines
Diff to previous 1.31 (colored) to selected 1.307 (colored)

Made sure devices and formats recognise that -man and -mdoc have different syntax for scaling widths: -mdoc assumes no unit means that the value is a string literal while -man instead uses the default vertical/horizontal scale.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Oct 18 11:14:04 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.30: +5 -1 lines
Diff to previous 1.30 (colored) to selected 1.307 (colored)

Added horizontal scaling units to -Tman -Tascii.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Oct 15 01:33:12 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.29: +5 -1 lines
Diff to previous 1.29 (colored) to selected 1.307 (colored)

Added support for `Bd -centered', which appears in newer groffs (not yet implemented in centre-capable front-ends, i.e., -Thtml).

Revision 1.29 / (download) - annotate - [select for diffs], Tue Oct 13 10:57:25 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.28: +2 -1 lines
Diff to previous 1.28 (colored) to selected 1.307 (colored)

Moved output definitions into main.h.
Pushed terminal_{mdoc,man} into {mdoc,man}_term.c.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Oct 10 10:05:12 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_8
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored) to selected 1.307 (colored)

`Cd' in -Thtml -mdoc correctly breaks lines.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Oct 8 23:00:15 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_7
Changes since 1.26: +11 -11 lines
Diff to previous 1.26 (colored) to selected 1.307 (colored)

Consolidated some -man -Tascii functions.
Added many -man -Thtml functions (almost complete).

Revision 1.26 / (download) - annotate - [select for diffs], Wed Oct 7 15:06:03 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored) to selected 1.307 (colored)

Lint-ified.

Revision 1.25 / (download) - annotate - [select for diffs], Wed Oct 7 14:50:28 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.24: +18 -16 lines
Diff to previous 1.24 (colored) to selected 1.307 (colored)

Lint-ified.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Oct 7 14:39:00 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.23: +45 -15 lines
Diff to previous 1.23 (colored) to selected 1.307 (colored)

Made default string units (-Thtml -mdoc) to use `m' and not `n' scaling (better more than less).
Fixed -column widths for -Thtml -mdoc.
Fixed left-hand margin padding for -Thtml -mdoc.

Revision 1.23 / (download) - annotate - [select for diffs], Wed Oct 7 12:35:24 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.22: +391 -450 lines
Diff to previous 1.22 (colored) to selected 1.307 (colored)

Additions to -Tman -Thtml: all structural components tested & in place.
Fitted both -Thtml with handling of arbitrary vertical and horizontal scaling units (see groff(7)).  Undocumented until fitted into -Tascii (next release).

Revision 1.22 / (download) - annotate - [select for diffs], Sun Oct 4 15:24:54 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.21: +5 -1 lines
Diff to previous 1.21 (colored) to selected 1.307 (colored)

Structural components of -man -Thtml in place (note that HP is the same as IP, as HTML doesn't "do" this construction without fixed page widths).

Revision 1.21 / (download) - annotate - [select for diffs], Sun Oct 4 09:00:40 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +44 -41 lines
Diff to previous 1.20 (colored) to selected 1.307 (colored)

Section/subsection anchor names (<a name=xxx>) replaced with (div id=xxx) (noted by joerg@netbsd.org)
Removed superfluous span tags within section/subsection divs (noted by joerg@netbsd.org).

Revision 1.20 / (download) - annotate - [select for diffs], Sat Oct 3 19:57:53 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +7 -12 lines
Diff to previous 1.19 (colored) to selected 1.307 (colored)

Added initial -man framework for -Thtml.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Oct 3 19:02:45 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.18: +19 -14 lines
Diff to previous 1.18 (colored) to selected 1.307 (colored)

`Fn' does not print empty ftype span.
-Tascii `node' and `meta' args in DECL_ARGS renamed to `n' and `m' to be more coherent with -Thtml.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 3 16:36:06 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.17: +3 -108 lines
Diff to previous 1.17 (colored) to selected 1.307 (colored)

Fixed mandoc.1 examples (new -Thtml options).
Fixed manuals to use `In', not `Fd'.
Moved buf* functions into html.c.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Oct 3 15:26:26 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.16: +63 -22 lines
Diff to previous 1.16 (colored) to selected 1.307 (colored)

Added the -oincludes=FMT option.
The `In' handler now decorates with a hyperlink.
If no -oman= or -oincludes= is stipulated, no link is printed (but the text is still style-decorated).

Revision 1.16 / (download) - annotate - [select for diffs], Sat Oct 3 15:08:09 2009 UTC (14 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.15: +142 -68 lines
Diff to previous 1.15 (colored) to selected 1.307 (colored)

Element tag buffer is now part of struct html.
buffmt() can be called in sequence.
Noted BUFSIZ-sized buffer in CAVEATS (attribute length for link formats).
Added -oman=FMT -Thtml option for `Xr' manual links.
Removed -obase=URI -Thtml option (obsolete).

Revision 1.15 / (download) - annotate - [select for diffs], Sat Sep 26 18:31:36 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +25 -18 lines
Diff to previous 1.14 (colored) to selected 1.307 (colored)

SYNOPSIS functions in -Thtml text-indent and group paramters (as nroff does).

Revision 1.14 / (download) - annotate - [select for diffs], Sat Sep 26 18:02:51 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +50 -21 lines
Diff to previous 1.13 (colored) to selected 1.307 (colored)

Fixed -Thtml handling of -compact lists.
Fixed -Thtml handling of `Bd' prior vspace and embedded macros.

Revision 1.13 / (download) - annotate - [select for diffs], Sat Sep 26 17:35:49 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored) to selected 1.307 (colored)

Fixed `Bd' prior vertical space (was ignoring -compact).
Fixed effect of embedding macros in `Bd' (was printing all on each line instead of grouping).

Revision 1.12 / (download) - annotate - [select for diffs], Fri Sep 25 13:00:13 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_6
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored) to selected 1.307 (colored)

Lint check (noop).

Revision 1.11 / (download) - annotate - [select for diffs], Fri Sep 25 12:43:05 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored) to selected 1.307 (colored)

Changed -Thtml document header to be 10/80/10 with no wrapping of the middle.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Sep 24 23:54:43 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +94 -14 lines
Diff to previous 1.9 (colored) to selected 1.307 (colored)

-Tascii correctly prints `%T' in `Rs' with quotes.
-Thtml behaves like -Tascii for printing.
Printing of `Rs' elements cross-checked with new groff.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Sep 24 15:05:56 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored) to selected 1.307 (colored)

Lint-fixes (noop).

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 24 13:18:37 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.7: +9 -15 lines
Diff to previous 1.7 (colored) to selected 1.307 (colored)

Proper handling of `Rs' blocks in -Thtml.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Sep 24 11:55:28 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +29 -5 lines
Diff to previous 1.6 (colored) to selected 1.307 (colored)

Fix in -Tascii where `Lb' causes line-break in any section (should only happen in LIBRARY).
`Fn' first parameter is broken apart into ftype and fname in -Thtml (for correct style application).
Fixed \0 special character.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Sep 24 11:05:45 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +78 -7 lines
Diff to previous 1.5 (colored) to selected 1.307 (colored)

Sync'd example style-sheet to be more like OpenBSD's default (KISS).
-Thtml and -Tascii now have equivalent functionality.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Sep 24 09:50:31 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +139 -37 lines
Diff to previous 1.4 (colored) to selected 1.307 (colored)

Added Bf, Pf, etc. to -Thtml.
Fixed Rs in -Tascii to behave properly when not in "SEE ALSO" section.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Sep 24 09:20:02 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.3: +221 -15 lines
Diff to previous 1.3 (colored) to selected 1.307 (colored)

Many more macros added to -Thtml.
Minor space issues fixed in -Tascii.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Sep 22 16:10:52 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored) to selected 1.307 (colored)

Fix segfault in -Thtml column lists.
Added some more UTF-8 chars.
mandoc_char.7 now has all special characters rendered.
Fixed column layout in -Thtml.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Sep 21 23:12:08 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +96 -11 lines
Diff to previous 1.1 (colored) to selected 1.307 (colored)

A few more macros in -Thtml.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Sep 21 14:56:57 2009 UTC (14 years, 6 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_5
Diff to selected 1.307 (colored)

Split html.c into html.h, mdoc_html.c, man_html.c.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb