summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2010-10-16Do not abort() on tbl errors, reduce the risk that tbl stuff kills a build,Ingo Schwarze
and provide more useful tbl error messages in a non-intrusive way.
2010-10-16Support tbl(1) code embedded into mdoc(7) input files.Ingo Schwarze
Very similar to what i have done in man(7) yesterday. Allows to build cpu(4) on HPPA, wi(4), and phantasia(6). Now we are able to build all tbl code in base.
2010-10-15Allow blank lines and ignore comments in tbl data.Ingo Schwarze
This finally allows terminfo(5) to build. Now we can build all man(7)-tbl(1) in base without loss of information, though some still look ugly.
2010-10-15For now, parse and ignore minimal column width specifications.Ingo Schwarze
First step to get terminfo(5) to build.
2010-10-15Do not crash on spanned headings.Ingo Schwarze
This doesn't give us nice column widths yet with spanned headings, but it helps mkhybrid(8) to survive the build and produce complete output. "move forward" deraadt@
2010-10-15Move tbl width calculation from plain strlen to mandoc terminal widthIngo Schwarze
calculation routines. This gives us mostly sane table column widths. "move forward" deraadt@
2010-10-15Move tbl output from plain stdio to mandoc terminal output routines.Ingo Schwarze
This fixes (1) all escape sequences and (2) some aspects of indentation. Table column widths are still way off, though. "move forward" deraadt@
2010-10-15Minimal glue to integrate tbl into the mandoc man(7) parser and formatter.Ingo Schwarze
The output dosn't look nice yet, escape handling is still missing, but will follow soon. "move forward aggressively :-)" deraadt@
2010-10-15Import tbl parser and renderer written by kristaps@.Ingo Schwarze
Unchanged code from bsd.lv release 0.1.5, but without the main program. Not yet linked to the build; next commit will integrate it into mandoc.
2010-10-02style cleanup, no functional change:Ingo Schwarze
* make the initial maxvis/mmax calculation easier to understand * where real, non-indexing casts happen, make them explicit * avoid a few lint warnings that can easily be fixed * remove one needless LINTED comment "I like this" kristaps@
2010-10-01* need a space before .No even if it starts with a closing delimiterIngo Schwarze
* 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@
2010-09-27Merge the last bits of 1.10.6 (released today), most were already in:Ingo Schwarze
* ignore double-.Pp * ignore .Pp before .Bd and .Bl (unless -compact in specified) * avoid double blank line upon .Pp, .br and friends in literal context * cast enums to int when passing them to exit(3) to please lint(1) While merging, fix a regression introduced by kristaps@: Outside literal mode, double blank lines must both be printed. To achieve this again after kristaps@ improvements in 1.10.6, treat such blank lines as .sp (instead of .Pp as in 1.10.5) and drop .Pp before .sp just like dropping .Pp before .Pp.
2010-09-26new sentence, new line;Jason McIntyre
2010-09-26If an explicit scope is still open at the end of an input file,Ingo Schwarze
report an ERROR: We can still render the page by just closing the open scope, but it is likely that information will be missing or document structure mangled. Before, man(7) only reported a WARNING (which is dangerous because we cannot be sure rendering is correct) and mdoc(7) ran into FATAL (which is too drastic, there is no reason not to show what we have). While here, add a few explicit casts to appease lint. "looks good" kristaps@
2010-09-26sync to bsd.lv:Ingo Schwarze
do not talk about \s, it is ignored anyway do not .Xr groff(1) any longer, just talk about GNU troff because in the long run, groff may not even be installed
2010-09-26consolidate all enclosure opening and closing functionsIngo Schwarze
to help code comprehension and reduce code size also remove redundant TERMP_NOSPACE here and there from kristaps@
2010-09-26no punctuation after .%* outside .RsIngo Schwarze
in .Rs, mark full stops after .%* as end of a sentence from kristaps@
2010-09-26add a "mips64" architecture; requested by/ok miodJason McIntyre
2010-09-23When the HEAD of an .Nm block in the SYNOPSIS might be widerIngo Schwarze
than the column containing it, the TERMP_HANG flag is required, but avoid the flag when we know that the HEAD is shorter, because in that case, the flag might ruin the alignment. Problem originally reported by jmc@, who also spotted a regression in an earlier version of this patch. "feel free to commit" kristaps@
2010-09-23Count trailing escaped blanks correctly;Ingo Schwarze
those ruined the alignment of columns. Tested by jmc@, and kristaps@ agrees with the direction.
2010-09-21When calculating string lengths, resolve escape sequences and useIngo Schwarze
their actual lengths. Will improve vertical alignment in some uncommon situations, for example when escape sequences occur in list or column width strings or in .Nm block arguments in the SYNOPSIS. From kristaps@.
2010-09-20remove remaining pod2man escapes, mandoc now uses the standard preamble;Ingo Schwarze
from kristaps@
2010-09-20Format multiple authors (.%A) in the same way as groff:Ingo Schwarze
Two authors with "and", but without a comma. Three or more with commata, and an "and" before the last one. From kristaps@.
2010-09-20Make .Pp .Lp .br not FATAL when having arguments;Ingo Schwarze
From kristaps@
2010-09-13Parse and ignore the \k, \o, \w, and \z roff escapes, and recursivelyIngo Schwarze
ignore embedded escapes and mathematical roff subexpressions. In roff copy mode, resolve "\\" to '\'. Allow ".xx\}" where xx is a macro to close roff conditional scope. Mandoc now handles the special character definitions in the pod2man(1) preamble, so remove the explicit redefinitions in chars.c/chars.in. From kristaps@. I have checked that this causes no relevant change to the Perl manuals. The only change introduced is that some non-ASCII characters rendered incorrectly before are now rendered incorrectly in a different way. For example, e accent aigu was "e", now is "e'" and c cedille was "c", now is "c,".
2010-09-13Prevent .Pp and .Lp from looping endlessly on punctuation.Ingo Schwarze
Fix for .Pp from kristaps@, i applied the same to .Lp. Bug reported by espie@.
2010-09-06fix an off by one found by parfaitJonathan Gray
ok schwarze@ and kristaps
2010-08-26sys/param.h is for kernel interface programs.Theo de Raadt
sys/types.h is the file you want to include.
2010-08-21Backout previous.Ingo Schwarze
As Kristaps found out, i was wrong: .Bl -column phrases do not ignore spacing rules for trailing punctuation in general. In particular, - the rightmost column of a column list is unaffected - columns terminated by the .Ta macro instead of a tab are unaffected - columns ending in a blank are unaffected Spacing rules for trailing punctuation are only ignored when the tab follows the punctuation immediately, without a blank in between, because then the combination of punctuation and tab is treated by roff as a word, and the punctuation is not recognized as isolated. The reason this doesn't work in mandoc is that in the special case of .Bl -column (not in general!), mandoc treats tabs as word delimiters. We either need to solve this differently, or call it a bug in roff.
2010-08-20Centralize handling of literal tabs in term_flushln() in one place,Ingo Schwarze
making the code simpler and easier to understand. No functional change.
2010-08-20When a column contains trailing spaces, calculate the paddingIngo Schwarze
to the start of the next column correctly. Fixing a problem found by jmc@ in sysctl(3), reminded by kettenis@.
2010-08-20.Bl -column phrases ignore spacing rules for trailing punctuationIngo Schwarze
and render it just like normal text. Minimal fix of a formatting bug in operator(7) reported by ray@.
2010-08-20fix previous: when bailing out due to -Wstop,Ingo Schwarze
skip output functions, but not *_endparse; problem reported by kristaps@
2010-08-20Implement a simple, consistent user interface for error handling.Ingo Schwarze
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.
2010-08-18Remove the standard pod2man \*(C+ pre-predefined string ("C++").Ingo Schwarze
It is always defined in the preamble using .ds when used in manuals. Since we now support .ds, it is no longer necessary to provide it. Triggered by a bug report from Thomas Jeunet, patch by kristaps@.
2010-08-18Ignore \h (local horizontal motion) and \v (local vertical motion) escapesIngo Schwarze
just in the same way as \s (font size) escapes, and handle \s escapes not having an explicit plus or minus sign. This fixes the very ugly rendering of "C++" in gcc(1). Reported by Thomas Jeunet, fixed by kristaps@.
2010-08-18Correctly print .Lk arguments in -Tascii.Ingo Schwarze
Issue reported by Aldis Berzoja, fix by kristaps@.
2010-08-18Remove mandoc(1) compatibility notes that are no longer relevant;Ingo Schwarze
from kristaps@.
2010-08-18Turn the non-trivial PS_GROWBUF macro into a function.Ingo Schwarze
Don't use MAX, it doesn't exist in the default namespace on Solaris. From Joerg Sonnenberger, with a critical fix by kristaps@.
2010-08-18Simplify and sync the code and comments for copying the macro nameIngo Schwarze
in man_pmacro() and mdoc_pmacro(). In particular, no need to use isgraph(3) here, that has already been done in main.c. Joint work by Kristaps and myself, ok kristaps@.
2010-08-18Use isascii(3) to make sure we really throw away non-ASCII characters,Ingo Schwarze
because isgraph(3) returns true for some eight-bit characters. ok kristaps@
2010-08-07Groff allows the initial macro on a line to be delimited by a spaceIngo Schwarze
of by a tab; so allow the tab in mandoc, too. Bug found by me, fix by kristaps@, "sure" deraadt@.
2010-08-07In -Thtml output, preserve blank lines at the end of .Bd -literal.Ingo Schwarze
Patch from kristaps@, analoguous to mdoc_term.c rev. 1.100. With permission from deraadt@ to still fix bugs in mandoc.
2010-08-04In .Bd -literal, break the output line after the last element of eachIngo Schwarze
input line, not after the first element. Since free-form text lines only have a single element in literal mode, this is only relevant for macro lines inside literal displays, and only for those containing more than one macro. Fixes e.g. awk(1) and boot_config(8). Note this fix differs from what kristaps@ committed to bsd.lv because those changes introduce regressions with respect to blank lines in literal mode. With permission from deraadt@ to still fix bugs in mandoc.
2010-08-01Move the new mdoc(7) manual written by kristaps@, replacing the old oneIngo Schwarze
which had much less information, such that the new one gets installed. No change to the build system required, no text change in this commit. Doing the big move early even though a few more improvements will follow. The duplicate information in mdoc.samples(7) will be cleaned up post-release. ok jmc@, and kristaps@ agreed with the plan, too
2010-08-01Sync to bsd.lv:Ingo Schwarze
State that we parse and ignore \s and \m font size and colour control sequences, and remove the detailed, irrelevant documentation.
2010-07-31Correct Copyright lines in the rarely touched files:Ingo Schwarze
* add missing years (only where substantial changes were committed) * update Kristaps' email address in the remaining places No code changes.
2010-07-31Major cleanup (but there is still more to come):Ingo Schwarze
* rewrite .An, .Bd, .Bk, .Bl, .Ex descriptions * correct "parsable" to "parsed" * and various formatting and wording tweaks This commit includes a patch from kristaps@ explaining empty .Dd. Feedback and OK jmc@ and kristaps@.
2010-07-31Merge bsd.lv version 1.10.5: last larger batch of bug fixes before release.Ingo Schwarze
NOT including Kristaps' .Bd -literal changes which cause regressions. Features: * -Tpdf now fully working Bugfixes: * proper handling of quoted strings by .ds in roff(7) * allow empty .Dd * make .Sm start no-spacing after the first output word * underline .Ad * minor fixes in -Thtml and some optimisations in terminal output.
2010-07-25Sync to bsd.lv; in particular, pull in lots of bug fixes.Ingo Schwarze
new features: * support the .in macro in man(7) * support minimal PDF output * support .Sm in mdoc(7) HTML output * support .Vb and .nf in man(7) HTML output * complete the mdoc(7) manual bug fixes: * do not let mdoc(7) .Pp produce a newline before/after .Sh; reported by jmc@ * avoid double blank lines related to man(7) .sp and .br * let man(7) .nf and .fi flush the line; reported by jsg@ and naddy@ * let "\ " produce a non-breaking space; reported by deraadt@ * discard \m colour escape sequences; reported by J.C. Roberts * map undefined 1-character-escapes to the literal character itself maintenance: * express mdoc(7) arguments in terms of an enum for additional type-safety * simplify mandoc_special() and a2roffdeco() * use strcspn in term_word() in place of a manual loop * minor optimisations in the -Tps and -Thtml formatting frontends