Commit 38ca25d6 authored by Fabian Wolff's avatar Fabian Wolff

Import Upstream version 2.11

parent 71af30fb
This diff is collapsed.
# Makefile for the doclifter project
VERS=2.7
VERSION=$(shell sed <doclifter -n -e '/^version *= *\(.*\)/s//\1/p')
MANDIR=/usr/share/man/man1
BINDIR=/usr/bin
DOCS = README COPYING TODO BUGS \
DOCS = README COPYING TODO PATCHES \
doclifter.xml doclifter.1 manlifter.xml manlifter.1
TEST = docliftertest1.man test.troff
SOURCES = doclifter manlifter Makefile $(DOCS) $(TEST) doclifter-logo.png
SOURCES = doclifter manlifter Makefile $(DOCS) tests/ doclifter-logo.png
all: doclifter-$(VERS).tar.gz
all: doclifter-$(VERSION).tar.gz
install: doclifter.1
cp doclifter $(BINDIR)
......@@ -28,28 +27,41 @@ doclifter.html: doclifter.xml
manlifter.html: manlifter.xml
xmlto xhtml-nochunks manlifter.xml
doclifter-$(VERS).tar.gz: $(SOURCES)
mkdir doclifter-$(VERS)
cp $(SOURCES) doclifter-$(VERS)
tar -czf doclifter-$(VERS).tar.gz doclifter-$(VERS)
rm -fr doclifter-$(VERS)
ls -l doclifter-$(VERS).tar.gz
doclifter-$(VERSION).tar.gz: $(SOURCES)
mkdir doclifter-$(VERSION)
cp -r $(SOURCES) doclifter-$(VERSION)
tar -czf doclifter-$(VERSION).tar.gz doclifter-$(VERSION)
rm -fr doclifter-$(VERSION)
ls -l doclifter-$(VERSION).tar.gz
test:
doclifter -v docliftertest1.man
doclifter-$(VERSION).md5: doclifter-$(VERSION).tar.gz
@md5sum doclifter-$(VERSION).tar.gz >doclifter-$(VERSION).md5
check:
@cd tests >/dev/null; make --quiet
PYLINTOPTS = --rcfile=/dev/null --reports=n --include-ids=y --disable="C0103,C0111,C0301,C0302,C0322,C0321,C0324,W0402,W0511,W0141,W0231,W0333,W0631,R0201,R0911,R0912,R0914,R0902,R0903,R0904,R0913,R0914,R0915"
pylint:
@pylint --output-format=parseable $(PYLINTOPTS) doclifter
pychecker:
@echo "Expect: Local variable (lst) not used"
@echo "Expect 4 warnings."
@ln -f doclifter doclifter.py
@-pychecker --only --quiet --limit 50 doclifter.py
@rm -f doclifter.py doclifter.pyc
dist: doclifter-$(VERS).tar.gz
dist: doclifter-$(VERSION).tar.gz
clean:
rm -f doclifter.html manlifter.html doclifter.1 manlifter.1 *.tar.gz
rm -f *.pyc docliftertest.xml
rm -f SHIPPER.* index.html
rm -f doclifter.html manlifter.html doclifter.1 manlifter.1
rm -f *.pyc docliftertest.xml foobar* fixed* *~ bugs.html
rm -f SHIPPER.* index.html *.tar.gz *.md5
release: doclifter-$(VERS).tar.gz doclifter.html manlifter.html
release: doclifter-$(VERSION).tar.gz doclifter-$(VERSION).md5 doclifter.html manlifter.html
shipper -u -m -t; make clean
# This is used only for updating the bugs page on my website.
# It won't work for anyone else.
update:
problemgen.py >bugs.html
scp -r bugs.html prepatch/ login.ibiblio.org:/public/html/catb/esr/doclifter
This diff is collapsed.
......@@ -11,9 +11,10 @@ This tool does the hard parts. TBL tables are translated into DocBook
table markup, PIC into SVG, and EQN into MathML (relying on pic2svg
and GNU eqn for the last two).
Test loads are included in the distribution. The code has been tested
in about the most brutal possible way; it has been run against every
single man page in all sections of a full Fedora Core installation.
It lifts over 95% of these pages without requiring any hand-hacking.
Test loads are included in the distribution; do "make check" to run
the regression tests. The code has been live tested in about the most
brutal possible way; it has been run against every single man page in
all sections of a desktop Ubuntu installation. It lifts over 93% of
these pages without requiring any hand-hacking.
There is a detailed change log in the NEWS file.
......@@ -3,22 +3,5 @@ Bugs:
* Docbook 5 translation is incomplete; inclusions won't work,
entities are untested.
* I haven't come up with a reliable way to distinguish command synopses
from stuff that should be treated as plain text. This has a couple
of consequences:
1. doclifter doesn't recognize command synopses in displays, only in
Synopsis sections.
2. When command synopses have a trailing text section (explanatory
paragraph) doclifter doesn't always detect that and cope well.
* .Xo/.Xc Berkeley macro needs work. See elf.5.
* Look at lwres_getaddrinfo.3 -- good type case for resuming function parse
after text. sox(1) and soxmix(1) show the same problem with command syntax.
* CA.pl.1ssl -- CA.pl is not properly tagged as a command.
See the BUGS file for other, more minor problems mainly due to bad markup.
See the PATCHES file for other, more minor problems mainly due to bad markup.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
'\" t
.\" Title: manlifter
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\" Date: 11/25/2010
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 06/01/2013
.\" Manual: Documentation Tools
.\" Source: manlifter
.\" Language: English
.\"
.TH "MANLIFTER" "1" "11/25/2010" "manlifter" "Documentation Tools"
.TH "MANLIFTER" "1" "06/01/2013" "manlifter" "Documentation Tools"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
......@@ -31,7 +31,7 @@
manlifter \- mass\-conversion script and test harness for doclifter
.SH "SYNOPSIS"
.HP \w'\fBmanlifter\fR\ 'u
\fBmanlifter\fR [\-d\ \fIoption\fR] [\-e] [\-f\ \fIlistfile\fR] [\-h] [\-I\ \fImandir\fR] [\-m] [\-o\ \fIoutdir\fR] [\-p\ \fIpatch\-directory\fR] [\-P] [\-q] [\-v] [\-s\ \fIsection\fR] \fIname\fR...
\fBmanlifter\fR [\-d\ \fIoption\fR] [\-e] [\-f\ \fIlistfile\fR] [\-h] [\-I\ \fImandir\fR] [\-m] [\-M] [\-o\ \fIoutdir\fR] [\-p\ \fIpatch\-directory\fR] [\-P] [\-q] [\-v] [\-s\ \fIsection\fR] [\-X\ \fIexclude\fR] \fIname\fR...
.HP \w'\fBmanlifter\fR\ 'u
\fBmanlifter\fR [\-S]
.SH "DESCRIPTION"
......@@ -41,10 +41,12 @@ is a script that sequences
\fBdoclifter\fR(1)
to convert an entire manual\-page tree to XML\-Docbook, optionally also generating HTML from the XML\&. Another use is as a torture\-test tool for doclifter; it logs errors to standard output and collects timings\&.
.PP
Called without any file arguments, manlifter tries to convert all man pages installed on the system, placing the resulting xml files under
Called without any file arguments, manlifter tries to convert all eligible man pages installed on the system, placing the resulting xml files under
xmlman
in the current directory\&. Each successfully translated page foo\&.N is copied to manN/foo\&.xml beneath the output directory, regardless of what source directory it came from\&.
.PP
A manual page is considered ineligible for batch conversion if it contains text indicating it has been generated from DocBook masters of from Doxygen\&.
.PP
For each source file examined, if the destination file exists and is newer than the source, the conversion is skipped; thus, incremental runs of
\fBmanlifter\fR
do the least work needed to keep the target XML tree up to date\&. Likewise, in \-h mode derived HTML files are only made when necessary\&.
......@@ -104,12 +106,17 @@ Specify the root of the manual\-page tree\&. By default this is
.PP
\-m
.RS 4
Make a patch to correct the last page fetched\&. It is copied, an editor is called on the copy (using tghe environment variable
Make a patch to correct the last page fetched\&. It is copied, an editor is called on the copy (using the environment variable
\fB$EDITOR\fR), and then
\fBdiff\fR(1)
is called to drop the patch in the prepatch directory\&. Fails with an error if such a patch is already present\&.
.RE
.PP
\-M
.RS 4
Lift the specified files, then do the equivalent of the \-m option\&.
.RE
.PP
\-o
.RS 4
Set the output directory into which XML\-DocBook translations will be dropped\&. By default this is
......@@ -158,6 +165,11 @@ logfile presented on standard input\&. This option will be of interest mainly to
developers\&.
.RE
.PP
\-X
.RS 4
In batch mode exclude pages listed in the argument file\&. Meant to be used for pages that are known good and take an extremely long time to lift, in order to cut down the time for a test run\&. (Most pages lift in less than a half second, but a few can take 15 minutes or longer\&.)
.RE
.PP
\fBmanlifter\fR
emits a logfile to standard output\&. The file begins with a timestamp line and a blank line, and ends with a line giving run time and various interesting statistics\&. Between these are stanzas, separated by blank lines, one for each file on which
\fBdoclifter\fR
......
......@@ -24,12 +24,14 @@
<arg choice='opt'>-h</arg>
<arg choice='opt'>-I <replaceable>mandir</replaceable></arg>
<arg choice='opt'>-m</arg>
<arg choice='opt'>-M</arg>
<arg choice='opt'>-o <replaceable>outdir</replaceable></arg>
<arg choice='opt'>-p <replaceable>patch-directory</replaceable></arg>
<arg choice='opt'>-P</arg>
<arg choice='opt'>-q</arg>
<arg choice='opt'>-v</arg>
<arg choice='opt'>-s <replaceable>section</replaceable></arg>
<arg choice='opt'>-X <replaceable>exclude</replaceable></arg>
<arg choice='plain' rep='repeat'><replaceable>name</replaceable></arg>
</cmdsynopsis>
<cmdsynopsis>
......@@ -47,13 +49,17 @@ for doclifter; it logs errors to standard output and collects
timings.</para>
<para>Called without any file arguments, manlifter tries to convert
all man pages installed on the system, placing the resulting xml files
all eligible man pages installed on the system, placing the resulting xml files
under <filename>xmlman</filename> in the current directory. Each
successfully translated page foo.N is copied to manN/foo.xml beneath
the output directory, regardless of what source directory it came
from.
</para>
<para>A manual page is considered ineligible for batch conversion if
it contains text indicating it has been generated from DocBook masters
of from Doxygen.</para>
<para>For each source file examined, if the destination file exists
and is newer than the source, the conversion is skipped; thus,
incremental runs of <command>manlifter</command> do the least work
......@@ -118,13 +124,18 @@ this is <filename>/usr/share/man</filename>.</para></listitem>
<varlistentry>
<term>-m</term>
<listitem><para>Make a patch to correct the last page fetched. It is
copied, an editor is called on the copy (using tghe environment
copied, an editor is called on the copy (using the environment
variable <envar>$EDITOR</envar>), and then
<citerefentry><refentrytitle>diff</refentrytitle><manvolnum>1</manvolnum></citerefentry>
is called to drop the patch in the prepatch directory. Fails with an
error if such a patch is already present.</para></listitem>
</varlistentry>
<varlistentry>
<term>-M</term>
<listitem><para>Lift the specified files, then do the equivalent of
the -m option.</para></listitem>
</varlistentry>
<varlistentry>
<term>-o</term>
<listitem><para>Set the output directory into which
XML-DocBook translations will be dropped. By default this is
......@@ -173,6 +184,15 @@ tree.</para></listitem>
This option will be of interest mainly to <command>doclifter</command>
developers.</para></listitem>
</varlistentry>
<varlistentry>
<term>-X</term>
<listitem><para>In batch mode exclude pages listed in the argument file.
Meant to be used for pages that are known good and take an extremely
long time to lift, in order to cut down the time for a test run. (Most
pages lift in less than a half second, but a few can take 15 minutes
or longer.)
</para></listitem>
</varlistentry>
</variablelist>
<para><command>manlifter</command> emits a logfile to standard
......
# Regression tests for doclifter
TESTLOADS := $(shell ls *.man | sed '/.man/s///')
test: regress
@echo "No output (other than a testfile stem name) is good news."
rebuild:
@for file in $(TESTLOADS); do \
echo "Remaking $${file}.chk"; \
../doclifter <$${file}.man >$${file}.chk 2>&1; \
done
regress:
@for file in $(TESTLOADS); do \
echo $${file}; \
if ../doclifter <$${file}.man >/tmp/regress$$; \
then diff -u $${file}.chk /tmp/regress$$; \
else echo "*** Nonzero return status on $${file}!"; exit 1; fi \
done
@rm -f /tmp/regress
What the various test loads are for:
basic.troff
Test translation of some low-level troff idioms.
capabilities.man:
Tests lists nested within .RS.
console_ioctl.man
Tests table and display processing.
corosync.conf.man
Tests recognition of a bare filename in the Synopsis section
docliftertest1.man
General test for many features, including section and paragraph
recognition and highlight mapping.
grap.man
Tests lists nested within .Bd/.Ed.
groff_char.man:
Tests recognition of every special chracter groff knows about.
pax.man
Test the kluge to avoid excess font closes in table entries.
stringwidth.man
Test a common evaluation case of the \w macro.
xoxc.man
Tests translation of .Xo/.Xc construct in BSD macros.
sudoers.man:
Tests the filename case in .Bl -literal.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!-- lifted from man+troff by doclifter -->
<refentry>
&lt;?xml version="1.0" encoding="ISO-8859-1" standalone="no"?&gt;
&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "<ulink url='http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd</ulink>"&gt;
&lt;svg version="1.1" baseProfile="full" id="body" width="8in" height="8in" viewBox="0 0 1 1" preserveAspectRatio="none" xmlns="<ulink url='http://www.w3.org/2000/svg'>http://www.w3.org/2000/svg</ulink>" xmlns:xlink="<ulink url='http://www.w3.org/1999/xlink'>http://www.w3.org/1999/xlink</ulink>" xmlns:ev="<ulink url='http://www.w3.org/2001/xml-events'>http://www.w3.org/2001/xml-events</ulink>"&gt;
&lt;title&gt;SVG drawing&lt;/title&gt;
&lt;desc&gt;This was produced by version 4.4 of GNU libplot, a free library for exporting 2-D vector graphics.&lt;/desc&gt;
&lt;rect id="background" x="0" y="0" width="1" height="1" stroke="none" fill="white"/&gt;
&lt;g id="content" transform="translate(0.45312,0.5) scale(1,-1) scale(0.125) " xml:space="preserve" stroke="black" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10.433" stroke-dasharray="none" stroke-dashoffset="0" stroke-opacity="1" fill="none" fill-rule="evenodd" fill-opacity="1" font-style="normal" font-variant="normal" font-weight="normal" font-stretch="normal" font-size-adjust="none" letter-spacing="normal" word-spacing="normal" text-anchor="start"&gt;
&lt;rect x="0" y="-0.25" width="0.75" height="0.5" stroke-width="0.0094118" /&gt;
&lt;text transform="translate(0.26306,-0.049028) scale(1,-1) scale(0.0069444) " font-family="Helvetica,sans-serif" font-size="20px" stroke="none" fill="black" &gt;box&lt;/text&gt;
&lt;/g&gt;
&lt;/svg&gt;
<refsect1><title>Description</title>
<para>This empty page was brought to you by brain damage somewhere in POD,
the Perl build system, or the Perl maintainers' release procedures.</para>
</refsect1>
</refentry>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!-- lifted from man+troff by doclifter -->
<refentry>
<refentryinfo><date>2011-09-28</date></refentryinfo>
<refmeta>
<refentrytitle>PRINTF</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo class='date'>2011-09-28</refmiscinfo>
<refmiscinfo class='source'>GNU</refmiscinfo>
<refmiscinfo class='manual'>Linux Programmer's Manual</refmiscinfo>
</refmeta>
<refnamediv>
<refname>printf</refname>
<refname>fprintf</refname>
<refname>sprintf</refname>
<refname>snprintf</refname>
<refname>vprintf</refname>
<refname>vfprintf</refname>
<refname>vsprintf</refname>
<refname>vsnprintf</refname>
<refpurpose>formatted output conversion</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsect1 id='description'><title>DESCRIPTION</title>
<para>This is a stripped manpage intended to test a common evaluation case
of the &bsol;w conditiol in groff.</para>
</refsect1>
<refsect1 id='example'><title>EXAMPLE</title>
<para>To print pi to five decimal places:</para>
</refsect1>
</refentry>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment