CVS log for mandoc/mandoc_headers.3

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.33 / (download) - annotate - [select for diffs], Fri Mar 13 15:32:28 2020 UTC (4 months, 3 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.32: +57 -20 lines
Diff to previous 1.32 (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.32 / (download) - annotate - [select for diffs], Mon Jan 20 10:37:15 2020 UTC (6 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.31: +7 -3 lines
Diff to previous 1.31 (colored)

Make the code more readable by introducing
symbolic constants for tagging priorities.
This review also made me find a minor bug: do not upgrade
TAG_FALLBACK to TAG_WEAK when there is trailing whitespace.

Revision 1.31 / (download) - annotate - [select for diffs], Sun Mar 17 18:21:45 2019 UTC (16 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.30: +60 -41 lines
Diff to previous 1.30 (colored)

The header file "html.h" uses enum roff_tok,
so "roff.h" must be included before it.
Diff from bcallah@ tweaked by me;
he found the bug by compiling with pcc.

Revision 1.30 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.29: +46 -27 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Sun Dec 16 00:17:02 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.28: +4 -1 lines
Diff to previous 1.28 (colored)

Yet another round of improvements to manual font selection.

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.
In regress.pl, only strip leading whitespace in math mode.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Dec 14 06:33:14 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.27: +3 -27 lines
Diff to previous 1.27 (colored)

Cleanup, no functional change:
Now that message handling is properly encapsulated,
remove struct mparse pointers from four structs (roff, roff_man,
tbl_node, eqn_node) and from the argument lists of five functions
(roff_alloc, roff_man_alloc, mandoc_getarg, tbl_alloc, eqn_alloc).
Except for being passed to the main program as an opaque object,
it now only occurs in read.c, as it should, and not across 15 files
like in the past.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Dec 14 01:18:25 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.26: +10 -5 lines
Diff to previous 1.26 (colored)

Major cleanup; may imply minor changes in edge cases of error reporting.

Finally, drop support for the run-time configurable mandocmsg()
callback.  It was over-engineered from the start, never used for
anything in a decade, and repeatedly caused maintenance headaches.

Consolidate reporting infrastructure into two files, mandoc.h and
mandoc_msg.c, mopping up the bits and pieces that were scattered
around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes
of four parsing-related functions, and both parser structs.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:46 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.25: +58 -52 lines
Diff to previous 1.25 (colored)

Cleanup, no functional change:
Split the top level parser interface out of the utility header
mandoc.h, into a new header mandoc_parse.h, for use in the main
program and in the main parser only.
Move enum mandoc_os into roff.h because struct roff_man is the
place where it is stored.
This allows removal of mandoc.h from seven files in low-level
parsers and in formatters.

Revision 1.25 / (download) - annotate - [select for diffs], Thu Dec 13 07:30:21 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.24: +9 -13 lines
Diff to previous 1.24 (colored)

libmdoc.h no longer needs mdoc.h

Revision 1.24 / (download) - annotate - [select for diffs], Thu Dec 13 06:18:20 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.23: +16 -6 lines
Diff to previous 1.23 (colored)

Cleanup, no functional change:
Move the roffhash_*() functions from roff.h to roff_int.h
because they are only intended for use by parsers,
neither by main programs nor by formatters.

Revision 1.23 / (download) - annotate - [select for diffs], Thu Dec 13 05:23:38 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.22: +17 -5 lines
Diff to previous 1.22 (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.22 / (download) - annotate - [select for diffs], Thu Dec 13 03:40:13 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.21: +42 -33 lines
Diff to previous 1.21 (colored)

Cleanup, no functional change:
In libroff.h, nothing was left except the eqn(7) parser interface, which
isn't really part of the roff(7) parser, so rename it to eqn_parse.h.

While here, move struct eqn_def to eqn.c because that's the only
file using it, and let eqn_box_free() and eqn_free() handle NULL.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Dec 13 02:06:07 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.20: +62 -9 lines
Diff to previous 1.20 (colored)

Cleanup, no functional change:
Move tbl(7)-specific parser internals out of libroff.h.
Move some tbl(7)-internal processing from roff.c to tbl.c.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:35 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.19: +37 -13 lines
Diff to previous 1.19 (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.19 / (download) - annotate - [select for diffs], Fri Aug 24 23:12:33 2018 UTC (23 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.18: +0 -1 lines
Diff to previous 1.18 (colored)

Rudimentary implementation of the roff(7) .while request.
Needed for example by groff_hdtbl(7).

There are two limitations:
It does not support nested .while requests yet,
and each .while loop must start and end in the same scope.

The roff_parseln() return codes are now more flexible
and allow OR'ing options.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Jul 8 17:52:49 2017 UTC (3 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2
Changes since 1.17: +7 -17 lines
Diff to previous 1.17 (colored)

Simplify by creating struct roff_node syntax tree nodes for tbl(7)
right from roff_parseln() rather than delegating to read.c,
similar to what i just did for eqn(7).

The interface function roff_span() becomes obsolete and is deleted,
the former interface function roff_addtbl() becomes static,
the interface functions tbl_read() and tbl_cdata() become void,
and minus twelve linus of code.

No functional change.

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jul 8 14:51:04 2017 UTC (3 years ago) by schwarze
Branch: MAIN
Changes since 1.16: +4 -9 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Tue Jul 4 23:40:01 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.15: +1 -1 lines
Diff to previous 1.15 (colored)

various nits found with mandoc -Tlint

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jul 1 09:47:30 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.14: +11 -1 lines
Diff to previous 1.14 (colored)

Basic reporting of .Xrs to manual pages that don't exist
in the base system, inspired by mdoclint(1).

We are able to do this because (1) the -mdoc parser, the -Tlint validator,
and the man(1) manual page lookup code are all in the same program
and (2) the mandoc.db(5) database format allows fast lookup.

Feedback from, previous versions tested by, and OK jmc@.

A few features will be added to this in the tree, step by step.

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:32 2017 UTC (3 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.13: +6 -1 lines
Diff to previous 1.13 (colored)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 4 22:16:09 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.11: +16 -0 lines
Diff to previous 1.11 (colored)

Start roff formatter modules for HTML and termininal output,
used by both the mdoc and man formatters, with the ultimate
goal of reducing code duplication between the two macro formatters.
Made possible by the parser unification.
Add the first formatting function (for the .br request).

Revision 1.11 / (download) - annotate - [select for diffs], Sat Apr 29 12:45:41 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.10: +23 -6 lines
Diff to previous 1.10 (colored)

Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.9: +11 -0 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Thu Mar 30 22:22:05 2017 UTC (3 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.8: +5 -5 lines
Diff to previous 1.8 (colored)

delete documentation of some stuff that no longer exists,
mostly about SQLite3; noticed by Jan Stary <hans at stare dor cz>

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jul 7 19:19:01 2016 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13_4, VERSION_1_13
Changes since 1.7: +92 -84 lines
Diff to previous 1.7 (colored)

update developer documentation

Revision 1.7 / (download) - annotate - [select for diffs], Tue Oct 13 22:59:54 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +2 -19 lines
Diff to previous 1.6 (colored)

Major character table cleanup:
* Use ohash(3) rather than a hand-rolled hash table.
* Make the character table static in the chars.c module:
There is no need to pass a pointer around, we most certainly
never want to use two different character tables concurrently.
* No need to keep the characters in a separate file chars.in;
that merely encourages downstream porters to mess with them.
* Sort the characters to agree with the mandoc_chars(7) manual page.
* Specify Unicode codepoints in hex, not decimal (that's the detail
that originally triggered this patch).
No functional change, minus 100 LOC, and i don't see a performance change.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 2 23:48:19 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.5: +17 -8 lines
Diff to previous 1.5 (colored)

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

Revision 1.5 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:17 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.4: +17 -14 lines
Diff to previous 1.4 (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.4 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:50 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.3: +20 -4 lines
Diff to previous 1.3 (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.3 / (download) - annotate - [select for diffs], Fri Mar 27 17:37:25 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +10 -18 lines
Diff to previous 1.2 (colored)

Parse the new man.conf(5) "output" directive.
The next step will be to actually use the parsed data.

Revision 1.2 / (download) - annotate - [select for diffs], Sun Dec 21 14:14:35 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.1: +7 -4 lines
Diff to previous 1.1 (colored)

ISO C99 explicitly forbids forward references to enum types (6.7.2.3.3.);
patch from daniel@

Revision 1.1 / (download) - annotate - [select for diffs], Mon Dec 1 08:09:26 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2

developer documentation regarding header files

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.




CVSweb