]> git.cameronkatri.com Git - mandoc.git/log
mandoc.git
14 years agoNote that "^" needs an empty cell, while "s" does not.
Kristaps Dzonsons [Tue, 11 Jan 2011 14:15:56 +0000 (14:15 +0000)]
Note that "^" needs an empty cell, while "s" does not.

14 years agoAdd support for "^" vertical spanners. Unlike GNU tbl, raise
Kristaps Dzonsons [Tue, 11 Jan 2011 14:12:01 +0000 (14:12 +0000)]
Add support for "^" vertical spanners.  Unlike GNU tbl, raise
error-class messages when data is being ignored by specifying it in "^"
cells (either as-is or in blocks).

Also note again that horizontal spanners aren't really supported...

14 years agoDon't let `in' creep past the right margin.
Kristaps Dzonsons [Tue, 11 Jan 2011 00:39:00 +0000 (00:39 +0000)]
Don't let `in' creep past the right margin.

From an assertion noted by Brad (at comstyle).

14 years agoRefactoring in preparation for .rm support:
Ingo Schwarze [Tue, 11 Jan 2011 00:11:45 +0000 (00:11 +0000)]
Refactoring in preparation for .rm support:
Unify parsing of names given as roff request arguments into a new
function roff_getname(), which is rather different from the parsing
function for normal arguments, mandoc_getarg(), because names cannot
be quoted and cannot contain whitespace or escaped characters.
The new function now throws an ERROR when finding escaped characters
in a name.
"I'm fine with this." kristaps@

14 years agoClarify what members may be NULL or not in calculating widths. Make
Kristaps Dzonsons [Mon, 10 Jan 2011 15:31:00 +0000 (15:31 +0000)]
Clarify what members may be NULL or not in calculating widths.  Make
sure signedness is correct.  Verify that layouts MUST exit for data
cells.

14 years agoMake dp->string always consist of a value.
Kristaps Dzonsons [Mon, 10 Jan 2011 14:56:06 +0000 (14:56 +0000)]
Make dp->string always consist of a value.

14 years agoFirst, make extra data cells be thrown away. This makes "dp->layout"
Kristaps Dzonsons [Mon, 10 Jan 2011 14:40:30 +0000 (14:40 +0000)]
First, make extra data cells be thrown away.  This makes "dp->layout"
always hold, which cleans up the table stuff a bit.

Second, set a "spans" value per data cell consisting of the number of
skipped TBL_CELL_SPAN layout cells.

Third, make tbl_term.c understand how to skip over spanned sections when
iterating over the header queue.

What remains is to calculate the widths of spanned cells.

14 years agosome minor issues reported by brad@
Ingo Schwarze [Mon, 10 Jan 2011 03:43:47 +0000 (03:43 +0000)]
some minor issues reported by brad@

14 years agoWhen a row of data is being parsed and it's a line or double-line
Kristaps Dzonsons [Sun, 9 Jan 2011 23:14:41 +0000 (23:14 +0000)]
When a row of data is being parsed and it's a line or double-line
(instead of data), re-use the last "layout" pointer instead of advancing
to the next one.

This fixes a segfault report by joerg@.

14 years agoRemove lots of issues that have been resolved,
Ingo Schwarze [Sun, 9 Jan 2011 18:45:46 +0000 (18:45 +0000)]
Remove lots of issues that have been resolved,
and rephrase some that have been partially resolved.

14 years agoAdd some unsigned char casts for tolower() usage
Joerg Sonnenberger [Sun, 9 Jan 2011 05:38:23 +0000 (05:38 +0000)]
Add some unsigned char casts for tolower() usage

14 years agoNote that we support the "a" key.
Kristaps Dzonsons [Sat, 8 Jan 2011 17:30:03 +0000 (17:30 +0000)]
Note that we support the "a" key.

14 years agoThe numerical column type centres on the *last* decimal point.
Kristaps Dzonsons [Sat, 8 Jan 2011 17:16:48 +0000 (17:16 +0000)]
The numerical column type centres on the *last* decimal point.

14 years agoGive the "n" cell type knowledge of its spacing.
Kristaps Dzonsons [Sat, 8 Jan 2011 17:00:27 +0000 (17:00 +0000)]
Give the "n" cell type knowledge of its spacing.

