aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup, no functional change:Ingo Schwarze2018-12-1215-140/+194
| | | | | No need to expose the tbl(7) syntax tree data structures everywhere. Move them to their own include file, "tbl.h", and improve comments.
* HTML syntax audit: render \p as <br/>, not as <div>.Ingo Schwarze2018-12-041-5/+2
| | | | It can occur anywhere, in particular in phrasing context.
* Restrict "vertical-align: middle;" to <td> descendants of class="tbl"Ingo Schwarze2018-12-041-3/+3
| | | | elements, we don't want that for other tables.
* Make sure all borders in a table are drawn in the same color.Ingo Schwarze2018-12-041-2/+7
| | | | | | | Required because browsers tend to have inconsistent defaults: For example, Firefox 62.0.2 sets border-color for tbody, but not for table, and Pali Rohar reports that Chrome set it for td, but not for tr or tbody. The td part is from Pali Rohar, the tbody and tr parts from me.
* During validation, drop .br before a text line starting with aIngo Schwarze2018-12-041-1/+9
| | | | | | | | | blank, rather than teaching each formatter individually to ignore the .br in such situations. That's simpler and also results in better diagnostics. Mark Harris <mark dot hsj at gmail dot com> reported that -T html got confused in particular.
* Clean up the validation of .Pp, .PP, .sp, and .br. Make sure allIngo Schwarze2018-12-0416-104/+156
| | | | | | | | | | | | | | combinations are handled, and are handled in a systematic manner. This resolves some erratic duplicate handling, handles a number of missing cases, and improves diagnostics in various respects. Move validation of .br and .sp to the roff validation module rather than doing that twice in the mdoc and man validation modules. Move the node relinking function to the roff library where it belongs. In validation functions, only look at the node itself, at previous nodes, and at descendants, not at following nodes or ancestors, such that only nodes are inspected which are already validated.
* In the validators, translate obsolete macro aliases (Lp, Ot, LP, P)Ingo Schwarze2018-12-039-45/+139
| | | | | | 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.
* Render .br as <br/>, not as an empty <div>.Ingo Schwarze2018-12-031-6/+2
| | | | | | | | | | | | | | | | | The element <br/> was already employed for many other purposes, so there is nothing wrong with using it. Also, it is safer because <br/> is permitted in phrasing content, whereas <div> is only allowed in flow content. This is the first part of the HTML syntax audit which i wanted to do for a long time. Reminded by a loosely related bug report from Mark Harris <mark dot hsj at gmail dot com>. Examples of where this caused HTML nesting syntax errors: * in man(7) code between .nf and .fi * in mdoc(7) code between .Bd -unfilled and .Ed * in mdoc(7) code between .Ql Xo and .Xc * in mdoc(7) code between .Rs and .Re
* Do not draw horizontal lines through vertical spansIngo Schwarze2018-11-291-5/+19
| | | | | which are requested in the data section rather than in the layout. Mini-feature found in misc/pfm(1).
* Now that it is better understood how borders work,Ingo Schwarze2018-11-291-72/+106
| | | | | | | | | | | rewrite tbl_hrule() in a simpler way. Fix several bugs in the process. No more special flags, just use the existing TBL_OPT_* from mandoc.h. Reduce the number of tracked rows from three to two, which is more logical: one above the line and one below is sufficient to figure out crossings. No more magic quirks, all conditions are readily comprehensible now. Add comments.
* Better handle automatic column width assignments in the presence ofIngo Schwarze2018-11-292-49/+207
| | | | | | | | | | | | | | horizontal spans, by implementing a moderately difficult iterative algoritm. The benefit is that spans containing long text no longer cause an excessive width of their starting column. The result is likely not optimal, in particular in the presence of many spans overlapping in complicated ways nor when spans interact with equalizing or maximizing colums. But i doubt the practical usefulness of making this more complicated. Issue originally reported in synaptics(4), which now looks better, by tedu@ three years ago, and reminded by Pali Rohar this summer.
* Bugfix: never set termp->enc to the ambiguous value TERMENC_LOCALE,Ingo Schwarze2018-11-281-4/+4
| | | | | | but instead set it to TERMENC_UTF8 or TERMENC_ASCII. Makes tbl(7) box drawing work under -T locale (that is, by default when LC_CTYPE is defined appropriately).
* additional check needed after the previous (box drawing) patchIngo Schwarze2018-11-281-5/+8
|
* In -T utf8 output mode, render tbl(7) borders with the UnicodeIngo Schwarze2018-11-282-161/+319
| | | | | | | | | | | | | box drawing characters, U+2500 to U+257F. Originally suggested by bentley@ four years ago, reminded this summer by Pali Rohar. Binary and decimal arithmetics are boring, so let's use some ternary arithmetics for a change. That said, some other aspects are too complicated for my liking, so this could use some polishing in the future.
* Implement tbl(7) lines in -T html output,Ingo Schwarze2018-11-262-71/+130
| | | | | | | | | | | | as far as they are on the edges of table cells rather than going through the middle of cells: * the box, doublebox, and allbox options; * the | and || layout modifiers; * and the _ and = data lines; - but not yet _ and = in individual layout and data cells. Missing feature reported by Pali dot Rohar at gmail dot com.
* When a conditional block is closed by putting "\}" on a text lineIngo Schwarze2018-11-264-11/+59
| | | | | | | | | | | | | by itself (which is somewhat unusual but not invalid; most authors use the empty macro line ".\}" instead), agree more closely with groff and do not produce a double space in the output. Quirk reported by millert@. While here, tweak the rest of the function body of roff_cond_text() to more closely match roff_cond_sub(). The subtly different handling could make people (including myself) wonder whether there is any point in being different. Testing shows there is not.
* Mark Harris pointed out that people might have doubts whether all filesIngo Schwarze2018-11-261-5/+5
| | | | | contained in the mandoc toolkit are "code and documentation", and whether this is of any consequence for licensing, so clarify.
* Place mandoc.css into the public domain.Ingo Schwarze2018-11-261-1/+6
| | | | | | | | | | | | | | | | The reason for doing this rather than using the ISC license is that i guess that in some contexts, a requirement to preserve a Copyright and license header might be inconvenient, and i really don't care at all how people use it. What matters is that they do use it, or something similar - attempts to use mandoc without any CSS are a constant source of grief and bogus bug reports because HTML without CSS doesn't look very good: the more structural and semantic and the less presentational and old-fashioned the HTML, the more so. Thanks to Mark Harris <mark dot hsj at gmail dot com> for pointing out that the permissions on this particular file were unclear.
* Simplify writing of tbl(7) cells by using the new feature of passingIngo Schwarze2018-11-261-17/+5
| | | | | | a NULL pointer for the value of a style attribute, in which case the attribute is omitted from the HTML element. Minus 12 lines of ugly and repetitive code, no functional change.
* Support more than one style attribute one the same HTML element.Ingo Schwarze2018-11-262-18/+35
| | | | | In fact, this is already required when a table uses non-default horizontal and vertical alignment in the same cell.
* Let cells containing nothing but \^ extend the cell above.Ingo Schwarze2018-11-254-30/+44
| | | | Missing feature reported by Pali dot Rohar at gmail dot com.
* In tbl(7) -T html output,Ingo Schwarze2018-11-257-80/+147
| | | | | | | | | | span cells horizontally and vertically as requested by the layout. Does not handle spans requested in the data section yet. To be able to do this, record the number of rows spanned in the first data cell (struct tbl_dat) of a vertical span. Missing feature reported by Pali dot Rohar at gmail dot com.
* HTML formatting of .IPIngo Schwarze2018-11-251-1/+7
|
* Implement horizontal and vertical alignment of tbl(7) cell contentIngo Schwarze2018-11-243-13/+39
| | | | | in -T html output. This does not handle spanned cells yet. Missing feature reported by Pali dot Rohar at gmail dot com.
* When a font escape appears in the middle of a string,Ingo Schwarze2018-11-231-2/+5
| | | | | make sure it doesn't cause output of bogus whitespace. Fixing a bug reported by Pali dot Rohar at gmail dot com.
* Correct and shorten the description of the sort order of apropos(1)Ingo Schwarze2018-11-221-20/+4
| | | | | | | | results. As a matter of fact, which manpath the page comes from does not matter in that context. That only matters for the priority of pages in man(1) mode (without -a, -f, and -k). Noticed while working on a patch from Yuri Pankov <yuripv at FreeBSD>.
* In apropos(1) output, stop sorting .Nm search results by nameIngo Schwarze2018-11-223-12/+5
| | | | | | | | | | priorities (bits). The obscure feature wasn't documented and merely confused people - for example Edward Tomasz Napierala <trasz at FreeBSD>, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227408. Smaller patch provided by Yuri Pankov <yuripv at FreeBSD>, but i'm also retiring the now unused "bits" member from struct manpage. Simplification is good.
* In -T locale (the default), -T ascii, and -T utf8 mode, provide a newIngo Schwarze2018-11-227-21/+69
| | | | | | | | | | | | | | | output option -O tag[=term] to move right to the definition of "term" when opening the manual page in a pager, effectively porting the -T html fragment name feature - https://man.openbsd.org/ksh#ulimit - to the terminal. Try: $ man -O tag uvm_sysctl $ man -O tag=ulimit ksh $ man -O tag 3 compress Feature development triggered by a question from kn@. Klemens also tested, provided feedback that resulted in improvements, and provided an OK.
* Improve POSIX compliance by making case-insensitive extendedIngo Schwarze2018-11-192-16/+34
| | | | | | | | | | | | | | | | | regular expressions the default in man(1) -k searches, also matching what the man-db package used by many Linux distributions does. Originally requested by Wolfram Schneider <wosch at FreeBSD> via Yuri Pankov <yuripv at FreeBSD>. Feedback and OK cheloha@, and no objections when shown on tech@. Thanks to cheloha@ for pointing out that POSIX requires this behaviour and for the suggestion to explicitly say that *extended* regular expressions are used here. While here, unify spelling of case-[in]sensitive, fix a typo, update the EXAMPLES, and add a STANDARDS section.
* Correctly construct empty lists in dbm_page_get().Ingo Schwarze2018-11-191-4/+4
| | | | | | | | | | Original commit message by the author of this bugfix patch, bluhm@: lstmatch() expects a list of strings separated by \0 and terminated with \0\0. In the NULL case dbm_page_get() returned only simple strings so correct processing was depending on data layout. Use an additional \0 to terminate the single string lists. Found by mandoc regress since llvm linker on amd64 arranges strings differently.
* in -man -Thtml, vertical spacing is required before .IPIngo Schwarze2018-10-251-1/+7
|
* Implement the \f(CW and \f(CR (constant width font) escape sequencesIngo Schwarze2018-10-257-8/+28
| | | | | | | | | 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 ctags(1) file format uses whitespace as a field delimiter, andIngo Schwarze2018-10-231-10/+27
| | | | | | | | | | | there is no escaping mechanism, so tags cannot contain whitespace. Consequently, we used to simply not tag macro arguments containing space characters. Instead, let's tag the first word, unless there is a proper match for that word somewhere else. For example, this makes ":tquery" work in ntpd.conf(5). Feature suggested by kn@, who also thinks the implementation looks reasonable and works in his testing.
* Input lines that are not blank but generate no output,Ingo Schwarze2018-10-231-3/+6
| | | | | | | | | | | for example lines containing nothing but "\&", are significant in no-fill mode and can be represented by blank lines inside <pre>. Fixing a bug that Pali dot Rohar at gmail dot com found in pod2man(1) output, for example Email::Address::XS(3p). While here, inside no-fill mode, there is no need to encode totally blank input lines by emulating .PP - just let them through as we are inside <pre> anyway.
* Rewrite parse_path_info() to be four lines shorter, simplify ownershipIngo Schwarze2018-10-191-47/+41
| | | | | | | | of allocated strings, do not write to the input string, and improve diagnostic output. The confusing error message "invalid arch" as a reaction to mistyping the release name was noticed by tb@, who likes the new code and message.
* update DESCRIPTION and COMPATIBILITY, mostly correcting statementsIngo Schwarze2018-10-041-19/+18
| | | | from the past that are no longer true
* Stop abusing subsections to represent the list of escape sequences;Ingo Schwarze2018-10-041-97/+103
| | | | | | instead, use .Bl -tag like everywhere else. The same was already done for requests quite some time ago. Also, consistently mark up escape sequences with .Ic, just like requests.
* When a subsection header contains no letters but only specialIngo Schwarze2018-10-041-2/+4
| | | | characters, skip the TOC entry. Issue reported by kristaps@.
* add DESCRIPTION and .Ss to the toc; suggested by espie@Ingo Schwarze2018-10-021-7/+23
|
* enable the equivalent of -O toc in man.cgi(8)Ingo Schwarze2018-10-021-2/+3
|
* Add an option -T html -O toc to add a brief table of contents nearIngo Schwarze2018-10-028-19/+56
| | | | | the top of HTML pages containing at least two non-standard sections. Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.
* Support a second argument to -O man,Ingo Schwarze2018-10-025-17/+32
| | | | | | 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.
* Render the eqn(7) "sqrt" function as U+221A in UTF-8 output.Ingo Schwarze2018-10-024-11/+8
| | | | | | This also agrees with what groff does. Suggested by an attendee of EuroBSDCon 2018 in Bucuresti. Written on the plane Bucuresti-Frankfurt returning from EuroBSDCon.
* Add missing URI encoding when writing HTTP redirects,Ingo Schwarze2018-10-011-5/+33
| | | | | | fixing a bug reported by <jungleboogie0 at gmail dot com> on bugs@. While here, fully validate the arch name such that we do not have to URI encode that one.
* feature suggestions from EuroBSDCon 2018Ingo Schwarze2018-09-231-1/+15
|
* Reduce excessive right padding in tagged list heads.Ingo Schwarze2018-08-271-2/+2
| | | | | | The 1.2em was an approximate equivalent of the 2n traditionally used for terminal display, but it is much too wide for HTML rendering. Issue reported by mikeb@.
* Support nesting of elements with next-line scope.Ingo Schwarze2018-08-264-60/+65
| | | | For example, ksh93(1) needs this for .B\n.SM.
* Rudimentary implementation of the roff(7) .char (output glyphIngo Schwarze2018-08-2512-13/+167
| | | | | | | | | definition) request, used for example by groff_hdtbl(7). This simplistic implementation may interact incorrectly with the .tr (input character translation) request. But come on, you are not only using .char *and* .tr, but you do so with respect to the same character in the same manual page?
* If man(7) next-line scope is open and the line ends with \c,Ingo Schwarze2018-08-253-21/+60
| | | | the scope remains open. Needed for example for groff_man(7).
* Rudimentary implementation of the roff(7) .while request.Ingo Schwarze2018-08-2424-214/+489
| | | | | | | | | | | Needed for example by groff_hdtbl(7). There are two limitations: It does not support nested .while requests yet, and each .while loop must start and end in the same scope. The roff_parseln() return codes are now more flexible and allow OR'ing options.