summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
AgeCommit message (Collapse)Author
2011-10-16Remove a bunch of useless assignments,Ingo Schwarze
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@.
2011-10-09Always print <table> column widths in -T[x]html;Ingo Schwarze
if desired, they can be overridden in the CSS file. Suggested by kristaps@, and i always like to simplify code.
2011-10-09A bit more precision and nicer wording in the descriptionsIngo Schwarze
of -Ofragment and -Tman; using input from jmc@ and kristaps@.
2011-10-09Sync to version 1.12.0; all code by kristaps@:Ingo Schwarze
Implement .Rv in -Tman. Let -man -Tman work a bit like cat(1). Add the -Ofragment option to -T[x]html. Minor fixes in -T[x]html. Lots of apropos(1) and -Tman code cleanup.
2011-10-061) Import the future apropos(1) replacement written by kristaps@.Ingo Schwarze
2) Link both that one and mandocdb(8) into the mandoc(1) binary. 3) Install a /usr/bin/mandocdb hardlink and the mandocdb(8) manual. Do not replace /usr/bin/apropos by a hardlink yet because it is not ready for production, and ports integration is still missing. Development will be done in the tree, even the user interfaces are still subject to change at this point. Both jmc@ and deraadt@ agree with getting this in.
2011-09-30implement .Ap .Bd .Bo .Bq .D1 .Ic .Lp .Oo .Pf .Po .Ss .Sx .Sy .br .spIngo Schwarze
implement .Bl -bullet add more information to the .TH line escape dots at the beginnings of lines add trailing newline character at the end of the file do not misinterpret the ROOT block as .Ap
2011-09-26retain alphabetical order for the -Toutput list, and use a widthJason McIntyre
specifier that makes it look nicer; ok schwarze kristaps
2011-09-21As noticed by kristaps@, when breaking an overflowing line,Ingo Schwarze
forget about pending whitespace (vbl), or the next line would be misaligned and potentially too long; but i'm fixing this in a simpler way than he proposed. Also remove the kludges in .HP that compensated for this bug.
2011-09-20groff compatibility for the rendering of foreign manuals:Ingo Schwarze
support .Lb -libdwarf and update .Lb -libelf after Werner Lemberg committed a patch by Joseph Koshy
2011-09-20Major rewrite of the horizontal spacing of tablesIngo Schwarze
to work both with and without frames and rulers. Started during BSDCan 2011 in Ottawa, finished during s2k11 in Ljubljana. ok kristaps@
2011-09-20Using user-defined macros, surprisingly, it is possibleIngo Schwarze
to have *next*-line head arguments on the *same* input line. So .TP must not assume that a head argument with a matching input line number is a same-line argument (and access a NULL pointer). Bug found and fix tested by kristaps@ with groff_hdtbl(7).
2011-09-20do not assign pointers to literal stringsIngo Schwarze
to variables that might be changed; from kristaps@
2011-09-20When advancing the left margin, .RS also needs to reset the right marginIngo Schwarze
to the default and check that the left does not outgrow the right one. Otherwise, the (rmargin >= offset) assertion fails in term_flushln(). Bug found and fix tested by kristaps@ with NetBSD slapo-retcode(5).
2011-09-20Sync print_mdoc_head to print_man_head;Ingo Schwarze
this was forgotten after man_term.c rev. 1.25 on March 2, 2010. The benefit is a sane page header line when .Dt is very long. Reminded by Thomas Klausner <wiz at NetBSD>, thanks.
2011-09-19Remove the terminal frontend flag TERMP_NOLPAD.Ingo Schwarze
In columnated contexts (.Bl -column, .Bl -tag, .IP, .TP, .HP etc.), do not pad after writing a column. Instead, always pad before writing content. In itself, this change avoids: - writing trailing whitespace in some situations - with .fi/.nf in .HP, breaking lines that were already padded It allows several bugfixes included in this patch: - Do not count backspace as a character with positive width. - Set up proper indentation when encountering .fi/.nf in .HP. - Adjust the .HP indentation width to what groff does. - Never unlimit the right margin unless in the final column. This reduces the groff/mandoc-differences in base by nearly 20%, from 89k to 72k lines of diffs. ok kristaps@
2011-09-19Breaking the line at a hyphen is only allowed if the hyphenIngo Schwarze
is both preceded and followed by an alphabetic character. This fixes about a dozen places in base.
2011-09-18Fix another regression introduced in 1.11.7:Ingo Schwarze
If a string is defined in terms of itself, the REPARSE_LIMIT in read.c used to break the cycle. This no longer works since all the work is now done in the function roff_res(), looping indefinitely. Make this loop finite by arbitrarily limiting the number of times one string may be expanded; when that limit is reached, leave the remaining string references unexpanded. This changes behaviour compared to 1.11.5, where the whole line would have been dropped. The new behaviour is better because it loses less information. We don't want to imitate groff-1.20.1 behaviour anyway because groff aborts parsing of the whole file.
2011-09-18fix a regression introduced in 1.11.7:Ingo Schwarze
even a breakable hyphen may be bold or underlined With this fix, 1.11.7 reduces the groff/mandoc differences in base by about 10% (100k -> 90k lines of diffs) with respect to 1.11.5.
2011-09-18sync to version 1.11.7 from kristaps@Ingo Schwarze
main new feature: support the roff(7) .tr request plus various bugfixes and some refactoring regressions are so minor that it's better to get this in and fix them in the tree
2011-09-18sync to version 1.11.5:Ingo Schwarze
adding an implementation of the eqn(7) language by kristaps@ So far, only .EQ/.EN blocks are handled, in-line equations are not, and rendering is not yet very pretty, but the parser is fairly complete.
2011-09-17Initial, incomplete support for -TmanIngo Schwarze
to convert mdoc(7) documents to the man(7) language. This is work in progress and will be developed in tree. It does already handle the cat(1) manual, but will hardly handle all your fancy manuals yet. go ahead kristaps@ jmc@ millert@ deraadt@
2011-09-17Change the mandocdb(8) interface to better agree with makewhatis(8);Ingo Schwarze
in particular, allow recursing multiple directories and create multiple databases in one call. This commit includes some reorganization, and exposing mandoc_strdup as a utility function in mandoc.h. written by kristaps@
2011-09-16after some thought, i think it unlikely that we will need to specifyJason McIntyre
a revision number for ISO 8601; in addition, the revision number makes the text unwieldy when discussing the standard in a casual manner. therefore change the macro from -8601-4 to simply -8601, which will output "ISO 8601". i'll get kristaps or ingo to make the change upstream to mandoc. discussed with/ok millert
2011-09-09add an St macro for ISO 8601:2004;Jason McIntyre
ok kristaps (who will update the mandoc repo)
2011-07-31Actually, by merging individual patches, we are already in syncIngo Schwarze
with release 1.11.4. Correct this for release.
2011-07-31Workaround to prevent misrendering of \*(-- as "O-" in pod2man(1)-Ingo Schwarze
generated manuals; this fixes more than 500 manuals in base alone. As a real fix, .tr will be supported after unlock. OK kristaps@ to put in the workaround for now
2011-07-24AT&T recently released a new version of UNIX (System III).Ingo Schwarze
This will soon be needed for the HISTORY of string(3).
2011-07-14Import mandocdb(8) from bsd.lv, coded by kristaps@, for in-tree development.Ingo Schwarze
Will need adjustments to user interface and functionality, and will be linked into the mandoc(1) binary and hardlinked from /usr/libexec/mandocdb to /usr/bin/mandoc when ready for general consumption. The ultimate goal is to call it from OpenBSD::Makewhatis to replace OpenBSD::Makewhatis::Unformated with enhanced functionality.
2011-07-14Revert build system complication, for two reasons:Ingo Schwarze
(1) Simply linking the future utilities (mandoc, mandocdb, apropos, whatis) into a common binary inspecting its process name to find out what it should do (as suggested by deraadt@) does not require the large code changes i feared at first, but can be done in a few lines. (2) As reported by dhill@, we already had the first build system problem before even enabling this: Building without "make obj", the mandoc binary name clashes with the new mandoc subdirectory, breaking the build. Please use "cvs up -dP" when updating!
2011-07-10The mandoc directory will soon grow subdirs mandocdb/ and apropos/Ingo Schwarze
and these new utilities will use the mandoc libraries, so prepare the build system to build the parsing and utility libraries separately from the main program and formatters. Not yet linked to the build. No objections from deraadt@ on adding directories for this purpose.
2011-07-08clean up .HP, .IP, .TP, .nf, and \c handling in -T[x]html;Ingo Schwarze
from kristaps@
2011-07-08simplify: there's really no need for extra code to reorderIngo Schwarze
the hash chain or an extra function for checking matches; from kristaps@
2011-07-07As .RS may nest and may contain embedded paragraphs,Ingo Schwarze
keep a stack of left margins; this fixes e.g. lynx(1). While here, clean up some code in .TP HEAD; it can only have text children, anyway. From kristaps@.
2011-07-07Fix a bogus "unknown macro" error reported in the pod2man(1) preamble:Ingo Schwarze
- Actually let roff_parse() recognize ".\}" as a cond block end request. - Do not rewrite "\}" to the zero-width space "\&" because that prevents recognition of immediately preceding macros; use normal blanks instead. - To avoid a vertical spacing regression in pod2man(1) manuals, drop one vertical spacing request just before NAME. From kristaps@.
2011-07-07Set the default way to append the next node (sibling) before, not afterIngo Schwarze
calling the post handler, such that it doesn't clobber specific decisions made in the post handler. Fixes a regression related to vertical spacing in nsd-xfer(8). Patch from kristaps@.
2011-07-05Sync to bsd.lv (all coded by kristaps@):Ingo Schwarze
- mdoc(7): fix an assertion if the first line after .Bd -column starts with a blank, and some simplifications in mdoc_argv.c - man(7): literal mode ends at .SH and .SS (bug reported by naddy@) - allow .RS/.RE blocks to nest (bug reported by dcoppa@ and gsoares@) - improve vertical spacing of man(7) blocks - roff(7): clear user-defined strings when starting a new file - correct ID tags in -T[x]html
2011-06-18Have -T[x]html print out the link target for `Lk'Ingo Schwarze
if no link title is provided. Based on a patch by Tim van der Molen, tweaked by kristaps@.
2011-05-31Minor fixes by kristaps@, based on issues reported by jmc@.Ingo Schwarze
2011-05-29Fix more regressions introduced in 1.11.3:Ingo Schwarze
Some predefined strings got changed in -Tascii mode. With this fix, they change in other output modes, but -Tascii is what matters.
2011-05-29Fix two regressions introduced in 1.11.3:Ingo Schwarze
* Do not pass integers outside the ASCII range to isprint(). * Make sure escaped characters are really printed verbatim when the escape sequence has no special meaning.
2011-05-29Merge release 1.11.3, almost all code by kristaps@:Ingo Schwarze
* Unicode output support (no Unicode input yet, though). * Refactoring: completely handle predefined strings in roff.c. - New function mandoc_escape() replaces a2roffdeco() and mandoc_special(). - Start using mandoc_getarg() in mdoc_argv.c. - Clean up parsing of delimiters in mdoc(7). * And many minor fixes and lots of cleanup.
2011-04-25As abbreviations for IEEE Std 1003.1 and its predecessors, use "POSIX.1"Ingo Schwarze
or "POSIX.2", respectively, but not "POSIX". That's closer to Open Group usage, leads to consistency in our own mandoc, and agrees with what both mandoc on other BSDs and groff-1.21 do. ok jmc@; "no objection" millert@; "no concerns" guenther@.
2011-04-24Prevent line breaks right before numbers. Groff does the same.Ingo Schwarze
OK kristaps@.
2011-04-24Closing delimiters only suppress spacing when they follow something.Ingo Schwarze
Fixing a regression introduced in bsd.lv rev. 1.105.
2011-04-24User defined macros may invoke high-level macros.Ingo Schwarze
The latter got lost due to a regression in bsd.lv rev. 1.130.
2011-04-24Merge version 1.11.1:Ingo Schwarze
Again lots of cleanup and maintenance work by kristaps@. - simplify error reporting: less function pointers, more mandoc_[v]msg - main: split document parsing out of main.c into read.c - roff, mdoc, man: improved recognition of control characters - roff: better handling of if/else stack overflows - roff: add some predefined strings for backward compatibility - mdoc, man: empty sections are not errors - mdoc: move delimiter handling to libmdoc - some header restructuring and some minor features and fixes This merge causes two minor regressions that i will fix in separate commits right afterwards.
2011-04-21Merge version 1.10.10:Ingo Schwarze
lots of cleanup and maintenance work by kristaps@. - move some main.c globals into struct curparse - move mandoc_*alloc to mandoc.h such that all code can use them - make mandoc_isdelim available to formatting frontends - dissolve mdoc_strings.c, move the code where it is used - make all error reporting functions void, their return values were useless - and various minor cleanups and fixes
2011-04-05On .de macro lines, after the new macro name, space and tab are equivalent.Ingo Schwarze
Bug reported by Tristan dot LeGuern at gmail dot com in fvwm(1). tweaks and ok kristaps@; earlier version looked good to espie@ as well
2011-03-21This file was forgotten when importing the foundation for eqn(7) support.Ingo Schwarze
Written by kristaps@. Sorry, and thanks to jmc@ for noticing so quickly.
2011-03-20Import the foundation for eqn(7) support.Ingo Schwarze
Written by kristaps@. For now, i'm adding one line to each of the four frontends to just pass the input text through to the output, not yet interpreting any of then eqn keywords.