14 years agoMeh, 2010->2011. Changed the live index.html file so as not to confuse
Kristaps Dzonsons [Fri, 7 Jan 2011 15:22:21 +0000 (15:22 +0000)]
Meh, 2010->2011.  Changed the live index.html file so as not to confuse
people (although the tagged 1.10.9 release will show 2010).

14 years agoOops: get rid of stray whitespace. VERSION_1_10_9
Kristaps Dzonsons [Fri, 7 Jan 2011 15:07:21 +0000 (15:07 +0000)]
Oops: get rid of stray whitespace.

14 years agoFixes: T} can be followed by a delimiter then more data. Make this
Kristaps Dzonsons [Fri, 7 Jan 2011 14:59:52 +0000 (14:59 +0000)]
Fixes: T} can be followed by a delimiter then more data. Make this
work and add documentation for it.

Also make tbl_term() not puke if the number of data cells is less than
the number of layout cells (which happens from time to time).  This
still needs work because we should pad out empty cells so that the
borders all work out.

14 years agoQuiesce lint with some type handling. Does not change anything.
Kristaps Dzonsons [Fri, 7 Jan 2011 13:20:58 +0000 (13:20 +0000)]
Quiesce lint with some type handling.  Does not change anything.

14 years agoVersion bits. Here we go...
Kristaps Dzonsons [Fri, 7 Jan 2011 13:10:03 +0000 (13:10 +0000)]
Version bits.  Here we go...

14 years agoTiny bits in place for tbl horizontal spans. This will wait for the next
Kristaps Dzonsons [Fri, 7 Jan 2011 13:03:48 +0000 (13:03 +0000)]
Tiny bits in place for tbl horizontal spans.  This will wait for the next
release to be implemented in full.

14 years agoMake -literal displays only have 8-character displays. From a
Kristaps Dzonsons [Thu, 6 Jan 2011 14:05:12 +0000 (14:05 +0000)]
Make -literal displays only have 8-character displays.  From a
low-hanging TODO added by schwarze@ on 15/08/10.

14 years agoRemove delims from struct tbl (not used anywhere and never will be).
Kristaps Dzonsons [Thu, 6 Jan 2011 13:45:47 +0000 (13:45 +0000)]
Remove delims from struct tbl (not used anywhere and never will be).

14 years agoClean-up www page a bit.
Kristaps Dzonsons [Thu, 6 Jan 2011 13:45:28 +0000 (13:45 +0000)]
Clean-up www page a bit.

14 years agoRestructured tbl_html() function so that we always clean up our columns.
Kristaps Dzonsons [Thu, 6 Jan 2011 12:31:39 +0000 (12:31 +0000)]
Restructured tbl_html() function so that we always clean up our columns.

14 years agoMake -T[x]html for tables structure cells with a width. I don't
Kristaps Dzonsons [Thu, 6 Jan 2011 11:55:39 +0000 (11:55 +0000)]
Make -T[x]html for tables structure cells with a width.  I don't
anticipate doing much more than this for the coming release.

Also, remove "base" part of struct html (not used anywhere) and put some
comments in struct html.h.

14 years agoTweaks to tbl.7 from Jason McIntyre.
Kristaps Dzonsons [Wed, 5 Jan 2011 20:02:34 +0000 (20:02 +0000)]
Tweaks to tbl.7 from Jason McIntyre.

