summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow `Sx' and `Ss' to have child nodes. Fixes manuals in NetBSD.Kristaps Dzonsons2011-08-101-12/+22
| | | | | | Originally pointed out by joerg@ then again by Thomas Klausner by way of Nicolas Joy. Note: don't use these constructions as you can't link to the sections with `Sx'.
* Flip on equation printing for -T[x]html.Kristaps Dzonsons2011-07-231-5/+2
|
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-3/+3
| | | | | | | 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.
* The bufcat() function in -T[x]html was eating one byte off the end of itsKristaps Dzonsons2011-07-041-1/+3
| | | | | | concatenated string. This for some reason hasn't been found before now... ? Anyway, fixed, and make the IDs created again be correctly prefixed by a letter as per the HTML spec.
* First fix how `sp 1' doesn't imply `1v' (it now does) and that 1Kristaps Dzonsons2011-06-291-3/+4
| | | | | | 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.
* Have -T[x]html print out the link target for `Lk' if no link title isKristaps Dzonsons2011-06-161-4/+5
| | | | provided. From a patch by Tim van der Molen.
* Clean-up fallout: differentiate ID's and HREF's (where to put the `#').Kristaps Dzonsons2011-05-171-1/+2
| | | | Make buffmt functions internally bufinit(), too.
* Cleanups in -T[x]html: make html_idcat() use the buffer and be calledKristaps Dzonsons2011-05-171-29/+26
| | | | | | 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-2/+2
| | | | | | | | | | 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.
* Give -Thtml and -Txhtml the gift of recognising escapes when calculatingKristaps Dzonsons2011-05-141-6/+6
| | | | | widths (e.g., `Bl -tag -width "\s[blahblah]bar"). This has long since been done for -Tascii but escaped noticed with -T[x]html.
* Revert last change: this screwed up displaying in other pages (didn'tKristaps Dzonsons2011-04-231-2/+2
| | | | test it enough).
* Make the `Nm' -Thtml attribute be min-width instead of width. This is aKristaps Dzonsons2011-04-231-2/+2
| | | | | | | | quick fix for, say, rc.d(8) in OpenBSD, which has nested macros on the `Nm' SYNOPSIS line that were skipped over by the length calculator. This should [maybe?] be a recursive length check, but still it'd need to be a min-width to accomodate for (say) `Qq' and the like printing excess characters post-length-calculation.
* Suppress a space following the "(" for -T[x]html `Fn'. Found by randomKristaps Dzonsons2011-04-041-1/+2
| | | | perusal of online manuals.
* Have `Fd' in -T[x]html generate an "include" link if it detects oneKristaps Dzonsons2011-04-041-5/+53
| | | | being used.
* Fix a bug that slip in: PAIR_XXXX macros expanded to run the incrementKristaps Dzonsons2011-04-041-2/+3
| | | | twice.
* Fully fix the `Rv' and `Ex' handlers for -T[x]html and -Tascii. ThisKristaps Dzonsons2011-04-041-15/+20
| | | | includes an unreported bug where `Ex' wasn't properly adding a newline.
* Make `Rv' do the Right Thing regarding commas and "and" when listing itsKristaps Dzonsons2011-04-041-20/+27
| | | | | output. This also makes it easier to read. While here, remove superfluous assignment to local variables for this and `Mt'.
* Fix possible segfaults in `Lk' -T[x]html handler, which made someKristaps Dzonsons2011-04-041-10/+12
| | | | | assumptions about its children. Also remove superfluous reassignment to local variable.
* Clean-up in -T[x]html: remove some unnecessary assignments to localKristaps Dzonsons2011-04-041-23/+21
| | | | variables.
* Clean up handling of `In' for -T[x]html such that it only links to theKristaps Dzonsons2011-04-041-12/+29
| | | | | first argument. groff of course doesn't do links, but it will uglify subsequent arguments in the list (we warn about >1, anyway).
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-5/+22
| | | | | | | | | error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
* Clean up date handling,Ingo Schwarze2011-03-071-5/+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-2/+8
| | | | the concatenated string (in -T[x]html, it gets a SPAN, too).
* Fix a regression caused by mdoc_term.c 1.214 / mdoc_html.c 1.148:Ingo Schwarze2011-02-061-3/+5
| | | | | Inside .Bk or inside the SYNOPSIS, Unix variant macros cleared the keep flag.
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-1/+3
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* If `Ns' is specified on its own line, it should be ignored. This isKristaps Dzonsons2011-02-021-2/+3
| | | | | shitty groff behaviour. Do the same, but raise a warning to this effect. This from a TODO noted by schwarze@.
* When in a <PRE>, don't print out the <BR> before lines that have leadingKristaps Dzonsons2011-01-291-3/+17
| | | | whitespace.
* Arguments to `Bsx' and friends are separated by a non-breaking space.Kristaps Dzonsons2011-01-251-2/+8
| | | | This removes a TODO raised by schwarze@.
* Push capitalisation of `Bx' second argument into validator, where it belongs.Kristaps Dzonsons2011-01-251-8/+3
|
* Properly uppercase the first-letter of the `Bx' second argument.Kristaps Dzonsons2011-01-251-4/+9
|
* Have `Bx' accept two arguments, not just one, and join these argumentsKristaps Dzonsons2011-01-251-7/+15
| | | | with "xxBSD-yy"
* Change how -Thtml behaves with tables: use multiple rows, with widthsKristaps Dzonsons2011-01-131-4/+20
| | | | | | | | | 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@.
* If the first character of free-form text is whitespace, then a newlineKristaps Dzonsons2011-01-121-1/+3
| | | | shall precede outputted text (surprise!).
* Quiesce lint with some type handling. Does not change anything.Kristaps Dzonsons2011-01-071-4/+5
|
* Add skeleton for -T[x]html tbl stuff. Also start to put in some bits aboutKristaps Dzonsons2011-01-041-2/+5
| | | | the up-coming version, although we're not quite there yet.
* Add table processing structures to -mdoc. This consists of anKristaps Dzonsons2011-01-011-1/+3
| | | | | | external-facing function mdoc_addspan(), then various bits to prohibit printing and scanning (this requires some if's to be converted into switch's).
* Make `Fo' use a B instead of SPAN (left-over).Kristaps Dzonsons2010-12-241-3/+3
|
* Apparently the U tag is deprecated, so use a SPAN instead (blah). BumpKristaps Dzonsons2010-12-241-2/+1
| | | | version date for release.
* As per schwarze@'s suggestions, roll back the refcount structure inKristaps Dzonsons2010-12-241-25/+25
| | | | | | | | favour of a simpler shim for normalised data in the node allocation and free routines. This removes the need to bump and copy references within validator handlers, removes a pointer redirect, and also kills the refcount structure itself. Data is assumed to "live" either in a MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
* Ensure -Thtml has DIV as child of BLOCKQUOTE.Kristaps Dzonsons2010-12-231-6/+6
|
* Implement reference-counted version of original union mdoc_data. ThisKristaps Dzonsons2010-12-221-32/+32
| | | | | | | simplifies clean-up and allows for more types without extra hassle. Also made in-line literal types in -T[x]html use CODE instead of SPAN to match how literal blocks use PRE.
* Fix list-type being clobbered by margins. Last default styles in place.Kristaps Dzonsons2010-12-201-13/+14
| | | | | Added `Sx' to be default-italic (as in OpenBSD's cvsweb). Added `diag' formatting, which had been lost.
* More use default tags, this time I and U. Also fix a stack overflowKristaps Dzonsons2010-12-201-11/+18
| | | | segfault in the last commit.
* Give header and footer table cells default widths (using WIDTH and ALIGNKristaps Dzonsons2010-12-201-21/+53
| | | | | | | | | atttributes) if no style is specified. Give the default-bold elements a B tag instead of a SPAN tag, as this can be overriden in the stylesheet. Prune some unused attributes from html.h.
* Migrate schwarze@'s `Bk' argument patch to -T[x]html.Kristaps Dzonsons2010-12-191-2/+3
|
* Don't use EM for default widths; use BU instead.Kristaps Dzonsons2010-12-171-3/+3
|
* Prevent double-printing of `D1' or `Dl' DIV.Kristaps Dzonsons2010-12-171-5/+4
|
* Add a "list" top-level tag, too.Kristaps Dzonsons2010-12-171-2/+5
|
* Remove useless DIVs in favour of BRs. Fix `Ex' by having it print a priorKristaps Dzonsons2010-12-171-4/+10
| | | | BR. Fix `Rv' by only having it print a BR if there's a prior.
* Make literal `Bd' use a PRE in -Thtml. Make `Bd' output in general useKristaps Dzonsons2010-12-171-30/+22
| | | | only a single DIV or PRE. Tag all displays with display class.