summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* In literal context, do not generate output line breaks between macroschwarze2011-01-161-14/+6
| | | | | | arguments. This fixes a long-standing bug reported repeatedly, in particular by naddy@ and brad@. Fix by kristaps@, minus one regression caught by my test suite.
* If the first character of a free-form text input line is whitespace,schwarze2011-01-161-1/+10
| | | | | then it will start a new output line; from kristaps@.
* Remove an unused variable, and use int for array indices (not size_t);schwarze2011-01-091-5/+3
| | | | found by lint(1), fixed by kristaps@, no functional change.
* Merge kristaps@' cleaner tbl integration, removing mine;schwarze2011-01-041-7/+6
| | | | there are still a few bugs, but fixing these will be easier in tree.
* Multiple man(7) .IP and .TP fixes started during p2k10:schwarze2011-01-041-22/+10
| | | | | | | | | | | | | | | | | | | | | Affecting both -Tascii and -Thtml: * The .IP HEAD uses the second argument as the width, not the last one. * Only print the first .IP HEAD argument, not all but the last. Affecting only -Tascii: * The .IP and .TP HEADs must be printed without literal mode, but literal mode must be restored afterwards. * After the .IP and .TP bodies, we only want term_newln(), not term_flushln(), or we would get two blank lines in literal mode. * The .TP HEAD does not use TWOSPACE, just like .IP doesn't either. * In literal mode, clear NOLPAD after each line, or subsequent lines would get no indentation whatsoever. Affecting only -Thtml: * Only print next-line .TP children, instead of all but the first. OK kristaps@ on the -Tascii part; and: "Can you work this into man_html.c, too?"
* Yet another batch of -Thtml polishing from kristaps@:schwarze2010-12-251-29/+24
| | | | | | | | In particular, use <SMALL> for .SM and <CODE> for .Dl. Use <B> for bold and <I> for italic in general. Also call this mandoc 1.10.8 now, as it is functionally equivalent, even though one one set of refactoring patches has not been merged yet because it conflicts with our tbl(1) handling.
* Use yet more standard HTML tags,schwarze2010-12-221-97/+79
| | | | | this time some more <P> and <TABLE> instead of <DIV>. From kristaps@.
* Significant improvements to -Thtml by kristaps@:schwarze2010-12-191-96/+32
| | | | | | Use less <DIV>, use more <H1>, <H2>, <P>, <BR>, <PRE>, <UL>, <OL>, <DL> etc. Triggered by input from Will Backman. Remove CSS2 note in mandoc.1, which is no longer true.
* Remove `i' and `r' macro handlers. These macros, originally part of theschwarze2010-12-191-3/+1
| | | | | | | me package, aren't recognised by "groff -mandoc" so we don't need to do so either. Besides, they are not used in base or Xenocara, and only at two or three places in one single port, which are probably typos. From kristaps@.
* Back out my .ft implementation for -Thtml.schwarze2010-12-071-46/+2
| | | | | | Kristaps says it is broken and cannot work, because HTML needs a block structure which .ft does not provide. Thus, let us just ignore .ft in HTML output.
* Never print .P, .PP, and .LP header content.schwarze2010-12-061-2/+5
| | | | From kristaps@.
* Now that we have proper .de support in the roff(7) library,schwarze2010-11-291-21/+5
| | | | | it is time to remove the .Sp, .Vb, and .Ve kludge that was added to the man(7) library to build Perl manuals.
* Implement the roff .ft (change font) request for man(7).schwarze2010-11-291-1/+46
| | | | | | | | Of course, we don't want to encourage low-level physical markup, but pod2man(1) writes such requests, so Perl manuals contain them, and some Xenocara and lots and lots of ports manuals use them as well. In base and Xenocara, this will reduce mandoc -Tlint ERROR noise; in ports, it will improve rendering of many manuals.
* Minimal glue to integrate tbl into the mandoc man(7) parser and formatter.schwarze2010-10-151-1/+3
| | | | | | The output dosn't look nice yet, escape handling is still missing, but will follow soon. "move forward aggressively :-)" deraadt@
* Sync to bsd.lv; in particular, pull in lots of bug fixes.schwarze2010-07-251-18/+65
| | | | | | | | | | | | | | | | | | | | | 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
* Merge release 1.10.4 (all code by kristaps@), providing four new features:schwarze2010-07-131-3/+2
| | | | | | | | | | 1) Proper .Bk support: allow output line breaks at input line breaks, but keep input lines together in the output, finally fixing synopses like aucat(1), mail(1) and tmux(1). 2) Mostly finished -Tps (PostScript) output. 3) Implement -Thtml output for .Nm blocks and .Bk -words. 4) Allow iterative interpolation of user-defined roff(7) strings. Also contains some minor bugfixes and some performance improvements.
* Full .nr nS support, unbreaking the kernel manuals.schwarze2010-06-271-2/+3
| | | | | | | | | 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.
* Merge bsd.lv release 1.10.0,schwarze2010-06-061-2/+5
| | | | | | | | | | | | | | | | which is mostly the post-hackathon release, bringing in the OpenBSD changes to bsd.lv, but which also has a few additional minor fixes: * .Lb is an in-line macro, not in_line_eoln * .Bt, .Ud now warn when discarding arguments * allow bad -man dates to flow verbatim into the front-ends - so far all reported by Ulrich Spoerlein * .Ar, .Fl and .Li starting with closing punctuation emit an empty element * empty .Li macros print nothing, but may cause spacing * proper EOS handling for .Bt, .Ex, .Rv, and .Ud. * cleanup: collapse posts_xr into posts_wtext (which is the same) * efficiency: very simple table lookup for roff.c
* Unified error and warning message system for all of mandoc,schwarze2010-05-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | featuring three message levels, as agreed during the mandoc hackathon: * FATAL parser failure, cannot produce any output from this input file: eventually, we hope to convert most of these to ERRORs. * ERROR, meaning mandoc cannot cope fully with the input syntax and will probably lose information or produce structurally garbled output; it will try to produce output anyway but exit non-zero at the end, which is eventually intended to make the ports infrastructure happy. * WARNING, meaning you should clean up the input file, but output is probably mostly OK, so this will not cause error-exit at the end. This commit is mostly just converting the old system to the new one; before the classification will become really reliable, we must check all messages. In particular, * set up a new central message string table in main.c * drop the old message string tables from man.c and mdoc.c * get rid of the piece-meal merr enums in libman and libmdoc * reduce number of error/warning functions from 16 to 6 (still a lot...) While here, handle a few problems more gracefully: * allow .Rv and .Ex to work without a prior .Nm * allow .An to ignore extra arguments * allow undeclared columns in .Bl -column Written by kristaps@.
* implement .AT and .UC; from Joerg Sonnenbergerschwarze2010-05-231-1/+2
|
* Support nested roff instructions:schwarze2010-05-201-4/+1
| | | | | | | | | | | | | | | | | | | * 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.
* In theory, Kristaps never intended to write a roff parser,schwarze2010-05-161-7/+1
| | | | | | | | | | | | | | | | | | 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@
* removed restriction on integer manual sections in -man;schwarze2010-05-151-3/+3
| | | | by kristaps@
* Implement roff conditional instructions .if .ie .el, in man(7) only for now;schwarze2010-04-251-1/+4
| | | | fixing OpenBSD::PackageName(3p) and friends for espie@.
* merge 1.9.17, keeping local patchesschwarze2010-03-261-6/+20
| | | | | | | * much improved pod2man support and low-level roff robustness * have -Tlint imply -Wall and -fstrict * use fewer macros and more enum in libman * and various bug fixes
* merge 1.9.16, keeping local patchesschwarze2010-03-251-4/+28
| | | | | | | This is mostly cleanup by kristaps@ after my rather hackish patch to tolerate the non-text macros .na, .sp, .br in next-line scope; plus some nesting issues fixed by him, all in man(7). This survived a full cd /usr/src; make man.
* Accept the non-standard macros .Sp (similar to .sp)schwarze2010-03-021-2/+5
| | | | | | | and .Vb/.Ve (similar to .nf/.fi) in man(7) mode. These are not intended to be used manually, but they allow us to properly render man(7) code autogenerated by pod2man(1), making Perl and OpenSSL happy in our tree.
* sync to release 1.9.15:schwarze2010-02-181-2/+2
| | | | | | | | | * corrected .Vt handling (spotted by Joerg Sonnenberger) * corrected .Xr argument handling (based on my patch) * removed \\ escape sequence (because it is for low-level roff only) * warn about trailing whitespace (suggested by jmc@) * -Txhtml support * and some general cleanup and doc improvements
* sync to 1.9.14: rewrite escape sequence handling:schwarze2009-12-241-33/+41
| | | | | | | | | - new function a2roffdeco - font modes (\f) only affect the current stack point - implement scaling (\s) - implement space suppression (\c) - implement non-breaking space (\~) in -Tascii - many manual improvements
* sync to 1.9.12, mostly portability and refactoring:schwarze2009-12-221-6/+12
| | | | | | | | | | | | | | | | | | | correctness/functionality: - bugfix: do not die when overstep hits the right margin - new option: -fign-escape - and various HTML features portability: - replace bzero(3) by memset(3), which is ANSI C - replace err(3)/warn(3) by perror(3)/exit(3), which is ANSI C - iuse argv[0] instead of __progname - add time.h to various files for FreeBSD compilation simplicity: - do not allocate header/footer data dynamically in *_term.c - provide and use malloc frontends that error out on failure for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/
* sync to 1.9.11: adapt printing of dates to groff conventions,schwarze2009-10-271-9/+6
| | | | | NetBSD portability fixes and some minor bugfixes and feature enhancements; also checked that my hyphenation code still works on top of this
* sync to 1.9.9, featuring:schwarze2009-10-211-0/+696
* -Thtml output mode * roff scaling units * and some minor fixes for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/