14 years agoStuff tbl_calc() into out.c so that it can be shared by all output modes
Kristaps Dzonsons [Wed, 5 Jan 2011 15:37:23 +0000 (15:37 +0000)]
Stuff tbl_calc() into out.c so that it can be shared by all output modes
(isn't now, but will need to be, used by -T[x]html also).  Necessitated
a lot of churn in getting tbl_calc* code out of tbl_term.c and into
out.c, including renaming some structures and so on.  The abstraction is
in having a pointer to a wrapper function for calculating string widths.
The char devices use term_strlen and term_len; the others will probably
just use strlen().

While at it, remove some superfluous assertions in the tbl code.  This
allows all tbl manuals to clear.

Lastly, set the right-margin to be the maximum margin for each table
span.  This allows big, complicated tbl-pages like terminfo to be
displayed.  They're ugly, but they work.

14 years agoGive tables an HTML class.
Kristaps Dzonsons [Wed, 5 Jan 2011 13:00:11 +0000 (13:00 +0000)]
Give tables an HTML class.

14 years agoTweak some language in tbl.7.
Kristaps Dzonsons [Wed, 5 Jan 2011 09:31:10 +0000 (09:31 +0000)]
Tweak some language in tbl.7.

14 years agoMerge from OpenBSD (similar to my original fix committed on Oct 15, 2010):
Ingo Schwarze [Tue, 4 Jan 2011 23:48:39 +0000 (23:48 +0000)]
Merge from OpenBSD (similar to my original fix committed on Oct 15, 2010):
For now, parse and ignore minimal column width specifications.
First step to get terminfo(5) to build.

14 years agoAdd tbl.7 to DOCUMENTATION. Removed old NEWS items.
Kristaps Dzonsons [Tue, 4 Jan 2011 23:32:39 +0000 (23:32 +0000)]
Add tbl.7 to DOCUMENTATION.  Removed old NEWS items.

14 years agoMoved table stuff from roff.7 into the new tbl.7 (suggested by Jason McIntyre).
Kristaps Dzonsons [Tue, 4 Jan 2011 23:32:21 +0000 (23:32 +0000)]
Moved table stuff from roff.7 into the new tbl.7 (suggested by Jason McIntyre).

Added cross-links to tbl.7 from other manuals.

14 years agoSupport `T{' and `T}' data blocks. When a standalone `T{' is
Kristaps Dzonsons [Tue, 4 Jan 2011 15:02:00 +0000 (15:02 +0000)]
Support `T{' and `T}' data blocks.  When a standalone `T{' is
encountered as a line's last data cell, move into TBL_PART_CDATA mode
whilst leaving the cell's designation as TBL_DATA_NONE.  When new data
arrives that's not a standalone `T}', append it to the cell contends.
Close out and warn appropriately.

14 years agoHave horizontal spanner not clobber pre-set width.
Kristaps Dzonsons [Tue, 4 Jan 2011 13:21:45 +0000 (13:21 +0000)]
Have horizontal spanner not clobber pre-set width.

14 years agoFix spacing for tables to use term_len(). Also make term.c properly
Kristaps Dzonsons [Tue, 4 Jan 2011 13:14:26 +0000 (13:14 +0000)]
Fix spacing for tables to use term_len().  Also make term.c properly
recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.

14 years agoFix to make horizontal spanners in the layout be properly printed.
Kristaps Dzonsons [Tue, 4 Jan 2011 12:06:21 +0000 (12:06 +0000)]
Fix to make horizontal spanners in the layout be properly printed.
mandoc also now warns (so does tbl(1)) if a horizontal spanner is
specified along with data.

While here, fix up some documentation and uncomment the tbl reference.

14 years agoProtect tbl nodes from getting a post call.
Kristaps Dzonsons [Tue, 4 Jan 2011 10:31:15 +0000 (10:31 +0000)]
Protect tbl nodes from getting a post call.

14 years agoAdd skeleton for -T[x]html tbl stuff. Also start to put in some bits about
Kristaps Dzonsons [Tue, 4 Jan 2011 10:29:41 +0000 (10:29 +0000)]
Add skeleton for -T[x]html tbl stuff.  Also start to put in some bits about
the up-coming version, although we're not quite there yet.

14 years agoMultiple man(7) .IP and .TP fixes started during p2k10:
Ingo Schwarze [Tue, 4 Jan 2011 01:23:18 +0000 (01:23 +0000)]
Multiple man(7) .IP and .TP fixes started during p2k10:

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?"

14 years agoPartial cleanup of argument count validation in mdoc(7):
Ingo Schwarze [Mon, 3 Jan 2011 23:53:51 +0000 (23:53 +0000)]
Partial cleanup of argument count validation in mdoc(7):

* Do not segfault on empty .Db, .Rs, .Sm, and .St.
* Let check_count() really throw the requested level, not always ERROR.
* Downgrade most bad argument counts from ERROR to WARNING.
* And some related internal cleanup.

Looks fine to kristaps@.

Note that the macros using eerr_ge1() still need to be checked at a later
time; but as all the others are done, let's use what we already have.

