History log of /openbsd-current/usr.bin/mandoc/manconf.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.9 21-Jul-2020 schwarze

undocumented options -O outfilename and -O tagfilename
to support regression testing without a tty;
no user visible change intended


Revision tags: OPENBSD_6_7_BASE
# 1.8 02-Apr-2020 schwarze

When the last file formatted yielded no tags, the tags file got
deleted before starting the pager, even when earlier input files
had written to it; thanks to weerd@ for reporting that bug.

Since we now generate tags for section headers, we almost always
generate at least some. Consequently, while fixing the above bug,
simplify the code by never deleting the tags file before the pager
exits, not even in the rare case that the file happens to be empty.
Hence, this patch is -75 +63 LOC even though it fixes two bugs.

While deleting the output files belongs after exit from the pager,
closing them should be done before it is started. Collect the
related code, which was scattered in various places, to where
it belongs, in a dedicated function in the term_tag.c module.
As a side benefit, never fclose(2) stdout, only dup2(2) to it.

Similarly, when the -O tag argument wasn't found in the last file
formatted, there was a complaint about "no such tag" even when the
argument did occur in earlier files. Fix that by looking for a
matching tag after every formatted file rather than just once at
the very end. Given that command line arguments aren't properties
of the file(s) being formatted, that check is a job for the main
program, not for the formatters, so while fixing the check, move
it from term_tag.c to main.c.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.7 22-Nov-2018 schwarze

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
output option -O tag[=term] to move right to the definition of "term" when
opening the manual page in a pager, effectively porting the -T html
fragment name feature - https://man.openbsd.org/ksh#ulimit - to the
terminal. Try:

$ man -O tag uvm_sysctl
$ man -O tag=ulimit ksh
$ man -O tag 3 compress

Feature development triggered by a question from kn@. Klemens also
tested, provided feedback that resulted in improvements, and provided
an OK.


Revision tags: OPENBSD_6_4_BASE
# 1.6 02-Oct-2018 schwarze

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.5 01-Jul-2017 schwarze

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 tags: OPENBSD_6_1_BASE
# 1.4 10-Feb-2017 schwarze

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


# 1.3 27-Jan-2017 schwarze

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.2 07-Nov-2015 schwarze

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.


Revision tags: OPENBSD_5_8_BASE
# 1.1 27-Mar-2015 schwarze

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


# 1.8 02-Apr-2020 schwarze

When the last file formatted yielded no tags, the tags file got
deleted before starting the pager, even when earlier input files
had written to it; thanks to weerd@ for reporting that bug.

Since we now generate tags for section headers, we almost always
generate at least some. Consequently, while fixing the above bug,
simplify the code by never deleting the tags file before the pager
exits, not even in the rare case that the file happens to be empty.
Hence, this patch is -75 +63 LOC even though it fixes two bugs.

While deleting the output files belongs after exit from the pager,
closing them should be done before it is started. Collect the
related code, which was scattered in various places, to where
it belongs, in a dedicated function in the term_tag.c module.
As a side benefit, never fclose(2) stdout, only dup2(2) to it.

Similarly, when the -O tag argument wasn't found in the last file
formatted, there was a complaint about "no such tag" even when the
argument did occur in earlier files. Fix that by looking for a
matching tag after every formatted file rather than just once at
the very end. Given that command line arguments aren't properties
of the file(s) being formatted, that check is a job for the main
program, not for the formatters, so while fixing the check, move
it from term_tag.c to main.c.


Revision tags: OPENBSD_6_5_BASE OPENBSD_6_6_BASE
# 1.7 22-Nov-2018 schwarze

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
output option -O tag[=term] to move right to the definition of "term" when
opening the manual page in a pager, effectively porting the -T html
fragment name feature - https://man.openbsd.org/ksh#ulimit - to the
terminal. Try:

$ man -O tag uvm_sysctl
$ man -O tag=ulimit ksh
$ man -O tag 3 compress

Feature development triggered by a question from kn@. Klemens also
tested, provided feedback that resulted in improvements, and provided
an OK.


Revision tags: OPENBSD_6_4_BASE
# 1.6 02-Oct-2018 schwarze

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.5 01-Jul-2017 schwarze

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 tags: OPENBSD_6_1_BASE
# 1.4 10-Feb-2017 schwarze

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


# 1.3 27-Jan-2017 schwarze

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.2 07-Nov-2015 schwarze

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.


Revision tags: OPENBSD_5_8_BASE
# 1.1 27-Mar-2015 schwarze

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


# 1.7 22-Nov-2018 schwarze

In -T locale (the default), -T ascii, and -T utf8 mode, provide a new
output option -O tag[=term] to move right to the definition of "term" when
opening the manual page in a pager, effectively porting the -T html
fragment name feature - https://man.openbsd.org/ksh#ulimit - to the
terminal. Try:

$ man -O tag uvm_sysctl
$ man -O tag=ulimit ksh
$ man -O tag 3 compress

Feature development triggered by a question from kn@. Klemens also
tested, provided feedback that resulted in improvements, and provided
an OK.


Revision tags: OPENBSD_6_4_BASE
# 1.6 02-Oct-2018 schwarze

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.5 01-Jul-2017 schwarze

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 tags: OPENBSD_6_1_BASE
# 1.4 10-Feb-2017 schwarze

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


# 1.3 27-Jan-2017 schwarze

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.2 07-Nov-2015 schwarze

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.


Revision tags: OPENBSD_5_8_BASE
# 1.1 27-Mar-2015 schwarze

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


# 1.6 02-Oct-2018 schwarze

Add an option -T html -O toc to add a brief table of contents near
the top of HTML pages containing at least two non-standard sections.
Suggested by Adam Kalisz and discussed with kristaps@ during EuroBSDCon 2018.


Revision tags: OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.5 01-Jul-2017 schwarze

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 tags: OPENBSD_6_1_BASE
# 1.4 10-Feb-2017 schwarze

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


# 1.3 27-Jan-2017 schwarze

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.2 07-Nov-2015 schwarze

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.


Revision tags: OPENBSD_5_8_BASE
# 1.1 27-Mar-2015 schwarze

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


Revision tags: OPENBSD_6_2_BASE
# 1.5 01-Jul-2017 schwarze

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 tags: OPENBSD_6_1_BASE
# 1.4 10-Feb-2017 schwarze

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


# 1.3 27-Jan-2017 schwarze

warn about invalid output options
and error out if they occur on the command line;
missing feature found in the TODO file


Revision tags: OPENBSD_5_9_BASE OPENBSD_6_0_BASE
# 1.2 07-Nov-2015 schwarze

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.


Revision tags: OPENBSD_5_8_BASE
# 1.1 27-Mar-2015 schwarze

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