summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2018-06-25Delete substantial amounts of codeIngo Schwarze
now that we no longer use variable style= attributes.
2018-06-25Get rid of the last explicit length in HTML style= attributes.Ingo Schwarze
Even though style=height is not particularly harmful for responsive design except for very large arguments which don't really occur in practice, it is not useful either: nobody should use .sp in manual pages, in particular not with an argument. Even if somebody does, ignoring the argument will likely make the output look better rather than worse. Consequently, simplify by dropping a useless feature.
2018-06-25Delete support for style=margin-left attributes, which are no longer used.Ingo Schwarze
2018-06-25Drop explicit, constant style=margin-left attribute on .Bf blocks.Ingo Schwarze
Since <div> uses HTML_NLAROUND, it is no longer needed.
2018-06-25Delete support for style=width attributes, which are no longer used.Ingo Schwarze
2018-06-25Do not write <colgroup> elements. Their only purpose is to enforceIngo Schwarze
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.
2018-06-25Ignore author-specified indentation for .RS; it harms responsiveIngo Schwarze
design. Use the existing @media-dependent indent instead. This removes the last style= attribute from man(7) output.
2018-06-25Delete support for the style=text-indent attribute, which is no longer used.Ingo Schwarze
2018-06-25For -man -Thtml, ignore author-specified .HP widths because theyIngo Schwarze
harm responsive design; use @media-dependent defaults instead.
2018-06-18Revert previous: style=height is still used by roff_html.c, and itIngo Schwarze
doesn't actually harm responsive design, so keep it for now. Bug reported in de.comp.os.unix.bsd via naddy@, thanks.
2018-06-10delete support for the HTML style=height property, which is no longer usedIngo Schwarze
2018-06-10In HTML output, for lists that have an -indent argument, just useIngo Schwarze
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.
2018-06-10When formatting man(7) documents that do not contain .SH macrosIngo Schwarze
with -Tps or -Tpdf, do not squeeze the whole text beyond the right margin. Bug reported by Will Backman during BSDCan.
2018-05-29Remove redundant value= attributes from option elements,Ingo Schwarze
and use type=search rather than type=text for the input element because it tends to better support autocompletion. Both suggested by John Gardner <gardnerjohng at gmail dot com>.
2018-05-29Delete support for the print_otag(sw) * and - modifiers,Ingo Schwarze
which are no longer used because we write fewer style= attributes.
2018-05-29Ignore author-specified -width arguments for -tag and -hang listsIngo Schwarze
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.
2018-05-28John Gardner tells me that among frontend developers, gratuitous useIngo Schwarze
of double selectors like "element.class" is considered poor style. When doing selection mainly by elements is not appropriate because most elements require several different styles, exclusively selecting by class is less cumbersome, more concise, and more flexible. So drop the elements from the selectors, except where they are required for disambiguation and except where they add clarity due to the presence of child selectors.
2018-05-28URL-fragment strings can only contain certain characters.Ingo Schwarze
Fixing HTML syntax violations e.g. in pf.conf(5) and ifconfig(1) reported by Anton Lazarov <lists at wrant dot com>.
2018-05-26Start with baby steps towards responsive design:Ingo Schwarze
Use a @media width query to select a set of default indentations. Suggested by John Gardner <gardnerjohng at gmail dot com>.
2018-05-26Use em units rather than ex units for horizontal lengths.Ingo Schwarze
John Gardner and others tell me it produces more predictable results and is generally considered better style. Also use 0em instead of 0ex, in general.
2018-05-25Do not write duplicate id= attributes, they violate HTML syntax.Ingo Schwarze
Append suffixes for disambiguation. Issue first reported by Jakub Klinkovsky <j dot l dot k at gmx dot com> (Arch Linux).
2018-05-21Use <span> for .Ms rather than <b>; discussed with John Gardner.Ingo Schwarze
2018-05-21Use <span> for .Ad rather than <i>; also suggested by John Gardner.Ingo Schwarze
2018-05-20Use <span> rather than abusing <i> for .Pa;Ingo Schwarze
suggested by John Gardner <gardnerjohng at gmail dot com>.
2018-05-20various minor improvementsIngo Schwarze
2018-05-20Protect against malicious manual pages containing .ll requests withIngo Schwarze
excessive arguments: apply the same cutoff as for the -O width= command line argument. While here, also place some assertions at strategical places to prevent excessive indentations from being printed in case of bugs. In the past, we had more than one bug that caused mandoc to print effectively infinite output, filling up people's /tmp/ file system, which is not funny. We cannot prevent bugs from crashing the program, but we can at least make filling up the disk less likely. Triggered by a remark from sthen@ on source-changes@.
2018-05-18In a nutshell, all mobile browsers are broken.Ingo Schwarze
By default, no matter the physical screen size, they use a fixed viewport width of about 1000px, then scale down the rendered page to make that huge viewport fit on the physical screen. That results in poor rendering for bad websites which assume a large fixed-size viewport (typically requiring zooming in to be able to actually read any text), but in atrocious rendering for good websites that make no assumption about the screen size (unreadably small text in the top left corner, most of the screen empty). A standard way to disable that insane behaviour and just render normally on the actual physical screen size does not exist. The closest thing is the CSS3 Device Adaptation Module Level 1 https://drafts.csswg.org/css-device-adapt/ but https://caniuse.com/#feat=css-deviceadaptation tells me that basically no browser implements it, not even on mobile. The next closest thing is the HTML meta viewport element - even though the problem has nothing to do with HTML and is purely a CSS issue. Standardization is not even planned for that one: * HTML 5.2 mentions it in passing without specifying it: https://www.w3.org/TR/html/document-metadata.html#the-meta-element * The Web Hypertext Application Technology Working Group provides very incomplete information: https://wiki.whatwg.org/wiki/MetaExtensions * CSS3 Device Adaptation Module Level 1 already wants to deprecate it, explaining mostly how to migrate *away* from it to some castle in the sky that no browser implements: https://drafts.csswg.org/css-device-adapt/#viewport-meta While i strongly believe in sticking to well-established standards, in the absence of standards and with atrocious behaviour being universal, there appears to be no alternative to using whatever works. The meta viewport element appears to be the only way to make real-world mobile browsers decently render any HTML page that does not have a fixed-width layout of 1000px. So use it, grudgingly. Originally suggested by xcv at dr dot com. Direction supported by espie@.
2018-05-14Some broken terminal emulators (e.g. sakura) do the equivalentIngo Schwarze
of "stty cols 0". Ignore that insanity rather than setting conf.output.width to an invalid value and embarking on infinite loops. Issue reported by Jesper Wallin <jesper at ifconfig dot se>, thanks!
2018-05-09Fix a long-standing issue:Ingo Schwarze
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.
2018-05-08Eliminate the class=It-* attributes.Ingo Schwarze
Cleaner HTML, more idiomatic CSS, and minus 30 lines of C code. Suggested by John Gardner <gardnerjohng at gmail dot com>.
2018-05-08Switch the emitted HTML element from <b> to <code> for the fixedIngo Schwarze
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>.
2018-05-03Minor correction: we render HTML character references hexadecimal,Ingo Schwarze
not decimal; bentley@ changed that in html.c on July 14, 2017.
2018-05-01skip printing the embedded style sheet if an external style is referencedIngo Schwarze
2018-04-29Simpler description of output formats, shortening the manual page by 15 lines.Ingo Schwarze
Avoid the double redirection from -Tutf8 via -Tlocale to -Tascii. Add LC_CTYPE to the ENVIRONMENT section. While here, also correct a few inaccuracies and tweak some wordings. Triggered by a question from Laura Morales <lauretas at mail dot com>.
2018-04-24replace my vague and idiosyncratic term "selflink"Ingo Schwarze
with the clearer and more usual "permalink"; suggested by John Gardner <gardnerjohng at gmail dot com>
2018-04-19Tweak the description of -l:Ingo Schwarze
Avoid the misunderstanding that the essential purpose of -l is similar to the purpose of the -a option in mandoc(1), which is not the point: the fact that -l implies -a is merely a minor detail. The point of -l is to make man(1) behave like mandoc(1). Move the mention of -a to the end to de-emphasize it. Nate Bargmann reported that this seriously confused him, and i can see why.
2018-04-19Compatibility with man-db:Ingo Schwarze
In page name mode (= man(1) default mode), also try to interpret names containing slashes as absolute or relative file names. Missing feature reported by Nate Bargmann on <groff at gnu dot org>, and the man-db maintainer Colin Watson <cjwatson at debian dot org> explained to me how this is supposed to work.
2018-04-13Use TIOCGWINSZ to reduce the default -Owidth during interactive useIngo Schwarze
on terminals narrower than 79 columns and the default -Oindent on terminals narrower than 66 columns. Requested by and feedback from pirofti@; mpi@ and juanfra@ also like the general direction.
2018-04-13Make sure that mandoc only goes into UTF-8 mode if the user reallyIngo Schwarze
selected UTF-8, not some other multibyte locale. This obviously makes no difference on OpenBSD but improves portability. Issue reported by <Nakayama at NetBSD> via wiz@.
2018-04-13preserve comments before .Dd and .TH (typically Copyright and license)Ingo Schwarze
in full HTML output, but not with -Ofragment, e.g. in man.cgi(8); suggested by Thomas Klausner <wiz at NetBSD>
2018-04-11preserve comments before .Dd when converting mdoc(7) to man(7)Ingo Schwarze
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>
2018-04-10Two new low-level roff(7) features:Ingo Schwarze
* .nr optional third argument (auto-increment step size) * \n+ and \n- numerical register auto-increment and -decrement bentley@ reported on Dec 9, 2013 that lang/sbcl(1) uses these.
2018-04-09When accessing an undefined number register, define it to be zero, likeIngo Schwarze
the previous commit for strings and macros, only technically simpler. Desired behaviour also mentioned by Werner Lemberg in 2011. This diff adds functionality but is -21 +19 LOC. :-)
2018-04-09Using an undefined string or macro will cause it to be defined as empty.Ingo Schwarze
Observed by Werner Lemberg on Nov 14, 2011 and rotting on my TODO list ever since.
2018-04-05Do not use a non-portable .R man(7) macro. Neither groff nor theIngo Schwarze
heirloom-doctools support it. Work around the gap by using .BR with an empty first argument. This was noticed more than once in the past, but i always forgot to fix it.
2018-04-05use the portable \(lq and \(rq internally rather than \(Lq and \(RqIngo Schwarze
2018-04-05For .Do/.Dq, use the documented and portable \(lq and \(rqIngo Schwarze
character escape sequences rather than the undocumented and non-portable \(Lq and \(Rq. Bug reported by Tim L <darkxst at github> via Thomas Klausner <wiz at NetBSD>; see https://github.com/nih-at/libzip/pull/42
2018-03-16Ouch, fix previous: In the edge case of a single-character stringIngo Schwarze
containing nothing but a single hyphen, the pointer got incremented twice at one point, causing a read overrun found by naddy@.
2018-03-16Style message about bad input encoding of em-dashes as -- instead of \(em.Ingo Schwarze
Suggested by Thomas Klausner <wiz at NetBSD>; discussed with jmc@.
2018-02-23After opening a file with gzdopen(3), we have to call gzclose(3) orIngo Schwarze
we leak memory internally used by zlib to keep compression state. Bug reported by Wolfgang Mueller <vehk at vehk dot de> who also provided an incomplete patch, part of which i'm using in this commit.