14 years agoCalling a macro with fewer arguments than it is defined with is OK;
Ingo Schwarze [Mon, 3 Jan 2011 23:24:16 +0000 (23:24 +0000)]
Calling a macro with fewer arguments than it is defined with is OK;
the remaining ones default to the empty string, not to NULL.
Regression reported and fix tested by kristaps@.

14 years agoUnify roff macro argument parsing (in roff.c, roff_userdef()) and man macro
Ingo Schwarze [Mon, 3 Jan 2011 22:42:37 +0000 (22:42 +0000)]
Unify roff macro argument parsing (in roff.c, roff_userdef()) and man macro
argument parsing (in man_argv.c, man_args()), both having different bugs,
to use one common macro argument parser (in mandoc.c, mandoc_getarg()),
because from the point of view of roff, man macros are just roff macros,
hence their arguments are parsed in exactly the same way.

While doing so, fix these bugs:
 * Escaped blanks (i.e. those preceded by an odd number of backslashes)
   were mishandled as argument separators in unquoted arguments to
   user-defined roff macros.
 * Unescaped blanks preceded by an even number of backslashes were not
   recognized as argument separators in unquoted arguments to man macros.
 * Escaped backslashes (i.e. pairs of backslashes) were not reduced
   to single backslashes both in unquoted and quoted arguments both
   to user-defined roff macros and to man macros.
 * Escaped quotes (i.e. pairs of quotes inside quoted arguments) were
   not reduced to single quotes in man macros.

OK kristaps@

Note that mdoc macro argument parsing is yet another beast for no good
reason and is probably afflicted by similar bugs.  But i don't attempt
to fix that right now because it is intricately entangled with lots of
unrelated high-level mdoc(7) functionality, like delimiter handling and
column list phrase handling.  Disentagling that would waste too much
time now.

14 years agoRemove TODO for tbl.
Kristaps Dzonsons [Mon, 3 Jan 2011 21:53:46 +0000 (21:53 +0000)]
Remove TODO for tbl.

14 years agoSwitch on the `TS' documentation in roff.7. As per off-line discussion,
Kristaps Dzonsons [Mon, 3 Jan 2011 16:04:41 +0000 (16:04 +0000)]
Switch on the `TS' documentation in roff.7.  As per off-line discussion,
this may be moved to tbl.7, but for the time being, keep it in the
document as it's developed.

Also note that my handling of horizontal rules in layouts needs some
work.

14 years agoFor tbl: -man documents print an extra space before `TS' blocks.
Kristaps Dzonsons [Mon, 3 Jan 2011 15:30:25 +0000 (15:30 +0000)]
For tbl: -man documents print an extra space before `TS' blocks.

14 years agoAdd in support for number table cells that account for escapes and so
Kristaps Dzonsons [Mon, 3 Jan 2011 15:07:59 +0000 (15:07 +0000)]
Add in support for number table cells that account for escapes and so
on.  Note also that -Tps and -Tpdf, with these last two commits, produce
more readable output ("less crappy").

14 years agoClean up the tbl top-level printing code and document the parts of it.
Kristaps Dzonsons [Mon, 3 Jan 2011 14:57:04 +0000 (14:57 +0000)]
Clean up the tbl top-level printing code and document the parts of it.

14 years agoStart using term_strlen() instead of strlen(). tbl_term.c can now
Kristaps Dzonsons [Mon, 3 Jan 2011 14:45:59 +0000 (14:45 +0000)]
Start using term_strlen() instead of strlen().  tbl_term.c can now
properly handle embedded escapes when calculating its widths.  NOTE:
this doesn't yet apply to the decimal-point calculation.

14 years agoMake width calculations occur within tbl_term.c, not tbl.c. This allows
Kristaps Dzonsons [Mon, 3 Jan 2011 13:59:21 +0000 (13:59 +0000)]
Make width calculations occur within tbl_term.c, not tbl.c.  This allows
for front-ends to make decisions about widths, not the back-end.

To pull this off, first make each tbl_head contain a unique index value
(0 <= index < total tbl_head elements) and remove the tbl_calc() routine
from the back-end.

Then, when encountering the first tbl_span in the front-end, dynamically
create an array of configurations (termp_tbl) keyed on each tbl_head's
unique index value.  Construct the decimals and widths at this time,
then continue parsing as before.

The termp_tbl and indexes are required because we pass a const tbl AST
into the front-end.

14 years agoTiny edit required after MDOC_HALT change.
Kristaps Dzonsons [Mon, 3 Jan 2011 13:55:26 +0000 (13:55 +0000)]
Tiny edit required after MDOC_HALT change.

14 years agoMake sure we don't continue recursively parsing once we've exited with
Kristaps Dzonsons [Mon, 3 Jan 2011 13:54:02 +0000 (13:54 +0000)]
Make sure we don't continue recursively parsing once we've exited with
failure (this had caused some segfaults with the new assert() call in
MAN_HALT and MDOC_HALT).

14 years agoSame treatment for MAN_HALT as for MDOC_HALT.
Kristaps Dzonsons [Mon, 3 Jan 2011 11:31:26 +0000 (11:31 +0000)]
Same treatment for MAN_HALT as for MDOC_HALT.

14 years agoClarified the role of MDOC_HALT in libmdoc functions by having accessor
Kristaps Dzonsons [Mon, 3 Jan 2011 11:27:32 +0000 (11:27 +0000)]
Clarified the role of MDOC_HALT in libmdoc functions by having accessor
functions assert() if they're called after MDOC_HALT is set.

This makes more sense than returning 0 because this return value is used
for parse errors, not programme-flow errors, and it's inconsistent to
use the same value for both.  Plus, prior to this, I'd return 0 without
printing an error message, which would cause failure to go unreported to
the operator.

14 years agoFix table to print nicely (merging error). Also have -Ttree push out some
Kristaps Dzonsons [Sun, 2 Jan 2011 20:34:05 +0000 (20:34 +0000)]
Fix table to print nicely (merging error).  Also have -Ttree push out some
header stuff.

14 years agoTurn on -Tascii tbl printing. The output still has some issues---I'm
Kristaps Dzonsons [Sun, 2 Jan 2011 12:21:07 +0000 (12:21 +0000)]
Turn on -Tascii tbl printing.  The output still has some issues---I'm
not sure whether it's in the header calculation or term.c squashing
spaces or whatever, but let's get this in for general testing as soon as
possible.

14 years agoAdd some final bits necessary in the upcoming -Tascii tbl stuff.
Kristaps Dzonsons [Sun, 2 Jan 2011 12:04:23 +0000 (12:04 +0000)]
Add some final bits necessary in the upcoming -Tascii tbl stuff.

14 years agoChurn to get parts of 'struct tbl' visible from mandoc.h: rename the
Kristaps Dzonsons [Sun, 2 Jan 2011 10:10:57 +0000 (10:10 +0000)]
Churn to get parts of 'struct tbl' visible from mandoc.h: rename the
existing 'struct tbl' as 'struct tbl_node', then move all option stuff
into a 'struct tbl' in mandoc.h.

This conflicted with a structure in chars.c, which was renamed.

14 years agoMerge in the width, decimal, and positioning code for individual data rows
Kristaps Dzonsons [Sat, 1 Jan 2011 23:00:46 +0000 (23:00 +0000)]
Merge in the width, decimal, and positioning code for individual data rows
from tbl.bsd.lv.  This is more or less verbatim, less queue macros and also
a check for NULL layout.

This concludes the back-end parsing for a little while, as the front-end
display may now be configured.

14 years agoAdd a warning if a data cell has no layout. Also make -Ttree show this
Kristaps Dzonsons [Sat, 1 Jan 2011 22:27:08 +0000 (22:27 +0000)]
Add a warning if a data cell has no layout.  Also make -Ttree show this
with a little star next to the entry (yeah, this is mostly for testing).

14 years agoPlug in the "head" concept for tables. A tbl_head specifies the full
Kristaps Dzonsons [Sat, 1 Jan 2011 22:19:15 +0000 (22:19 +0000)]
Plug in the "head" concept for tables.  A tbl_head specifies the full
layout for each row, including vertical spacers.  One grabs the tbl_head
for a row and iterates through each entry, plugging data from the
tbl_span into the header as appropriate.

This is pulled in more or less verbatim from tbl.bsd.lv.  In fact, this
is verbatim except that lists macros are made into hard-coded lists (for
compatibility, as long-ago noted by joerg@).

