LDPTOOL(1)
LDPTOOL π (section 1 of the manual, bestie)
okay so. hi. you've found ldptool, and honestly? she's the whole publishing pipeline and she knows it. pull up a chair π«Ά
β¨ NAME β¨
ldptool β DocBook, Linuxdoc and Asciidoc build/publishing tool. π
β¨ SYNOPSIS β¨
ldptool [options] [pathname [...]]
β¨ DESCRIPTION β¨
so basically: you hand ldptool a pathname and it will cook up chunked HTML, single-page HTML, PDF and plain text outputs for every source document you passed it. (peep Source document discovery below, it's important, iykyk.)
if you pass it no arguments at all, she doesn't sulk β she gathers up every directory you gave to --sourcedir and scans through them looking for valid source documents. β¨
what she actually does depends entirely on the options you passed. and if you passed nothing? then the default --build action gets attempted. periodt. the options that steer the whole program live in the Action options and Main options sections. everything else got yeeted to the tail of the manpage, because those are just configurables for the individual document processors. not the main character energy. π
here's everything ldptool can do:
- generate an inventory from multiple source directories (
--sourcedir) ποΈ - crawl through a single output collection (
--pubdir) - match the sources to the outputs (based on document stem name) π§
- describe the collection by type and status (
--summary) - list out individual document type and status (
--list) - describe supported source formats (
--formats) - describe the meaning of document status (
--statustypes) - build the expected (non-configurable) set of outputs (
--build) - build and publish the outputs (
--publish) π - produce runnable shell script to STDOUT (
--script) - generate configuration files that it can then take as input π
πΈ ACTION OPTIONS πΈ
-h,--helpβ shows you a help message and dips. that's it, that's the whole vibe. π-b,--buildβ builds LDP documentation into the--builddirand exits. this is the default action when you haven't specified any other one. no notes. β-p,--publishβ builds LDP documentation into the--builddir. then, if every build succeeded, she copies the result for each source document into the--pubdirβ which effectively replaces (and deletes π) the older documents. and finally, she removes--builddirif it's empty. she cleans up after herself, queen behavior. π-S,--scriptβ prints a runnablebashscript to STDOUT. it's basically a little shell script showing exactly what would get executed upon--build. like a trailer for the movie. π¬-l,--detail,--listβ examines the various SOURCEDIRs and the PUBDIR and generates a report showing the FORMAT of the source document and the STATUS of the document. add the--verboseflag for more info. π-t,--summaryβ examines the various SOURCEDIRs and the PUBDIR and generates a short report summarizing documents by STATUS and by DOCTYPE. add--verbosefor more. π-T,--doctypes,--formats,--format,--list-doctypes,--list-formatsβ lists the supported DOCTYPEs. there is exactly one processor for each DOCTYPE, no cap. π§--statustypes,--list-statustypesβ lists the possible document STATUS types. there are only seven basic status types, but several synonyms and groups of STATUS types (internally called 'classes'). so many little friend groups. π
π MAIN OPTIONS π
-s,--sourcedir,--source-dir,--source-directorySOURCEDIR (default:None) β specify the name of a SOURCEDIR which contains source documents. see also Source document discovery. ποΈ
the --sourcedir option may be used more than once. (go off, stack them.)
-o,--pubdir,--output,--outputdir,--outdirPUBDIR (default:None) β specify the name of a PUBDIR. it's used as the publication destination if the build succeeds. when--publishis used together with--pubdir, the output of a successful document build gets used to replace any existing document output directory in PUBDIR. π-d,--builddir,--build-dir,--build-directoryBUILDDIR (default:'ldptool-build') β specify the name of a BUILDDIR. this is a scratch directory used to build each source document; it's temporary and will be removed if the build succeeds AND--publishhas been requested. under the--buildaction though, all output directories and contents remain in the BUILDDIR for inspection. π--verbose[True | False] (default:False) β provides more information in the--listand--detailactions. you can throw this option in without an argument, which is equivalent toTrue. and to let the CLI supersede environment or configuration file values,--verbose falseis also supported. flexible queen. β¨--skip[STEM | DOCTYPE | STATUS] β specify a source document name, document type or document status to skip during processing. each document is known by its STEM (see also Source document discovery), its document DOCTYPE (list below), and by the document STATUS (list below).
the --skip option may be used more than once. π
DOCTYPE can be one of:
Asciidoc,Docbook4XML,Docbook5XML,DocbookSGML, orLinuxdoc(see also output of--doctypes)
STATUS can be one of:
source,sources,output,outputs,published,stale,broken,new orphan,orphans,orphaned,problems,work,all(see also output of--statustypes)
--resourcesRESOURCEDIR (default:['images', 'resources']) β some source documents provide images, scripts and other content. these files are usually stored in a directory such as./images/that need to be copied intact into the output directory. adjust the set of resource directories with this option. π
the --resources option may be used more than once.
--loglevelLOGLEVEL (default:ERROR) β set the loglevel to LOGLEVEL. it can be passed as numeric or textual; in increasing order:CRITICAL(50),ERROR(40),WARNING(30),INFO(20),DEBUG(10). N.B. the text names are not case-sensitive:'info'is OK. π₯-c,--configfile,--config-file,--cfgCONFIGFILE (default:None) β specify the name of a CONFIGFILE containing parameters to be read for this invocation; an INI-style configuration file. a sample can be generated with--dump-cfg. and even though only one CONFIGFILE can be specified via the environment or the command-line, the system config file (/etc/ldptool/ldptool.ini) is always read. always. she never skips it. π--dump_cli,--dump-cliβ produce the resulting, merged configuration as in CLI form. (after processing all configuration sources: defaults, system configuration, user configuration, environment variables, command-line.)--dump_env,--dump-envβ produce the resulting, merged configuration as a shell environment file.--dump_cfg,--dump-cfgβ produce the resulting, merged configuration as an INI-configuration file.--debug_options,--debug-optionsβ provides lots of debugging information on option-processing; see also--loglevel debug. π
π¦ SOURCE DOCUMENT DISCOVERY π¦
almost every documentation format out there allows a document to span multiple files. and like, more than half of the LDP document collection is single-file HOWTO contributions, but there are also a bunch of documents composed of dozens, even hundreds of files. π
so to handle both the lil baby single-file docs and these absolute units, LDP adopted a simple (unoriginal, bestie, they said it not me) naming strategy so one document can span multiple files:
each document is referred to by a stem, which is the filename without any extension. a single file document is simpleSTEM.EXT. a document that requires many files must be contained in a directory with the STEM name. therefore, the primary source document will always be called eitherSTEM.EXTorSTEM/STEM.EXT. π§ β¨
(if there's a STEM/STEM.xml and a STEM/STEM.sgml in the same directory, that is an error, and ldptool will freak out and shoot pigeons. ποΈπ not a drill.)
during document discovery, ldptool walks through all of the source directories specified with --sourcedir and builds a complete list of all identifiable source documents. then she walks through the publication directory --pubdir and matches up each output directory (by its STEM) with the corresponding STEM found in one of the source directories. π
then ldptool can figure out whether any source files are newer. she uses content-hashing, i.e. MD5, and if a source file is newer, the status is stale. if there's no matching output, the source file is new. if there's an output with no source, that one's an orphan. π₯Ί see the --statustypes output for the full list of STATUS types.
β EXAMPLES β
to build and publish a single document:
$ ldptool --publish DocBook-Demystification-HOWTO
$ ldptool --publish ~/vcs/LDP/LDP/howto/docbook/Valgrind-HOWTO.xml
to build and publish anything that is new or updated work:
$ ldptool --publish
$ ldptool --publish work
to (re-)build and publish everything, regardless of state:
$ ldptool --publish all
to generate a specific output (into a --builddir):
$ ldptool --build DocBook-Demystification-HOWTO
to generate all outputs into a --builddir (should exist):
$ ldptool --builddir ~/tmp/scratch-directory/ --build all
to build new/updated work, but pass over a trouble-maker:
$ ldptool --build --skip HOWTO-INDEX
to loudly generate all outputs, except a trouble-maker:
$ ldptool --build all --loglevel debug --skip HOWTO-INDEX
to print out a shell script for building a specific document:
$ ldptool --script TransparentProxy
$ ldptool --script ~/vcs/LDP/LDP/howto/docbook/Assembly-HOWTO.xml
π ENVIRONMENT π
ldptool accepts configuration via environment variables. all of these environment variables are prefixed with LDPTOOL_. every single one. π
the name of each variable is constructed from the primary command-line option name. so -b is better known as --builddir, which means the environment variable is LDPTOOL_BUILDDIR. similarly, the environment variable names for each of the handlers can be derived from the name of the handler and its option. for example, the Asciidoc processor needs to have access to the xmllint and asciidoc utilities. π§
so the environment variable corresponding to the CLI option --asciidoc-xmllint would be LDPTOOL_ASCIIDOC_XMLLINT. and similarly, --asciidoc-asciidoc should be LDPTOOL_ASCIIDOC_ASCIIDOC. slay.
variables that accept multiple options use the comma as a separator:
LDPTOOL_RESOURCES=images,resources
and if you want the complete listing of possible environment variables with all current values, just run ldptool --dump-env. π
π CONFIGURATION FILE π
okay so bestie, there's a whole config file situation and honestly it's giving organized queen energy. The system-installed one lives at /etc/ldptool/ldptool.ini. β¨
The format? It's a simple INI-style config file β one block for the main program, and then one block for each handler. Very demure, very mindful. Here's a partial example so you can see the vibe:
[ldptool]
resources = images,
resources
loglevel = 40
[ldptool-asciidoc]
asciidoc = /usr/bin/asciidoc
xmllint = /usr/bin/xmllint
Note that the comma separates multiple values for a single option (like resources up there in that config fragment, bestie β one option, many values, she contains multitudes π
).
And if you wanna see the complete, current configuration file? Just hit ldptool --dump-cfg. It prints the whole thing for you. Obsessed. π
π¦ CONFIGURATION OPTION FRAGMENTS FOR EACH DOCTYPE HANDLER π¦
So here's the tea: every source format has a single handler, and each DOCTYPE handler might need a different set of executables and/or data files to do its job. The defaults depend on the platform and get detected at runtime. πΈ
In most cases the commands live in /usr/bin (see below, bestie). The data files β like the LDP XSL files and the docbook.rng β may live in different places on different systems. It's giving "it depends" but make it filesystem. π«Ά
If a given DOCTYPE handler can't find all of its requirements, it will complain to STDERR during execution β but it will NOT abort the rest of the run. So she'll throw a lil tantrum and then keep going. Resilient icon. π
And if for some reason ldptool can't find data files but you know where they are? Consider generating a configuration file with the --dump-cfg option, adjusting the relevant options, and then passing --configfile your.ini to specify these paths. Problem solved, no cap. β¨
π ASCIIDOC
--asciidoc-asciidoc PATHβ full path toasciidoc[/usr/bin/asciidoc]--asciidoc-xmllint PATHβ full path toxmllint[/usr/bin/xmllint]
N.B. The Asciidoc processor simply converts the source document to a Docbook4XML document and then uses the richer Docbook4XML toolchain. So it's lowkey just handing you off to the fancier sibling. π
π₯ DOCBOOK4XML
--docbook4xml-xslchunk PATHβ full path to LDP HTML chunker XSL--docbook4xml-xslsingle PATHβ full path to LDP HTML single-page XSL--docbook4xml-xslprint PATHβ full path to LDP FO print XSL--docbook4xml-xmllint PATHβ full path toxmllint[/usr/bin/xmllint]--docbook4xml-xsltproc PATHβ full path toxsltproc[/usr/bin/xsltproc]--docbook4xml-html2text PATHβ full path tohtml2text[/usr/bin/html2text]--docbook4xml-fop PATHβ full path tofop[/usr/bin/fop]--docbook4xml-dblatex PATHβ full path todblatex[/usr/bin/dblatex]
π DOCBOOK5XML
--docbook5xml-xslchunk PATHβ full path to LDP HTML chunker XSL--docbook5xml-xslsingle PATHβ full path to LDP HTML single-page XSL--docbook5xml-xslprint PATHβ full path to LDP FO print XSL--docbook5xml-rngfile PATHβ full path todocbook.rng--docbook5xml-xmllint PATHβ full path toxmllint[/usr/bin/xmllint]--docbook5xml-xsltproc PATHβ full path toxsltproc[/usr/bin/xsltproc]--docbook5xml-html2text PATHβ full path tohtml2text[/usr/bin/html2text]--docbook5xml-fop PATHβ full path tofop[/usr/bin/fop]--docbook5xml-dblatex PATHβ full path todblatex[/usr/bin/dblatex]--docbook5xml-jing PATHβ full path tojing[/usr/bin/jing]
πΈ DOCBOOKSGML
--docbooksgml-docbookdsl PATHβ full path tohtml/docbook.dsl--docbooksgml-ldpdsl PATHβ full path toldp/ldp.dsl[None]--docbooksgml-jw PATHβ full path tojw[/usr/bin/jw]--docbooksgml-html2text PATHβ full path tohtml2text[/usr/bin/html2text]--docbooksgml-openjade PATHβ full path toopenjade[/usr/bin/openjade]--docbooksgml-dblatex PATHβ full path todblatex[/usr/bin/dblatex]--docbooksgml-collateindex PATHβ full path tocollateindex
β LINUXDOC
--linuxdoc-sgmlcheck PATHβ full path tosgmlcheck[/usr/bin/sgmlcheck]--linuxdoc-sgml2html PATHβ full path tosgml2html[/usr/bin/sgml2html]--linuxdoc-html2text PATHβ full path tohtml2text[/usr/bin/html2text]--linuxdoc-htmldoc PATHβ full path tohtmldoc[/usr/bin/htmldoc]
π AUTHOR π
Martin A. Brown <martin@linux-ip.net> β king behavior, honestly. π
π COPYRIGHT π
Manual page (C) 2016, Linux Documentation Project β¨
and that's the whole page, bestie!! π¦ this manual page is version 1.9.2, dated Jul 13, 2017, and it's the LDPTOOL(1) page β go forth and document, you absolute icon π
β¨
π¦ where this page comes from
- ubuntu jammy: python3-tldp 0.7.13-1ubuntu1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms