| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I don't think there ever was a reason for doing so.
Besides, there is a discrepacy with respect to the point in the
document affected. That flag controls whitespace at the current
formatting point. But when HTML_BUFFER is in effect, the line break
and indentation is typically inserted one word further to the left.
Anything happening at that point to the left can't reasonably
influence spacing at the different point further to the right.
Among other effects, this change avoids some spurious line breaks
in HTML code at points where they weren't supposed to happen, line
breaks that in some cases caused undesirable, visible whitespace
when the resulting HTML was rendered.
|
|
|
|
|
|
|
|
|
| |
contained in flow containers; never put them directly into sections.
This helps to format paragraphs with the CSS class selector .Pp.
Suggested by bentley@ and also by Colin Watson <cjwatson at debian>
via Michael Stapelberg <stapelberg at debian>,
see https://github.com/Debian/debiman/issues/116
|
|
|
|
|
|
|
|
| |
dependent on individual HTML elements, and simpler: don't just close
<p>, <pre>, and <a>, but any element that establishes phrasing
context. This doesn't change output for any OpenBSD manual page,
but it will allow using this function more safely and at more places
in the future.
|
| |
|
|
|
|
|
|
|
| |
Tested on the complete manual page trees of Version 7 AT&T UNIX,
4.4BSD-Lite2, POSIX-2013, OpenBSD 2.2 to 6.5 and -current,
FreeBSD 10.0 to 12.0, NetBSD 6.1.5 to 8.1, DragonFly 3.8.2 to 5.6.1,
and Linux 4.05 to 5.02.
|
|
|
|
| |
delete unimportant .Pp rule and shorten overly specific selectors
|
|
|
|
|
|
|
|
| |
text without printing an opening tag right away, and use that in
the .ft request handler. While here, garbage collect redundant
enum htmlfont and reduce code duplication in print_text().
Fixing an assertion failure reported by Michael <Stapelberg at Debian>
in pmRegisterDerived(3) from libpcp3-dev.
|
|
|
|
|
|
|
|
| |
after processing each manual page, such that the next page
starts from a clean state and doesn't continue suffix numbering.
Issue found while looking at https://github.com/Debian/debiman/issues/48
which was brought up by Orestis Ioannou <oorestisime at github>.
|
|
|
|
|
|
| |
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>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
choice, which is the <p> HTML element. On top of the previous
fill-mode improvements, the key to making this possible is to
automatically close the <p> when required: before headers, subsequent
paragraphs, lists, indented blocks, synopsis blocks, tbl(7) blocks,
and before blocks using no-fill mode.
In man(7) documents, represent the .sp request by a blank line in
no-fill mode and in the same way as .PP in fill mode.
|
|
|
|
|
|
|
|
|
|
| |
use it in the man(7) HTML formatter rather than keeping fill mode
state locally, resulting in massive simplification (minus 40 LOC).
Move the html_fillmode() state handler function to the html.c module
such that both the man(7) and the roff(7) formatter (and in the future,
also the mdoc(7) formatter) can use it. Give it a query mode, to be
invoked with TOKEN_NONE.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add the missing special character \_ (underscore).
* Partial implementations of \a (leader character)
and \E (uninterpreted escape character).
* Parse and ignore \r (reverse line feed).
* Add a WARNING message about undefined escape sequences.
* Add an UNSUPP message about unsupported escape sequences.
* Mark \! and \? (transparent throughput)
and \O (suppress output) as unsupported.
* Treat the various variants of zero-width spaces as one-byte escape
sequences rather than as special characters, to avoid defining bogus
forms with square brackets.
* For special characters with one-byte names, do not define bogus
forms with square brackets, except for \[-], which is valid.
* In the form with square brackets, undefined special characters do not
fall back to printing the name verbatim, not even for one-byte names.
* Starting a special character name with a blank is an error.
* Undefined escape sequences never abort formatting of the input
string, not even in HTML output mode.
* Document the newly handled escapes, and a few that were missing.
* Regression tests for most of the above.
|
|
|
|
| |
It can occur anywhere, in particular in phrasing context.
|
|
|
|
|
| |
In fact, this is already required when a table uses non-default
horizontal and vertical alignment in the same cell.
|
|
|
|
|
| |
make sure it doesn't cause output of bogus whitespace.
Fixing a bug reported by Pali dot Rohar at gmail dot com.
|
|
|
|
|
|
|
|
|
| |
for HTML output. Somewhat relevant because pod2man(1) relies on this.
Missing feature reported by Pali dot Rohar at gmail dot com.
Note that constant width font was already correctly selected before
this when required by semantic markup. Only attempting physical
markup with the low-level escape sequence was ineffective.
|
|
|
|
|
| |
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
by allowing the preprocessor to pass it through to the formatters.
Used for example by the groff_char(7) manual page.
|
|
|
|
| |
now that we no longer use variable style= attributes.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
doesn't actually harm responsive design, so keep it for now.
Bug reported in de.comp.os.unix.bsd via naddy@, thanks.
|
| |
|
|
|
|
| |
which are no longer used because we write fewer style= attributes.
|
|
|
|
|
| |
Fixing HTML syntax violations e.g. in pf.conf(5) and ifconfig(8)
reported by Anton Lazarov <lists at wrant dot com>.
|
|
|
|
|
| |
Append suffixes for disambiguation. Issue first reported by Jakub
Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
|
| |
|
| |
|
|
|
|
| |
suggested by John Gardner <gardnerjohng at gmail dot com>.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Cleaner HTML, more idiomatic CSS, and minus 30 lines of C code.
Suggested by John Gardner <gardnerjohng at gmail dot com>.
|
|
|
|
|
|
|
|
| |
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>.
|
| |
|
|
|
|
|
| |
in full HTML output, but not with -Ofragment, e.g. in man.cgi(8);
suggested by Thomas Klausner <wiz at NetBSD>
|
|
|
|
|
| |
could be triggered with '.SS ""';
reported by Michael <Stapelberg at debian>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Even though we skip the style when the argument is NULL,
we must still consume the options.
Not found with afl(1), but during manual testing of the previous patch...
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
from bentley@, tweaked by me
|
|
|
|
|
| |
and write fontstyle or fontweight attributes where required.
Missing features reported by bentley@.
|
| |
|
|
|
|
|
| |
a pointer to the end of the parsed data, making it easier to
parse subsequent bytes
|