14 years agoAdd bits for compilation on Mac.
Kristaps Dzonsons [Sat, 1 Jan 2011 21:23:01 +0000 (21:23 +0000)]
Add bits for compilation on Mac.

14 years agoMake some bit-flags into enums as they should be. Make printing of -Ttree
Kristaps Dzonsons [Sat, 1 Jan 2011 17:10:20 +0000 (17:10 +0000)]
Make some bit-flags into enums as they should be.  Make printing of -Ttree
tables a little bit smarter.

14 years agoMore checks for proper table exit.
Kristaps Dzonsons [Sat, 1 Jan 2011 16:18:39 +0000 (16:18 +0000)]
More checks for proper table exit.

14 years agoRaise an error if a table is closed without data.
Kristaps Dzonsons [Sat, 1 Jan 2011 16:10:40 +0000 (16:10 +0000)]
Raise an error if a table is closed without data.

14 years agoAdd documentation bits for libroff's new roff_span().
Kristaps Dzonsons [Sat, 1 Jan 2011 15:45:18 +0000 (15:45 +0000)]
Add documentation bits for libroff's new roff_span().

Add bits to remember tbl's invocation point.

Add ERROR class message if no data's in the table.

14 years agoMake -Ttree a bit more readable.
Kristaps Dzonsons [Sat, 1 Jan 2011 14:09:21 +0000 (14:09 +0000)]
Make -Ttree a bit more readable.

14 years agoMake -Ttree spit out table columns.
Kristaps Dzonsons [Sat, 1 Jan 2011 13:54:58 +0000 (13:54 +0000)]
Make -Ttree spit out table columns.

Add forgotten assignment of span to -man's TBL nodes.

14 years agoSwitch on tbl rows being added to the parse stream. Here we go!
Kristaps Dzonsons [Sat, 1 Jan 2011 13:37:40 +0000 (13:37 +0000)]
Switch on tbl rows being added to the parse stream.  Here we go!

14 years agoAdd -man support for tables. Like -mdoc, this consists of an
Kristaps Dzonsons [Sat, 1 Jan 2011 12:59:17 +0000 (12:59 +0000)]
Add -man support for tables.  Like -mdoc, this consists of an
external-facing function man_addspan() (this required shuffling around
the descope routine) and hooks elsewhere.

Also fixed mdoc.c's post-validation of tables.

14 years agoAdd basic -Ttree support for tables.
Kristaps Dzonsons [Sat, 1 Jan 2011 12:56:12 +0000 (12:56 +0000)]
Add basic -Ttree support for tables.

