summaryrefslogtreecommitdiffstats
path: root/man_html.c
Commit message (Collapse)AuthorAgeFilesLines
* Third step towards parser unification:Ingo Schwarze2015-04-021-3/+3
| | | | | Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta. Written of the train from London to Exeter on the way to p2k15.
* Second step towards parser unification:Ingo Schwarze2015-04-021-8/+8
| | | | | | | | | Replace struct mdoc_node and struct man_node by a unified struct roff_node. To be able to use the tok member for both mdoc(7) and man(7) without defining all the macros in roff.h, sacrifice a tiny bit of type safety and make tok an int rather than an enum. Almost mechanical, no functional change. Written on the Eurostar from Bruxelles to London on the way to p2k15.
* First step towards parser unification:Ingo Schwarze2015-04-021-26/+27
| | | | | | Replace enum mdoc_type and enum man_type by a unified enum roff_type. Almost mechanical, no functional change. Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
* If an eqn(7) starts on a new input line, be sure to output whitespaceIngo Schwarze2015-03-031-0/+2
| | | | | | | in front of it. Issue found by tedu@ in glOrtho(3). There are also cases of excessive whitespace before and after equations. This patch neither fixes them nor makes them worse.
* trim trailing white space, no code change;Ingo Schwarze2015-02-101-1/+1
| | | | from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
* Have pity on the poor stack.Ingo Schwarze2015-01-301-4/+5
| | | | | Replace tail recursion by iteration when walking the syntax trees. No functional change.
* Strangely, ignoring the roff(7) .na request was implemented in the man(7)Ingo Schwarze2015-01-241-1/+0
| | | | | parser. Simplify the code by moving it into the roff(7) parser, also making it work for mdoc(7).
* some scaling unit fixes:Ingo Schwarze2014-12-231-1/+1
| | | | | - .sp with an invalid argument is .sp 1v, not .sp 0v - in man(1), trailing garbage doesn't make scaling units invalid
* fix handling of roff requests having a default scale other than "n",Ingo Schwarze2014-12-041-1/+1
| | | | | in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
* Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze2014-12-021-10/+3
| | | | | In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
* header cleanup:Ingo Schwarze2014-12-011-2/+1
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* Don't pretend we have a separate XHTML and HTML mode any more.Kristaps Dzonsons2014-09-271-1/+1
|
* Remove <p> in favour of <div class="spacer">.Kristaps Dzonsons2014-09-271-5/+6
| | | | | | | This is good because <p> is brittle: it can't appear within other block macros. This fixes a regression of the original HTML5 patch as noted by schwarze@ on the tech@ list, 14/8/2014.
* Remove last hard-coded width attribute.Kristaps Dzonsons2014-09-271-7/+0
|
* HTML5-isation: remove more alignments.Kristaps Dzonsons2014-09-271-24/+23
|
* Continue in HTML5-ing by kicking out some hard-coded alignments.Kristaps Dzonsons2014-09-271-4/+2
|
* Kick out "summary" attribute, which isn't HTML5.Kristaps Dzonsons2014-09-271-6/+4
|
* First, add space for default styling for HTML5 (non-fragment) output.Kristaps Dzonsons2014-09-271-6/+4
| | | | | This uses a <style /> block right before the <link /> for the stylesheet. Use this to kick out hardcoded header and footer table widths.
* Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.Ingo Schwarze2014-08-101-2/+0
| | | | | | Include <sys/types.h> where needed, it does not belong in config.h. Remove <stdio.h> from config.h; if it is missing somewhere, it should be added, but i cannot find a *.c file where it is missing.
* Clarity with respect to floating point handling:Ingo Schwarze2014-08-011-1/+1
| | | | | | Write double constants as double rather than integer literals. Remove useless explicit (double) cast done at one place and nowhere else. No functional change.
* Audit strlcpy(3)/strlcat(3) usage.Ingo Schwarze2014-04-231-6/+2
| | | | | | | | | | | | | * Repair three instances of silent truncation, use asprintf(3). * Change two instances of strlen(3)+malloc(3)+strlcpy(3)+strlcat(3)+... to use asprintf(3) instead to make them less error prone. * Cast the return value of four instances where the destination buffer is known to be large enough to (void). * Completely remove three useless instances of strlcpy(3)/strlcat(3). * Mark two places in -Thtml with XXX that can cause information loss and crashes but are not easy to fix, requiring design changes of some internal interfaces. * The file mandocdb.c remains to be audited.
* fix unchecked snprintf(3) in page header printing:Ingo Schwarze2014-04-201-2/+5
| | | | | the length of the title is unknown, and speed doesn't matter here, so use asprintf/free rather than a static buffer
* KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze2014-04-201-47/+22
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Implement the roff(7) .ll (line length) request.Ingo Schwarze2014-03-301-0/+1
| | | | | Found by naddy@ in the textproc/enchant(1) port. Of course, do not use this in new manuals.
* To find out whether .TP head arguments are same-line or next-line arguments,Ingo Schwarze2014-03-081-5/+10
| | | | | | | | use the MAN_LINE flag instead of the man_node line member. This is required such that user-defined macros wrapping .TP work correctly. Issue found by Havard Eidnes in Tcl_NewStringObj(3), reported via the NetBSD bug tracking system and Thomas Klausner <wiz at NetBSD>.
* Implement the .UR/.UE block (uniform resource identifier) introduced in theIngo Schwarze2013-10-171-0/+28
| | | | | | | | man-ext macros by Eric S. Raymond, enabled by default in groff_man(7). Usual disclaimer: You don't write new man(7) code, so you are not going to use these, either. Improves e.g. the bzr(1) and etherape(1) manuals. Thanks to naddy@ for bringing these to my attention.
* Cleanup naming of local variables to make the code easier on the eye:Ingo Schwarze2012-11-171-27/+27
| | | | | | | | Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta" and avoid the confusing "*m" which was sometimes this, sometimes that. No functional change. ok kristaps@ some time ago
* Minimal implementation of .EX and .EE for GNU compatibility.Ingo Schwarze2012-06-021-1/+3
| | | | | Do not use this, it is not portable and only defined in esr's man-ext. For example, sox(1) wants these macros.
* update Copyright years according to the CVS logs; no code changeIngo Schwarze2012-05-271-1/+1
|
* Add support for `OP', one of the extended man macros. This also requiresKristaps Dzonsons2012-01-031-10/+41
| | | | some man(7) changes to accomodate for the an-ext compatibility.
* Jumping out of man_unscope() for the root node is a bad ideaIngo Schwarze2011-12-041-4/+7
| | | | | | | | because that will skip root node validation, potentially entering rendering modules will NULL pointers lurking in the meta data. Instead, always validate the root node and (as suggested by joerg@) assert validity of the meta data before using it in the renderers. ok joerg@
* Don't depend on snprintf to handle NULL strings. Deal with missing date.Joerg Sonnenberger2011-11-181-2/+4
|
* Always print <table> column widths in -T[x]html;Ingo Schwarze2011-10-091-35/+17
| | | | | if desired, they can be overridden in the CSS file. Suggested by kristaps@, and i always like to simplify code.
* Add the -Ofragment option to -T[]x]html. This accomodates for embeddingKristaps Dzonsons2011-10-051-17/+16
| | | | | manual output in existing HTML or XHTML documents, e.g., when invoking mandoc from an SSI or CGI.
* Align `-offset indent' and `D1' by forcing BLOCKQUOTE to have a 5exKristaps Dzonsons2011-08-181-1/+0
| | | | | | | | | margin. This is dubious: the HTML4 spec specifically says that BLOCKQUOTE shouldn't be abused for indentation, which is exactly what we do. However, `D1' needs indentation and it's the only way to force text browsers to do so. Alternatives? Also remove the unused HALFINDENT defines while here.
* Flip on equation printing for -T[x]html.Kristaps Dzonsons2011-07-231-4/+1
|
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-2/+2
| | | | | | | these in the front-ends except for -Ttree, which will display the parsed tree. While here, fix that quoted strings aren't scanned for replacement parts.
* Considerably fix up -man -T[x]html's handling of verbatim spaces (`nf'),Kristaps Dzonsons2011-07-071-17/+19
| | | | which before were being handled erratically.
* Clean up how -man -T[x]html handles TP, IP, and HP (dd lists andKristaps Dzonsons2011-07-071-78/+14
| | | | | indented paragraph macros, respectively). This cleans up code and also cleans up the output quite a lot.
* Fix a TODO noted by schwarze@, originally by Christian Weisgerber:Kristaps Dzonsons2011-07-031-0/+2
| | | | | literal mode (`nf') is ended by SH (and, it turns out, SS as well). Noted the updated behaviour in man.7 as well.
* First fix how `sp 1' doesn't imply `1v' (it now does) and that 1Kristaps Dzonsons2011-06-291-2/+3
| | | | | | followed by non-digits, e.g. `1g', really means `1'. Next, fix some spacing issues where `sp' was invoked in -man after sections or subsections. Make sure this behaviour is mirrored in -Thtml.
* Make -T[x]html in -man also be aware of the vertical-space issues in theKristaps Dzonsons2011-06-181-4/+28
| | | | last few commits.
* Fix two TODOs with one check-in. Both of these relate to vertical spaceKristaps Dzonsons2011-06-181-1/+0
| | | | before paragraphs and/or within `RS' blocks.
* Cleanups in -T[x]html: make html_idcat() use the buffer and be calledKristaps Dzonsons2011-05-171-5/+5
| | | | | | bufcat_id(), then collapse it into a little function without so much crap. Next, make bufinit() only be called when we really need to do so, and not simply before pre/post calls.
* Clean-ups in -T[x]html: inline print_num(), as it was just a singleKristaps Dzonsons2011-05-171-1/+1
| | | | | | | | | | conditional; same for print_xmltype() and print_doctype(), same reason; make bufncat() be static, as it was only being called from html.c; have bufcat() simply call through to strlcat(). Finally, assert() whenever we truncate. Also rename buffmt() -> bufcat_fmt() to differentiate from buffmt_man et al., which do not concatenate.
* Clean up date handling,Ingo Schwarze2011-03-071-8/+2
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* EQN blocks are now printed in all modes. This is simply a printing ofKristaps Dzonsons2011-02-091-1/+7
| | | | the concatenated string (in -T[x]html, it gets a SPAN, too).
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-0/+2
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* Refrain from throwing fatal errors forIngo Schwarze2011-01-171-2/+2
| | | | | | | * .br .sp .nf .fi .na with arguments - just skip the arguments * .TH lacking arguments - use empty strings instead like groff * .TH with excessive arguments - skip those Reminded by joerg@, ok kristaps@.
* Change how -Thtml behaves with tables: use multiple rows, with widthsKristaps Dzonsons2011-01-131-2/+16
| | | | | | | | | set by COL, until an external macro is encountered. At this point in time, close out the table and process the macro. When the first table row is again re-encountered, re-start the table. This requires a bit of tracking added to "struct html", but the change is very small and follows the logic of meta-fonts. This all follows a bug-report by joerg@.