DEBIANDOC-SGML(1)
okay bestie, welcome to DEBIANDOC-SGML(1) from the DebianDoc-SGML Tools section of the manual π this is the whole vibe of the DebianDoc-SGML formatting squad, and yes we're gonna go through every single option together, no skipping, no cap π«Ά
β¨ NAME β¨
debiandoc-sgml β the whole overview of the DebianDoc-SGML formatting tools, like the group chat of the whole toolset π
π SYNOPSIS π
debiandoc2* [-h] [-b basename] [-X custom_dir] [-s script] [-c] [-C]
[-d declaration] [-e extension] [-k] [-l locale] [-n onsgmls_options]
[--] [source]
debiandoc2html [-L] [-X custom_dir] [-s script] [-m] [-t topname] [-1]
[shared options]
debiandoc2text [-O] [-X custom_dir] [-s script] [-m] [shared options]
debiandoc2textov [-O] [-X custom_dir] [-s script] [-m] [shared options]
debiandoc2latex [-O] [-X custom_dir] [-s script] [shared options]
debiandoc2latexdvi [-O] [-X custom_dir] [-s script] [-p papersize] [-v]
[shared options]
debiandoc2latexps [-O] [-X custom_dir] [-s script] [-p papersize] [-v]
[-1] [shared options]
debiandoc2latexpdf [-O] [-X custom_dir] [-s script] [-p papersize] [-v]
[shared options]
debiandoc2dvi [-O] [-X custom_dir] [-s script] [-p papersize] [-v]
[shared options]
debiandoc2ps [-O] [-X custom_dir] [-s script] [-p papersize] [-v] [-1]
[shared options]
debiandoc2pdf [-O] [-X custom_dir] [-s script] [-p papersize] [-v]
[shared options]
debiandoc2texinfo [-O] [-X custom_dir] [-s script] [shared options]
debiandoc2info [-X custom_dir] [-s script] [-v] [shared options]
debiandoc2dbk [-s script] [shared options]
debiandoc2wiki [-O] [-s script] [-m] [shared options]
π DESCRIPTION π
so like. DebianDoc-SGML is an SGML DTD and a lil family of formatting tools. these tools take your source β an SGML document that conforms to the DebianDoc-SGML DTD β and convert it into whatever output format you're feeling that day. it's giving versatile π
Every formatting tool debiandoc2foo sends its output to basename.extension, where basename is source with all the leading directory components stripped off and any trailing .sgml yeeted into the void. If source is -, then the input comes from standard input π₯. BUT β that - thing is not available with debiandoc2html, debiandoc2latexdvi, debiandoc2latexps, debiandoc2latexpdf, debiandoc2dvi, debiandoc2ps, debiandoc2pdf, debiandoc2info, and debiandoc2dbk. so don't even try it with those ones bestie π
debiandoc2htmlβ makes a whole subdirectorybasename.htmlstuffed with an HTML representation of your input, spread across a set of.htmlfiles. thetop levelpage is namedbasename.html/index.html. main character of the subdirectory fr β¨debiandoc2textβ produces a plain ASCII text filebasename.txt, formatted to a width of 79 columns. neat and tidy πdebiandoc2textovβ produces an ASCII text filebasename.tov, also formatted to a width of 79 columns, but with overstrikes for highlighting (using backspaces and repeated characters or underscores). it's the exact same ASCII text output style thattroffgenerates. retro but make it fashion πdebiandoc2latexβ produces an input filebasename.texfor the LaTeX typesetting system. you can use this to produce PostScript output and PDF output, two for the price of one πdebiandoc2latexdviβ produces a DVI filebasename.dvivia the LaTeX typesetting system. can be used to produce PostScript output π¦debiandoc2latexpsβ produces a PostScript filebasename.psvia the LaTeX typesetting system π«Άdebiandoc2latexpdfβ produces a PDF filebasename.pdfvia LaTeX typesetting system πdebiandoc2dviβ produces a DVI filebasename.dvi. currently this is done via the LaTeX typesetting system. can be used to produce PostScript output β¨debiandoc2psβ produces a PostScript filebasename.ps. currently this is done via the LaTeX typesetting system β¨debiandoc2pdfβ produces a PDF filebasename.pdf. currently this is done via the LaTeX typesetting system β¨debiandoc2texinfoβ produces an input filebasename.texinfofor the Texinfo documentation system. can be used to produce an Info file πdebiandoc2infoβ produces an Info filebasename.infovia the Texinfo documentation system πdebiandoc2dbkβ produces a subdirectorybasename.dbkcontaining a DocBook XML representation of your input in a set of.dbkfiles. thetop levelpage is namedbasename.dbk/index.dbk. and if you use the-1option, it instead produces abasename.dbkfile in the same directory, without creating a subdirectory. plot twist πdebiandoc2wikiβ produces a text filebasename.wiki, part of which may be used for creation of a Wiki page π
πΈ SHARED OPTIONS πΈ
these command line options are supported by ALL the formatting tools, so they're basically the friend group everyone shares π«Ά
-bbasename β use thebasenameyou gave instead of the default one. if you use this withdebiandoc2htmland hand it one or more directory components, thebasenameyou gave gets interpreted asbasename/prefix, wherebasenamenow consists of the directory components you provided. the resultingbasenamegets used exactly as described above. and theprefix? it becomes the prefix of the set of.htmlfiles holding the HTML representation of your input,top levelpage included π-cβ turns on content-negotiation with encoding suffix. this makes the generated output get namedbasename.language[.encoding].extension, based on the-loption argument. the optionalencodingpart only shows up when the-loption argument explicitly contains encoding. specifics matter bestie π-Cβ turns on content-negotiation without encoding suffix. this makes the generated output get namedbasename.language.extension, based only on the language part of the-loption argument. (good for UTF-8 locales such asfr.UTF-8.) π-ddeclaration β use thedeclarationyou gave instead of the default one (/usr/share/sgml/debiandoc/dtd/sgml/1.0/debiandoc.dcl). if you give it without any leading directory components, thedeclarationis assumed to live in one of the declaration directories in the SGML search paths π-eextension β use theextensionyou gave instead of the default one π-hβ print the help message on stdout π’-kβ keep the intermediate files in the directory alongside the output file(s). this includes files inonsgmls(1)'s output format:basename.saspandbasename.sasp-foo. for LaTeX based output this also includes the filesbasename.aux,basename.log,basename.texandbasename.toc, plus for PostScript output the filebasename.dvias well. and further β if the-Ooption and/or the-coption and/or the-eoption(s) are/is used to generate a DVI, a PDF or a PS file, then respectivelybasename.dvi,basename.pdforbasename.psis also an intermediate file. it's a whole collection, obsessed ποΈ-llocale β use thelocaleyou gave to localize the generated output. if you don't use this option, or you point at an unsupported locale, the localeenβ which is an alias ofen_US.ISO8859-1β gets used. for generic English UTF-8, useen.UTF-8instead. these get used as a part of the file name when the-cor-Coptions are used. for HTML, the content negotiation part of the file name is generated by changing the locale value, such as turningpt_BRinto a lower case one,pt-br. locale values such aspt-brare also accepted as an alias forpt_BR'to make build scripts cleaner. this makes non-HTML output use the same suffix as HTML. see/usr/share/perl5/DebianDoc_SGML/Locale/Alias.pmfor the exact locale names accepted (left side values) π-nonsgmls_options β pass theonsgmls_optionsyou gave directly on toonsgmls(1). may be used more than once, so go off π₯--β separates options from thesource, in case thesourcebegins with a hyphen. saving you from chaos, one dash at a time π
π SPECIFIC OPTIONS π
these command line options are only supported by some of the formatting tools (peep the synopsis above to see which tool supports which option) π
-1β generate one page for HTML output. for PostScript output, generate 1 page per page (default).
bestie, heads up: since 1 page per page is the default now, this option is deprecated and will likely be removed in the future. it's giving legacy π
-Lβ do not add<link>tags to the header of the generated HTML file(s) π«-mβ put the comments in footnote style in the output π-Oβ output to standard output instead of to the filebasename.extension. this is implied when input is taken from standard input π€-ppapersize β produce output in thepapersizeyou gave. seepapersize(5)for details π-Pβ add extra<p>tags to the regenerated SGML file(s) around<list>,<enumlist>,<taglist>,<example>, ... to work with Debiandoc SGML syntax π§©-sscript β apply thescriptyou gave on the intermediate.latexor.texinfofile before making further processing. (or apply thescriptyou gave on the generated file.)
the script gets called with its argument set to [ -l locale ] inputfile outputfile .
currently, the default value for this script hook for .tex file is set to /usr/share/debiandoc-sgml/fixlatex, which fixes Chinese Big5 encoding issues π¨π³
-Sβ use<sect1>,<sect2>,<sect3>, ... instead of the default<section>for DocBook XML conversion π-ttopname β use thetopnameyou gave (without extension) as the name of thetop levelpage instead of the default one π-vβ be verbose when invoking secondary processors such aslatexormakeinfo. it will tell you everything π£οΈ-xβ generate XHTML compliant HTML output β-Xcustom_dir. β you can change the locale dependent data directory from the default/usr/share/perl5/DebianDoc_SGML/Locale/to thecustom_dirdirectory by setting this option.
this may be used as a hook for a user to add new locale support, or to change the LaTeX header definition created by the debiandoc-sgml package, without having root access to the system. no sudo needed, we love that for you π«Ά
π DIAGNOSTICS π
error messages coming out of the validating SGML parser onsgmls(1) mean something is wrong with your source. make sure source conforms to the DebianDoc-SGML DTD, bestie, or it's gonna keep yelling at you π£
error messages coming out of saspconvert (an internally used script of the DebianDoc-SGML package) mean there's a problem with the package itself. please report those to the package maintainer via Debian's bug reporting system β that one's not your fault, it's a them problem π
if debiandoc2latexdvi, debiandoc2latexps, debiandoc2latexpdf, debiandoc2dvi, debiandoc2ps, debiandoc2pdf, or debiandoc2info hit an error while calling their secondary processors, they issue an appropriate error message and tell you to use the -v option to see the output generated by those secondary processors (and omg, it can be a LOT!). the latter three also tell you to check the log file basename.log π
if an error occurred, none of the already generated intermediate files get removed. they get removed on the next successful conversion of the same source by the same debiandoc2foo (unless you're using the -k option). so they just kinda... linger. iconic but messy π
π NOTES π
if debiandoc2foo is about to overwrite an already existing intermediate file, it issues an appropriate warning message (except for files in onsgmls(1)'s output format). see the description of the -k option for a complete overview of the intermediate files π
πΈ ENVIRONMENT πΈ
okay so there's literally one (1) environment variable in this whole situation and it's kind of a big deal if you care about dates, which β same.
DEBIANDOC_DATEβ if you set this, it overrides whatever the<date>tag would have spat out. like, the tag says one thing, the env var says another, and the env var WINS. periodt. if it's not defined,<date>just does its own thing, no drama. π
π BUGS π
bestie. sit down. we're doing the bugs section and it's giving "group project where everyone submitted their part separately." ngl it's a lot but it's all real so let's go one by one π«Ά
- someone should really write a program that converts the overstrikes that
debiandoc2textovgenerates from using backspaces to using carriage returns. like, that program does not exist yet. it's a whole missing thing. π - the paper size support in
debiandoc2latexdvi,debiandoc2latexps,debiandoc2latexpdf,debiandoc2dvi,debiandoc2ps, anddebiandoc2pdfis not complete. all six of them. incomplete. that's the vibe. π - when
debiandoc2htmlgets invoked with the-xoption to produce XHTML compliant code, the index format control features of<enumlist>will not work, and it just produces<enumlist>in the compact format instead. so like, you asked for index format control and the answer was no. π debiandoc2dbkcreates a usable DocBook XML file. to be clear, this is meant to be used as a tool to transform an existing DebianDoc SGML document into a DocBook XML document. that's its whole job description. π- the new XHTML feature of
debiandoc2htmlmay contain some bugs, but it improves XML conformance of HTML output. so like, tradeoffs, bestie. tradeoffs. β - the generated Wiki page text created by
debiandoc2wikiis meant to be used after manual reformatting. so don't just yeet it at a wiki and expect magic. you gotta touch it up first. π
not me listing six whole commands with incomplete paper size support π anyway it's documented, that's what counts
π SEE ALSO π
the required reading, the syllabus, the "you'll want these open in other tabs" section:
/usr/share/doc/debiandoc-sgml-doc/β DebianDoc-SGML documentation in SGML (= source), HTML, PDF and plain text format. (currently only the SGML DTD is described) β¨/usr/share/doc/sp/β OpenSP suite (which includes the validating SGML parseronsgmls) documentation in HTML format πbasename(1) β yeah just, basename. it's there. iconic. π
π¦ AUTHOR π¦
the legends themselves, no cap:
- Ardo van Rangelrooij
<ardo@debian.org>π - Ian Jackson (original version) π
- Osamu Aoki (XML converter, UTF-8 updates, etc.) π
and that's a wrap on the whole page, bestie!! this one came from the DebianDoc-SGML Tools, dated May 2008, and it lives at DEBIANDOC-SGML(1). go forth, read your SGML, validate your docs, and remember β <date> listens to DEBIANDOC_DATE first. mwah ππΈ
π¦ where this page comes from
- debian bookworm: debiandoc-sgml 1.2.32-2.1 Β· GPL-2.0-or-later
- debian trixie: debiandoc-sgml 1.2.32-2.1 Β· GPL-2.0-or-later
- ubuntu jammy: debiandoc-sgml 1.2.32-2.1 Β· GPL-2.0-or-later
- ubuntu noble: debiandoc-sgml 1.2.32-2.1 Β· GPL-2.0-or-later
- ubuntu resolute: debiandoc-sgml 1.2.32-3 Β· GPL-2.0-or-later
- ubuntu stonking: debiandoc-sgml 1.2.32-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms