version 1.5, 2014/04/30 13:21:07 |
version 1.10, 2019/04/09 15:23:51 |
|
|
.Nd Convert DocBook refentry to mdoc |
.Nd Convert DocBook refentry to mdoc |
.Sh SYNOPSIS |
.Sh SYNOPSIS |
.Nm docbook2mdoc |
.Nm docbook2mdoc |
|
.Op Fl W |
.Op Ar file |
.Op Ar file |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
The |
The |
.Nm |
.Nm |
utility reads |
utility reads |
.Ar file |
.Ar file |
and |
and generates |
generates |
|
.Xr mdoc 7 |
.Xr mdoc 7 |
from the |
and |
.Aq refentry |
.Xr eqn 7 |
section of DocBook source, ignoring other sections. |
from the <refentry> section of DocBook source, ignoring other sections. |
If unspecified or |
If unspecified or |
.Ar \&- , |
.Sq Cm \- , |
.Ar file |
.Ar file |
is taken to be standard input. |
is taken to be standard input. |
|
.Pp |
The arguments are as follows: |
The arguments are as follows: |
.Bl -tag -width Ds |
.Bl -tag -width Ds |
.It Fl W |
.It Fl W |
Output non-fatal warning messages. |
Report warnings on standard error output, and if any occur, raise the |
|
.Sx EXIT STATUS |
|
to at least 2. |
.El |
.El |
.Pp |
.Pp |
.Nm |
.Nm |
Line 50 Some earlier DocBook constructs are accepted as well. |
|
Line 53 Some earlier DocBook constructs are accepted as well. |
|
SGML DocBook documents may be parsed unless they contain SGML-specific |
SGML DocBook documents may be parsed unless they contain SGML-specific |
constructs, such as empty end tags |
constructs, such as empty end tags |
.Li </> . |
.Li </> . |
The only non-DocBook construct recognised (and discarded) is |
The only non-DocBook constructs recognised are <xi:include\ /> |
.Aq xi:include \(sl . |
.Pq which is discarded |
|
and <mml:*>, which is accepted and converted to |
|
.Xr eqn 7 . |
.Sh EXIT STATUS |
.Sh EXIT STATUS |
.Ex -std |
The |
|
.Nm |
|
utility exits with one of the following values: |
|
.Bl -tag -width 2n |
|
.It 0 |
|
No error occurred, and if |
|
.Fl W |
|
was specified, no warning occurred either. |
|
.It 2 |
|
At least one warning occurred, but no error, and |
|
.Fl W |
|
was specified. |
|
.It 3 |
|
At least one parsing error occurred. |
|
.It 5 |
|
Invalid command line arguments were specified. |
|
No input files have been read. |
|
.It 6 |
|
Memory was exhausted. |
|
Parsing was aborted immediately. |
|
.El |
.Sh EXAMPLES |
.Sh EXAMPLES |
To pipe a DocBook document |
To pipe a DocBook document |
.Pa foo.xml |
.Pa foo.xml |
|
|
.Xr mandoc 1 |
.Xr mandoc 1 |
and a pager: |
and a pager: |
.Pp |
.Pp |
.Dl % docbook2mdoc foo.xml | mandoc | more |
.Dl $ docbook2mdoc foo.xml | mandoc -l |
|
.Sh DIAGNOSTICS |
|
Messages displayed by |
|
.Nm |
|
follow this format: |
|
.Pp |
|
.D1 Nm : Ar file : Ns Ar line : Ns Ar column : level : message |
|
.Pp |
|
The first three fields identify the |
|
.Ar file |
|
name, |
|
.Ar line |
|
number, and |
|
.Ar column |
|
number of the input file where the message was triggered. |
|
The line and column numbers start at 1. |
|
.Pp |
|
Message levels have the following meanings: |
|
.Bl -tag -width warning |
|
.It Sy fatal |
|
An operating system error occurred, typically memory exhaustion, |
|
and parsing was aborted immediately. |
|
.It Sy error |
|
Indicates a risk of information loss or severe misformatting, |
|
for example caused by unknown elements or missing include files. |
|
.It Sy warning |
|
Indicates a risk that the information shown or its formatting |
|
may mismatch the author's intent in minor ways. |
|
For example, mismatched or missing end tags are classified as warnings. |
|
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr mandoc 1 , |
.Xr mandoc 1 , |
|
.Xr eqn 7 , |
.Xr mdoc 7 |
.Xr mdoc 7 |
.Sh AUTHORS |
.Sh AUTHORS |
.Nm |
.Nm |
was written by |
was written by |
.Ar Kristaps Dzonsons , |
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv . |
.Mt kristaps@bsd.lv . |
|
.Sh CAVEATS |
.Sh CAVEATS |
The |
The |
.Nm |
.Nm |
utility is experimental. |
utility is experimental. |
As such, only a modest subset of the |
As such, only a modest subset of the <refentry> domain is accepted. |
.Aq refentry |
|
domain is accepted. |
|
.Pp |
.Pp |
The output |
The output |
.Xr mdoc 7 |
.Xr mdoc 7 |