summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/tbl_html.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* The header file "html.h" uses enum roff_tok,schwarze2019-03-171-1/+2
| | | | | | so "roff.h" must be included before it. Diff from bcallah@ tweaked by me; he found the bug by compiling with pcc.
* Finally, represent the man(7) .PP and .HP macros by the naturalschwarze2019-01-061-1/+2
| | | | | | | | | | | choice, which is <p> HTML element. On top of the previous fill-mode improvements, the key to making this possible is to automatically close the <p> when required: before headers, subsequent paragraphs, lists, indented blocks, synopsis blocks, tbl(7) blocks, and before blocks using no-fill mode. In man(7) documents, represent the .sp request by a blank line in no-fill mode and in the same way as .PP in fill mode.
* Yet another round of improvements to manual font selection.schwarze2018-12-151-1/+2
| | | | | | | | Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP.
* Cleanup, no functional change:schwarze2018-12-121-2/+2
| | | | | No need to expose the tbl(7) syntax tree data structures everywhere. Move them to their own include file, "tbl.h", and improve comments.
* Implement tbl(7) lines in -T html output,schwarze2018-11-261-68/+124
| | | | | | | | | | | | as far as they are on the edges of table cells rather than going through the middle of cells: * the box, doublebox, and allbox options; * the | and || layout modifiers; * and the _ and = data lines; - but not yet _ and = in individual layout and data cells. Missing feature reported by Pali dot Rohar at gmail dot com.
* Simplify writing of tbl(7) cells by using the new feature of passingschwarze2018-11-261-17/+5
| | | | | | a NULL pointer for the value of a style attribute, in which case the attribute is omitted from the HTML element. Minus 12 lines of ugly and repetitive code, no functional change.
* Let cells containing nothing but \^ extend the cell above.schwarze2018-11-251-7/+12
| | | | Missing feature reported by Pali dot Rohar at gmail dot com.
* In tbl(7) -T html output,schwarze2018-11-251-17/+40
| | | | | | | | | | span cells horizontally and vertically as requested by the layout. Does not handle spans requested in the data section yet. To be able to do this, record the number of rows spanned in the first data cell (struct tbl_dat) of a vertical span. Missing feature reported by Pali dot Rohar at gmail dot com.
* Implement horizontal and vertical alignment of tbl(7) cell contentschwarze2018-11-241-6/+36
| | | | | in -T html output. This does not handle spanned cells yet. Missing feature reported by Pali dot Rohar at gmail dot com.
* Do not write <colgroup> elements. Their only purpose is to enforceschwarze2018-06-251-10/+1
| | | | | | author-specified column widths, which can harm responsive design and provide no real benefit: HTML rendering engines usually do just fine automatically selecting appropriate column widths.
* Ignore explicitly specified negative column widths rather thanschwarze2017-07-311-1/+4
| | | | | wrapping around to huge numbers and risking memory exhaustion; fixes Debian ps(1). Bug reported by Dr. Markus Waldeck.
* fix column width calculation for text block cellsschwarze2017-06-121-2/+2
|
* Implement w layout specifier (minimum column width).schwarze2017-06-081-3/+30
| | | | | Improve width calculation of text blocks. Reduces the groff/mandoc diff in Base+Xenocara by about 800 lines.
* Improve <table> syntax:schwarze2017-02-051-3/+4
| | | | | | | | The <col> element can only appear inside <colgroup>, so use <colgroup>. The <tbody> element is optional and useless, so don't use it. Even if we would ever need <thead> or <tfoot>, <tbody> would still be optional and useless; besides, we will likely never need <thead> or <tfoot>, simply because our languages don't support such functionality.
* Simplify the usage of print_otag() by making it accept a variableschwarze2017-01-171-22/+10
| | | | | | | | | | number of arguments. Delete struct htmlpair and all the PAIR_*() macros. Delete enum htmlattr, handle that in print_otag() instead. Minus 190 lines of code; no functional change except better ordering of attributes (class before style) in three cases.
* To make the code more readable, delete 283 /* FALLTHROUGH */ commentsschwarze2015-10-121-2/+1
| | | | | | that were right between two adjacent case statement. Keep only those 24 where the first case actually executes some code before falling through to the next case.
* modernize style: "return" is not a function; ok cmp(1)schwarze2015-10-061-3/+4
|
* Delete the redundant tbl span flags, just inspect the actual dataschwarze2015-01-301-3/+3
| | | | | | | | where needed, which is less fragile. This fixes a subtle NULL pointer access to tp->tbl.cols: Due to a bug in the man(7) parser, the first span of a table can end up in a .TP head, in which case tblcalc() was never called. Found by jsg@ with afl.
* Abolish struct tbl_head and replace it by an "int col" member inschwarze2015-01-301-8/+8
| | | | struct tbl_cell. No functional change, minus 40 lines of code.
* Auditing the tbl(7) code for more NULL pointer accesses, i came outschwarze2015-01-301-7/+7
| | | | | empty-handed; so this is just KNF and some code simplifications, no functional change.
* Rudimentary implementation of the e, x, and z table layout modifiersschwarze2014-10-141-2/+4
| | | | | | | to equalize, maximize, and ignore the width of columns. Does not yet take vertical rulers into account, and does not do line breaks within table cells. Considerably improves the lftp(1) manual; issue noticed by sthen@.
* KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,schwarze2014-04-201-10/+5
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* Do not handle vertical lines as additional tbl(7) columns,schwarze2012-05-261-14/+6
| | | | | | | | | | | | | | instead save their properties with the following column. This simplifies layout parsing and saves a lot of code related to column handling. At output time, print all white space and vertical lines separating columns before printing the following column, and none after printing the preceding column, considerably simplifying white space handling and width calculations. No functional change, but it saves 150 lines of code, and it allows the next patch to tbl_term.c, tbl_literal().
* sync to version 1.11.7 from kristaps@schwarze2011-09-181-2/+2
| | | | | | | | 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
* Merge from bsd.lv, original commit message by kristaps@:schwarze2011-01-161-45/+62
| | | | | | | | | | Change how -Thtml behaves with tables: use multiple rows, with widths 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@.
* Various tbl improvements from kristaps@:schwarze2011-01-161-4/+12
| | | | | | | * horizontal lines do not consume layout lines * skip excessive data cells * prepare rendering of spanned cells * support vertical spans
* Sync tbl handling to bsd.lv release 1.10.9:schwarze2011-01-091-26/+79
| | | | | | | | | | | | * .T} can be followed by a delimiter, then more data. * Do not limit table column widths (improves terminfo(5)). * Let numerical cells respect explicitly specified minimum cell widths. * Let terminal output survive missing data cells. * Parse and ignore arguments in parentheses on layout cell specifications. * Move tbl_calc() into out.c such that it can be used by all frontends. * Give tables an HTML class. * Some cleanup in tbl -Thtml code. All code by kristaps@.
* Merge kristaps@' cleaner tbl integration, removing mine;schwarze2011-01-041-0/+73
there are still a few bugs, but fixing these will be easier in tree.