OpenBSD CVS

CVS log for src/usr.bin/mandoc/tree.c


[BACK] Up to [local] / src / usr.bin / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.59 / (download) - annotate - [select for diffs], Wed Jan 12 04:53:57 2022 UTC (2 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.58: +9 -5 lines
Diff to previous 1.58 (colored)

More accurately represent cells containing horizontal lines in -T tree
output.  In particular, do not represent "_" as "-", and distinguish "_"
from "\_" and "=" from "\=".
Output tweak following a related question from
Ted Bullock <tbullock at comlore dot com>.

Revision 1.58 / (download) - annotate - [select for diffs], Tue Sep 7 10:58:44 2021 UTC (2 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.57: +3 -1 lines
Diff to previous 1.57 (colored)

do not crash when a tbl(7) cell uses roman font

Revision 1.57 / (download) - annotate - [select for diffs], Tue Aug 10 12:36:42 2021 UTC (2 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +22 -4 lines
Diff to previous 1.56 (colored)

Support two-character font names (BI, CW, CR, CB, CI)
in the tbl(7) layout font modifier.

Get rid of the TBL_CELL_BOLD and TBL_CELL_ITALIC flags and use
the usual ESCAPE_FONT* enum mandoc_esc members from mandoc.h instead,
which simplifies and unifies some code.

While here, also support CB and CI in roff(7) \f escape sequences
and in roff(7) .ft requests for all output modes.  Using those is
certainly not recommended because portability is limited even with
groff, but supporting them makes some existing third-party manual
pages look better, in particular in HTML output mode.

Bug-compatible with groff as far as i'm aware, except that i consider
font names starting with the '\n' (ASCII 0x0a line feed) character
so insane that i decided to not support them.

Missing feature reported by nabijaczleweli dot xyz in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=992002.
I used none of the code from the initial patch submitted by
nabijaczleweli, but some of their ideas.
Final patch tested by them, too.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Apr 8 11:54:14 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.55: +39 -49 lines
Diff to previous 1.55 (colored)

Use a separate node->tag attribute rather than abusing the node->string
attribute for the purpose.  No functional change intended.
The purpose is to make it possible to later attach tags to text nodes.

Revision 1.55 / (download) - annotate - [select for diffs], Tue Apr 7 22:45:37 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.54: +5 -2 lines
Diff to previous 1.54 (colored)

Separate the place to put the <a href> permalink (now marked
with NODE_HREF) from the target element of the link (still marked
with NODE_ID).  In many cases, use this to move the target to the
beginning of the paragraph, such that readers don't get dropped
into the middle of a sentence.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Mar 13 00:31:05 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +10 -2 lines
Diff to previous 1.53 (colored)

Split tagging into a validation part including prioritization
in tag.{h,c} and {mdoc,man}_validate.c
and into a formatting part including command line argument checking
in term_tag.{h,c}, html.c, and {mdoc|man}_{term|html}.c.

Immediate functional benefits include:
* Improved prioritization of automatic tags for .Em and .Sy.
* Avoiding bogus automatic tags when .Em, .Fn, or .Sy are explicitly tagged.
* Explicit tagging of .Er and .Fl now works in HTML output.
* Automatic tagging of .IP and .TP now works in HTML output.
But mainly, this patch provides clean earth to build further improvements on.

Technical changes:
* Main program: Write a tag file for ASCII and UTF-8 output only.
* All formatters: There is no more need to delay writing the tags.
* mdoc(7)+man(7) formatters: No more need for elaborate syntax tree inspection.
* HTML formatter: If available, use the "string" attribute as the tag.
* HTML formatter: New function to write permalinks, to reduce code duplication.

Style cleanup in the vicinity while here:
* mdoc(7) terminal formatter: To set up bold font for children,
defer to termp_bold_pre() rather than calling term_fontpush() manually.
* mdoc(7) terminal formatter: Garbage collect some duplicate functions.
* mdoc(7) HTML formatter: Unify <code> handling, delete redundant functions.
* Where possible, use switch statements rather than if cascades.
* Get rid of some more Yoda notation.

The necessity for such changes was first discussed with kn@, but i didn't
bother him with a request to review the resulting -673/+782 line patch.

Revision 1.53 / (download) - annotate - [select for diffs], Thu Feb 27 21:38:27 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +8 -1 lines
Diff to previous 1.52 (colored)

Fully support explicit tagging of .Sh and .Ss.
This fixes the offset of two lines in terminal output
and this improves HTML output by putting the id= attribute
and <a> element into the respective <h1> or <h2> element rather
than writing an additional <mark> element.

To that end, introduce node flags NODE_ID (to make the node a link
target, for example by writing an HTML id= attribute or by calling
tag_put()) and NODE_HREF (to make the node a link source, used only
in HTML output, used only to write an <a class="permalink"> element).

In particular:
* In the validator, generalize the concept of the "next node"
such that it also works before .Sh and .Ss.
* If the first argument of .Tg is empty, don't forget to complain
if there are additional arguments, which will be ignored.
* In the terminal formatter, support writing of explicit tags
for all kinds of nodes, not just for .Tg.
* In deroff(), allow nodes to have an explicit string representation
even when they aren't text nodes.  Use this for explicitly tagged
section headers.  Suprisingly, this is sufficient to make HTML
output work, without explicit code changes in the HTML formatter.
* In syntax tree output, display NODE_ID and NODE_HREF.

Revision 1.52 / (download) - annotate - [select for diffs], Sat Jan 11 16:02:48 2020 UTC (4 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +95 -12 lines
Diff to previous 1.51 (colored)

Print more tbl(7) details to help debugging:
column numbers, options, layout rows, cell types, cell modifiers.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jan 1 05:56:26 2019 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.50: +16 -12 lines
Diff to previous 1.50 (colored)

display the NODE_NOFILL flag indicating no-fill mode

Revision 1.50 / (download) - annotate - [select for diffs], Sun Dec 30 00:48:48 2018 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +6 -6 lines
Diff to previous 1.49 (colored)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Dec 13 05:13:15 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +2 -1 lines
Diff to previous 1.48 (colored)

Cleanup, no functional change:
No need to expose the eqn(7) syntax tree data structures everywhere.
Move them to their own include file, "eqn.h".
While here, delete the unused enum eqn_pilet.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:30 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -1 lines
Diff to previous 1.47 (colored)

Cleanup, no functional change:
No need to expose the tbl(7) syntax tree data structures everywhere.
Move them to their own include file, "tbl.h", and improve comments.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Nov 25 19:23:59 2018 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +32 -26 lines
Diff to previous 1.46 (colored)

In tbl(7) -T html output,
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.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Aug 14 01:26:12 2018 UTC (5 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored)

support tail arguments on the .ME and .UE macros,
used for example in the ditroff(7) manual of the groff package

Revision 1.45 / (download) - annotate - [select for diffs], Wed Apr 11 17:10:35 2018 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.44: +10 -2 lines
Diff to previous 1.44 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jul 8 14:51:01 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jul 7 19:39:17 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +1 -4 lines
Diff to previous 1.42 (colored)

garbage collect unused enum member EQN_ROOT

Revision 1.42 / (download) - annotate - [select for diffs], Wed Jul 5 15:03:20 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

The EQN_LISTONE box type is pointless.
Simplify by just using EQN_LIST with expectargs = 1.
Noticed while investigating a bug report from bentley@.
No functional change.

Revision 1.41 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:09 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.40: +7 -7 lines
Diff to previous 1.40 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.40 / (download) - annotate - [select for diffs], Fri Feb 10 15:44:31 2017 UTC (7 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.39: +3 -1 lines
Diff to previous 1.39 (colored)

In -Ttree output mode, show the BROKEN node flag and
provide a -Onoval output option to show the unvalidated tree.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Jan 12 17:29:34 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +28 -4 lines
Diff to previous 1.38 (colored)

show meta data for -Ttree output

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 10 13:46:53 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (colored)

unify names of AST node flags; no change of cpp output

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jan 10 12:54:28 2017 UTC (7 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.36: +5 -1 lines
Diff to previous 1.36 (colored)

Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Use them to mark generated nodes and nodes that shall not produce output.
Let -Ttree output mode display these new flags.
Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments.
Use NODE_NOPRT for .Dd, .Dt, and .Os.

These will help to make handling of text production macros more rigorous.

Revision 1.36 / (download) - annotate - [select for diffs], Mon Oct 12 00:07:27 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.35: +1 -6 lines
Diff to previous 1.35 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
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.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Sep 26 12:54:18 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +18 -8 lines
Diff to previous 1.34 (colored)

Show the flags MDOC_DELIMO, MDOC_DELIMC, MDOC_EOS, and MAN_EOS.
Drop the "block-" prefixes from the node type names.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Sep 26 00:53:15 2015 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +1 -5 lines
Diff to previous 1.33 (colored)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.33 / (download) - annotate - [select for diffs], Sat Apr 18 17:50:02 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Delete the wrapper functions mdoc_meta(), man_meta(), mdoc_node(),
man_node() from the mandoc(3) semi-public interface and the internal
wrapper functions print_mdoc() and print_man() from the HTML formatters.
Minus 60 lines of code, no functional change.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Apr 18 16:04:40 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Apr 2 22:06:17 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.30: +5 -5 lines
Diff to previous 1.30 (colored)

Second step towards parser unification:
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.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Apr 2 21:03:18 2015 UTC (9 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.29: +40 -39 lines
Diff to previous 1.29 (colored)

First step towards parser unification:
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.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Feb 5 00:13:34 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.28: +2 -5 lines
Diff to previous 1.28 (colored)

Simplify by deleting the "lastline" member of struct mdoc_node.
Minus one struct member, minus 17 lines of code, no functional change.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Feb 3 18:37:39 2015 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +21 -13 lines
Diff to previous 1.27 (colored)

reduce indentation for better readability

Revision 1.27 / (download) - annotate - [select for diffs], Fri Nov 28 05:51:29 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.26: +1 -6 lines
Diff to previous 1.26 (colored)

Simplify by making many functions in the man(7) parser void,
and some cleanup; no functional change, minus 70 lines.

Revision 1.26 / (download) - annotate - [select for diffs], Mon Oct 20 01:43:06 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.25: +13 -11 lines
Diff to previous 1.25 (colored)

show the {MDOC,MAN}_EQN node, it contains interesting information,
in particular line and column numbers and flags;
but hide the uninteresting EQN_ROOT box

Revision 1.25 / (download) - annotate - [select for diffs], Mon Oct 13 21:05:59 2014 UTC (9 years, 7 months ago) by chl
Branch: MAIN
Changes since 1.24: +1 -1 lines
Diff to previous 1.24 (colored)

Add missing */ after $OpenBSD$ tag

ok schwarze@

Revision 1.24 / (download) - annotate - [select for diffs], Fri Oct 10 15:25:06 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.23: +35 -9 lines
Diff to previous 1.23 (colored)

Partial eqn(7) rewrite by kristaps@ in order to get operator precedence right.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Oct 9 15:32:22 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

more readable eqn(7) -Ttree output; from kristaps@

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jul 2 07:10:17 2014 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.21: +4 -4 lines
Diff to previous 1.21 (colored)

Change column display in -Ttree to be 1-based instead of 0-based
such that column numbers agree between messages and -Ttree.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Apr 20 16:44:44 2014 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.20: +54 -59 lines
Diff to previous 1.20 (colored)

KNF: case (FOO):  ->  case FOO, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.20 / (download) - annotate - [select for diffs], Sat Mar 8 15:50:21 2014 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.19: +6 -3 lines
Diff to previous 1.19 (colored)

To find out whether .TP head arguments are same-line or next-line arguments,
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>.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Dec 24 19:10:34 2013 UTC (10 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.18: +6 -2 lines
Diff to previous 1.18 (colored)

When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins)
to the line where the second one starts.
This fixes the bug that .Bk allowed output line breaks right after block
macros spanning more than one input line, even when the next macro follows
on the same line.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Sep 15 17:33:47 2013 UTC (10 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.17: +6 -3 lines
Diff to previous 1.17 (colored)

For some mdoc(7) macros, it is (unfortunately) semantically significant
whether they are the first macro on the line or called by another macro.
To help debugging, indicate this property "first macro on a new input line"
by prefixing an asterisk to the line number in -Ttree output.

Revision 1.17 / (download) - annotate - [select for diffs], Sat May 18 17:08:09 2013 UTC (11 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.16: +3 -8 lines
Diff to previous 1.16 (colored)

Remove the variable sz because it's invariantly == 0,
along with the dead code testing whether it's positive.
Reported by Ulrich Spoerlein <uqs@spoerlein.net>,
found by Coverity Scan CID 975717.

While here, remove the now unused **params array as well,
which Coverity apparently missed, at least it wasn't reported...

Revision 1.16 / (download) - annotate - [select for diffs], Sun Sep 18 10:25:28 2011 UTC (12 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.15: +64 -25 lines
Diff to previous 1.15 (colored)

sync to version 1.11.5:
adding an implementation of the eqn(7) language
by kristaps@

So far, only .EQ/.EN blocks are handled, in-line equations are not, and
rendering is not yet very pretty, but the parser is fairly complete.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Apr 24 16:22:02 2011 UTC (13 years ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.14: +6 -1 lines
Diff to previous 1.14 (colored)

Merge version 1.11.1:
Again lots of cleanup and maintenance work by kristaps@.
- simplify error reporting: less function pointers, more mandoc_[v]msg
- main: split document parsing out of main.c into read.c
- roff, mdoc, man: improved recognition of control characters
- roff: better handling of if/else stack overflows
- roff: add some predefined strings for backward compatibility
- mdoc, man: empty sections are not errors
- mdoc: move delimiter handling to libmdoc
- some header restructuring and some minor features and fixes
This merge causes two minor regressions
that i will fix in separate commits right afterwards.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Mar 20 23:36:42 2011 UTC (13 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.13: +13 -1 lines
Diff to previous 1.13 (colored)

Import the foundation for eqn(7) support.
Written by kristaps@.

For now, i'm adding one line to each of the four frontends
to just pass the input text through to the output,
not yet interpreting any of then eqn keywords.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Feb 10 00:06:30 2011 UTC (13 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.12: +4 -5 lines
Diff to previous 1.12 (colored)

Tbl code maintenance by kristaps@.
- Remember the line-number of a tbl_span, and use it in messages.
- Put *_span_alloc() functions right into the *_addspan() ones,
  since these are the only places they are called from.

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 16 01:11:50 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +7 -2 lines
Diff to previous 1.11 (colored)

Various tbl improvements from kristaps@:
* horizontal lines do not consume layout lines
* skip excessive data cells
* prepare rendering of spanned cells
* support vertical spans

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jan 4 22:28:17 2011 UTC (13 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +93 -20 lines
Diff to previous 1.10 (colored)

Merge kristaps@' cleaner tbl integration, removing mine;
there are still a few bugs, but fixing these will be easier in tree.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Jul 13 01:09:13 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.9: +1 -2 lines
Diff to previous 1.9 (colored)

Merge release 1.10.4 (all code by kristaps@), providing four new features:
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.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Jun 29 17:10:30 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +5 -2 lines
Diff to previous 1.8 (colored)

Support for badly nested blocks, written around the time of
the Rostock mandoc hackathon and tested and polished since,
supporting constructs like:

.Ao Bo    Ac    Bc        (exp breaking exp)
.Aq Bo    eol   Bc        (imp breaking exp)
.Ao Bq    Ac    eol       (exp breaking imp)
.Ao Bo So Bc    Ac  Sc    (double break, inner before outer)
.Ao Bo So Ac    Bc  Sc    (double break, outer before inner)
.Ao Bo    Ac So Bc  Sc    (broken breaker)
.Ao Bo So Bc Do Ac  Sc Dc (broken double breaker)

There are still two known issues which are tricky:

1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol)
fails outright, triggering a bogus syntax error.
2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc
or Ao Ao Bq Ac Ac eol) still has a minor rendering error left:
"<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">".

We can fix these later in the tree, let's not grow this diff too large.

"get it in" kristaps@

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jun 27 21:54:42 2010 UTC (13 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored)

Full .nr nS support, unbreaking the kernel manuals.

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.

Revision 1.7 / (download) - annotate - [select for diffs], Sun May 23 22:45:01 2010 UTC (13 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +2 -1 lines
Diff to previous 1.6 (colored)

Unified error and warning message system for all of mandoc,
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@.

Revision 1.6 / (download) - annotate - [select for diffs], Tue Dec 22 23:58:00 2009 UTC (14 years, 4 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

sync to 1.9.12, mostly portability and refactoring:

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/

Revision 1.5 / (download) - annotate - [select for diffs], Wed Oct 21 19:13:51 2009 UTC (14 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +2 -1 lines
Diff to previous 1.4 (colored)

sync to 1.9.9, featuring:
 * -Thtml output mode
 * roff scaling units
 * and some minor fixes
for full changelogs, see http://bsd.lv/cgi-bin/cvsweb.cgi/

Revision 1.4 / (download) - annotate - [select for diffs], Mon Sep 21 20:57:57 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +3 -5 lines
Diff to previous 1.3 (colored)

sync to 1.9.5: make terminal_*, tree_* and out_* functions return void,
making the code simpler

Revision 1.3 / (download) - annotate - [select for diffs], Sat Aug 22 20:14:37 2009 UTC (14 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +16 -1 lines
Diff to previous 1.2 (colored)

Kristaps@ significantly overhauled libman.
I'm committing this in one large chunk because in contrast to -mdoc, -man
is mostly untested in OpenBSD anyway, so any fallout can be fixed in-tree.
Among others, improved support for .IP, .HP, and .TP.
Now in sync with release 1.9.0.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 14 23:00:57 2009 UTC (14 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.1: +11 -13 lines
Diff to previous 1.1 (colored)

sync to 1.7.16: comments, whitespace and spelling fixes; no functional change

Revision 1.1 / (download) - annotate - [select for diffs], Mon Apr 6 20:30:40 2009 UTC (15 years, 1 month ago) by kristaps
Branch: MAIN

Initial check-in of mandoc for formatting manuals. ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.