summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/roff.h
AgeCommit message (Collapse)Author
2011-01-04Merge kristaps@' cleaner tbl integration, removing mine;Ingo Schwarze
there are still a few bugs, but fixing these will be easier in tree.
2010-11-25Implement the .de (define macro) roff instruction.Ingo Schwarze
This fixes various Xenocara manuals. Do not define your own macros in new manuals, though: this code exists purely to cope with existing and old stuff. Like in both traditional and GNU roff, the .de and .ds (define string) roff instructions share the same string table, so one can abuse strings as macros and vice versa. This implementation supports multi-line user-defined macros and user-defined macros taking up to 9 arguments. Project started near the end of p2k10, now mature for production, but there is still room for future improvements in various respects.
2010-10-26Support .so (low-level roff "switch source file"),Ingo Schwarze
needed for Xenocara and various ports. Accept only relative paths and no ascension to the parent directory as suggested by Joerg Sonnenberger; code looked over by Joerg, too. Useful discussions with various people, among others espie@.
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-06-27Full .nr nS support, unbreaking the kernel manuals.Ingo Schwarze
Kristaps coded this from scratch after reading my .nr patch; it is simpler and more powerful. Registers live in struct regset in regs.h, struct man and struct mdoc contain pointers to it. The nS register is cleared when parsing .Sh. Frontends respect the MDOC_SYNPRETTY flag set in mdoc node_alloc.
2010-05-20Support nested roff instructions:Ingo Schwarze
* allow roff_parseln() to be re-run * allow roff_parseln() to manipulate the line buffer offset * support the offset in the man and mdoc libraries * adapt .if, .ie, .el, .ig, .am* and .de* support * interpret some instructions even in conditional-negative context Coded by kristaps during the last day of the mandoc hackathon. To avoid regressions in the OpenBSD tree, commit this together with some small local additions: * detect roff block end "\}" even on macro lines * actually implement the ".if n" conditional * ignore .ds, .rm and .tr in libroff Also back my old .if/.ie/.el-handling out of libman, reverting: man.h 1.15 man.c 1.25 man_macro.c 1.15 man_validate.c 1.19 man_action.c 1.15 man_term.c 1.28 man_html.c 1.9.
2010-05-16In theory, Kristaps never intended to write a roff parser,Ingo Schwarze
but in practice, most real legacy man(7)uals are using so much low level roff that we can't really get away without at least partially handling some roff instructions. As doing this in man(7) only has become messy and as even some mdoc(7) pages need it, start a minimal partial roff preprocessor. As a first step, move handling of .am[i], .de[i] and .ig there. Do not use the roff preprocessor for new manuals! Now that we have three main parser libraries - roff, man and mdoc - each one having its own error handling is becoming messy, too. Thus, start unifying message handling in one central place, introducing a new generic function mmsg(). coded by kristaps@