14 years agoAdd table processing structures to -mdoc. This consists of an
Kristaps Dzonsons [Sat, 1 Jan 2011 12:18:37 +0000 (12:18 +0000)]
Add table processing structures to -mdoc.  This consists of an
external-facing function mdoc_addspan(), then various bits to prohibit
printing and scanning (this requires some if's to be converted into
switch's).

14 years agoClean up {mdoc,man}_pmsg and vmsg invocations (ignore return values).
Kristaps Dzonsons [Sat, 1 Jan 2011 10:51:30 +0000 (10:51 +0000)]
Clean up {mdoc,man}_pmsg and vmsg invocations (ignore return values).

14 years agoExpose the parsed table API to the world and add accessors through the
Kristaps Dzonsons [Fri, 31 Dec 2010 18:19:43 +0000 (18:19 +0000)]
Expose the parsed table API to the world and add accessors through the
roff.h interface.

14 years agoPut parsed tables into a queue that's cleared at the end of parsing.
Kristaps Dzonsons [Fri, 31 Dec 2010 14:52:41 +0000 (14:52 +0000)]
Put parsed tables into a queue that's cleared at the end of parsing.
This completes the parsing phase of the new tbl implementation.

14 years agoAssign layout cells to parsed data. This follows primarily from
Kristaps Dzonsons [Thu, 30 Dec 2010 10:26:00 +0000 (10:26 +0000)]
Assign layout cells to parsed data.  This follows primarily from
tbl.bsd.lv, although it has been reimplemented.

14 years agoMove clean-up of parsed tbl nodes into the tbl_clear() function, called
Kristaps Dzonsons [Thu, 30 Dec 2010 09:34:06 +0000 (09:34 +0000)]
Move clean-up of parsed tbl nodes into the tbl_clear() function, called
once per invocation.

14 years agoPlan9 has a man(7) implementation that looks extremely archaic,
Ingo Schwarze [Thu, 30 Dec 2010 00:51:32 +0000 (00:51 +0000)]
Plan9 has a man(7) implementation that looks extremely archaic,
even more archaic than Solaris/Heirloom stuff; so that is quite
interesting from a perspective of compatibility and history.

14 years agoInitial check-in of table data-row processing. For the time being, this
Kristaps Dzonsons [Wed, 29 Dec 2010 16:44:23 +0000 (16:44 +0000)]
Initial check-in of table data-row processing.  For the time being, this
parses table data then throws it away immediately.  It does not yet try
to cross-check data rows against layout or anything.  This copied more
or less completely from tbl.bsd.lv.

14 years agoUse `Dl' instead of `D1' for code examples.
Kristaps Dzonsons [Wed, 29 Dec 2010 16:18:13 +0000 (16:18 +0000)]
Use `Dl' instead of `D1' for code examples.

14 years agoIn mdoc.7, don't use `D1' in place of `Dl' for code examples.
Kristaps Dzonsons [Wed, 29 Dec 2010 16:16:50 +0000 (16:16 +0000)]
In mdoc.7, don't use `D1' in place of `Dl' for code examples.

14 years agoUpdate (still-commented) manual bits for tbl.
Kristaps Dzonsons [Wed, 29 Dec 2010 15:21:34 +0000 (15:21 +0000)]
Update (still-commented) manual bits for tbl.

Also removed lots of superfluous switch cases by using tolower() and
handling only the lowercase keys.

14 years agoAdd handling for `T&', which restarts a table except for its options.
Kristaps Dzonsons [Wed, 29 Dec 2010 14:53:31 +0000 (14:53 +0000)]
Add handling for `T&', which restarts a table except for its options.

14 years agoMerge, with considerable changes, tbl.bsd.lv's layout-handling code.
Kristaps Dzonsons [Wed, 29 Dec 2010 14:38:14 +0000 (14:38 +0000)]
Merge, with considerable changes, tbl.bsd.lv's layout-handling code.

14 years agoInitial documentation for TBL, which for the time being is commented-out.
Kristaps Dzonsons [Wed, 29 Dec 2010 10:19:55 +0000 (10:19 +0000)]
Initial documentation for TBL, which for the time being is commented-out.

14 years agoWhack removed function from libroff.
Kristaps Dzonsons [Wed, 29 Dec 2010 01:18:23 +0000 (01:18 +0000)]
Whack removed function from libroff.

14 years agoSignificant update to options handling, which now departs almost
Kristaps Dzonsons [Wed, 29 Dec 2010 01:16:57 +0000 (01:16 +0000)]
Significant update to options handling, which now departs almost
completely with the BSD.lv code due to performance issues and flat-out
errors.

Performance issues: functions called per character.  Ugly.

Flat-out errors: disallowing "reserved" tokens as arguments to those
options accepting arguments.

Also added are two mandoc.h error codes for general tbl syntax errors
and for bad options.

14 years agoFix copyright email.
Kristaps Dzonsons [Tue, 28 Dec 2010 13:47:38 +0000 (13:47 +0000)]
Fix copyright email.

14 years agoAdding initial options processing (not hooked into parse yet). This is
Kristaps Dzonsons [Tue, 28 Dec 2010 13:46:07 +0000 (13:46 +0000)]
Adding initial options processing (not hooked into parse yet).  This is
more or less copied from tbl.bsd.lv and still needs integration with the
general mandoc framework, e.g., with error messages.

14 years agoTemporarily remove check for r->tbl at end of parse since we need the
Kristaps Dzonsons [Tue, 28 Dec 2010 10:59:07 +0000 (10:59 +0000)]
Temporarily remove check for r->tbl at end of parse since we need the
original parse point to generate a useful error message.

14 years agoFixed enum rofferr return value in tbl_read() (oops).
Kristaps Dzonsons [Tue, 28 Dec 2010 10:55:24 +0000 (10:55 +0000)]
Fixed enum rofferr return value in tbl_read() (oops).

14 years agoInitial tbl framework. Parse point is in libroff, which keeps a
Kristaps Dzonsons [Tue, 28 Dec 2010 10:51:03 +0000 (10:51 +0000)]
Initial tbl framework.  Parse point is in libroff, which keeps a
reference to a current tbl parse and routes ALL text into the tbl parse
after stripping reserved words and making block-level pre-processing
(e.g., `ig').  This is consistent with an analysis of embedded `TS/TE'
in manuals with sprinkled -mdoc, roff, and -man macros.

Fact of a parse is exposed to main.c by a return value (ROFF_TBL), which
will trigger main.c to add a foreign parsed body to the -mdoc or -man
parse stream.  This interface isn't in yet, but will follow the
parse-text functions in both libraries.  I put this login in main.c
because I don't want libroff calling directly into libmdoc or libman.

As a consequence, a parsed row can be pushed directly into any -mdoc or
-man context (put a `Bd -literal -offset indent' into a `TE/TS' block to
see why this is necessary).  It will then absorb formatting cues in the
front-ends.

A note on naming.  I decided on libroff.h instead of tbl.h because this
is purely within the roff layer.  Separate tbl implementations will
need, then, to interface with libroff.  This is "how it should be"
because tbl is tightly linked with roff in terms of `ds' and other
formatting macros, as well as, of course, special characters and other
roffisms.

14 years agoIn case an ID attribute is written in pieces, only protect the first
Ingo Schwarze [Mon, 27 Dec 2010 21:41:05 +0000 (21:41 +0000)]
In case an ID attribute is written in pieces, only protect the first
piece with a prepended 'x', not each piece, such that quoted and
unquoted .Sh, .Ss, and .Sx arguments are compatible with each other.
Fixing a bug reported by Nicolas Joly <njoly at NetBSD dot org>,
avoiding a regression in my first patch as pointed out by njoly as well.
"feel free to do so" kristaps@

14 years agoNote `Sx's connection to `Sh' and `Ss'.
Kristaps Dzonsons [Mon, 27 Dec 2010 20:39:46 +0000 (20:39 +0000)]
Note `Sx's connection to `Sh' and `Ss'.

14 years agoWhack MDOC_ACTED and MAN_ACTED (these no longer exist).
Kristaps Dzonsons [Sun, 26 Dec 2010 14:44:13 +0000 (14:44 +0000)]
Whack MDOC_ACTED and MAN_ACTED (these no longer exist).

14 years agopod2man re-writes this and that using `tr', which we don't implement. Noted
Kristaps Dzonsons [Sun, 26 Dec 2010 14:38:10 +0000 (14:38 +0000)]
pod2man re-writes this and that using `tr', which we don't implement.  Noted
by Andreas Vogele.

14 years agoAs pointed out by schwarze@, %T/%J renders with a normal double-quote, not
Kristaps Dzonsons [Sat, 25 Dec 2010 23:27:50 +0000 (23:27 +0000)]
As pointed out by schwarze@, %T/%J renders with a normal double-quote, not
the fancy double-quote.

14 years agoImplement schwarze@'s much more elegant version of my %T/%J fix.
Kristaps Dzonsons [Sat, 25 Dec 2010 23:25:53 +0000 (23:25 +0000)]
Implement schwarze@'s much more elegant version of my %T/%J fix.

14 years agoSpecifying both %T and %J in an `Rs' block causes the title to be quoted
Kristaps Dzonsons [Sat, 25 Dec 2010 13:50:37 +0000 (13:50 +0000)]
Specifying both %T and %J in an `Rs' block causes the title to be quoted
instead of underlined.  This only happens in -Tascii, as -T[x]html both
underlines and italicises.

14 years agoWhack superfluous font-family in mdocml's www style.css. Noted by
Kristaps Dzonsons [Fri, 24 Dec 2010 22:51:13 +0000 (22:51 +0000)]
Whack superfluous font-family in mdocml's www style.css.  Noted by
Anthony J. Bentley.  Thanks!

14 years agoMake `Fo' use a B instead of SPAN (left-over).
Kristaps Dzonsons [Fri, 24 Dec 2010 22:47:37 +0000 (22:47 +0000)]
Make `Fo' use a B instead of SPAN (left-over).