JW(1)

πŸ“¦ version 0.6.15, in arch rolling

πŸ’… JW(1) β€” the jw page, bestie

okay so this is the manual page for jw (and its whole lil friend group of docbook2* scripts) β€” section 1 of the manual, for when you literally just need to know how to turn SGML into something else. no cap, it's a lot, but we're gonna get through it together 🫢


✨ NAME ✨

jw, docbook2dvi, docbook2html, docbook2man, docbook2pdf, docbook2ps, docbook2rtf, docbook2tex, docbook2texi, docbook2txt β€” (Jade Wrapper) converts SGML files to other formats. yep, that's the whole vibe: SGML in, other formats out πŸ’…


🌸 SYNOPSIS 🌸

like, the actual shapes of the commands, fr fr:

jw [ -f frontend | --frontend frontend ]
    [ -b backend | --backend backend ]
    [ -c file | --cat file ]
    [ -n | --nostd ]
    [ -d file|default|none | --dsl file|default|none ]
    [ -l file | --dcl file ]
    [ -s path | --sgmlbase path ]
    [ -p program | --parser program ]
    [ -o directory | --output directory ]
    [ -V variable[=value] ]
    [ -u | --nochunks ] [ -i section | --include section ]
    [ -w type|list | --warning type|list ]
    [ -e type|list | --error type|list ]
    [ -h | --help ] [ -v | --version ]
    SGML-file

and then the lil shortcut besties, each one just takes an SGML-file and that's it:

docbook2dvi SGML-file
docbook2html SGML-file
docbook2man SGML-file
docbook2pdf SGML-file
docbook2ps SGML-file
docbook2rtf SGML-file
docbook2tex SGML-file
docbook2texi SGML-file
docbook2txt SGML-file

πŸ¦‹ DESCRIPTION πŸ¦‹

so the jw shell script is literally the moment where you convert a DocBook file (or honestly some other SGML-based format, it's flexible like that) into other formats β€” and yes, that includes HTML, RTF, PS and PDF β€” all with an easy-to-understand syntax ✨. it hides most of Jade's or OpenJade's complexity from you and adds comfortable features on top. she's an icon, she's a legend, and she's the moment πŸ‘‘

other scripts like docbook2html, docbook2rtf or docbook2ps give you different ways of calling jw that might be easier to remember. same brain, cuter nicknames πŸ’–

important vibe check: for the moment, jw does not handle XML β€” only SGML. periodt. XML girlies have to wait πŸ™ˆ

this utility assumes that several other components are installed. the list includes:

  • the ISO character entities for SGML
  • James Clark's DSSSL engine, jade, or an equivalent parser like OpenJade
  • the DocBook DTD from the OASIS consortium
  • Norman Walsh's DocBook modular style sheets (or some other set of DSSSL style sheets)
  • Sebastian Rahtz's jadetex set of TeX macros for jade (for backends intended to "printing" formats like PDF, RTF or PostScript)
  • A perl interpreter (for backends that use perl)
  • SGMLSpm from CPAN (for backends that use sgmls)
  • Lynx HTML browser (for the txt backend)

the jw script is basically called like this:

jw mydoc.sgml

where mydoc.sgml is a SGML file. that's it, that's the tweet 🐦

the command line above uses default options: it converts from DocBook (the default frontend) to HTML (the default backend), does not put the result in a subdirectory (unless specified otherwise in the style sheets), etc. lowkey gorgeous, zero effort 🌈

in this example, the "mydoc" file name as well as the ".sgml" extension can be replaced by anything else. current extensions for SGML DocBook files include .sgml, .sgm, .docbook, and .db β€” so pick your fave, they're all valid πŸ’…. the processed file mydoc.sgml can be in any other directory than the current one, no stress.

here we have chosen to generate HTML output. in fact we can use any of the backends stored in the backends/ subdirectory of the DocBook-utils distribution directory (usually /usr/share/sgml/docbook/utils-0.6.15). similarly, you can use any frontend defined in the frontends/ subdirectory to convert from another input format. it's giving build-your-own-adventure 🧚

this sample command creates one or many HTML files with arbitrary file names in the current directory. this default behavior can be changed through command line options and/or customization style sheets. so like, it's the default, not a cage πŸ”“


πŸŽ€ OPTIONS πŸŽ€

the following options apply to the conversion script:

  • -f frontend, --frontend frontend β€” lets you specify another frontend than the default docbook. the list of currently available frontends is:
    • docbook β€” converts docbook with Norman Walsh's style sheets. this frontend searches in the subdirectories of the base SGML directory for a file named html/docbook.dsl or print/docbook.dsl (depending on the backend's type: html or print). slay, she knows where her stuff lives.
  • -b backend, --backend backend β€” lets you specify another backend than the default HTML. the list of currently available backends is:
    • dvi β€” converts to DVI (DeVice Independant files) by calling Jade or OpenJade.
    • html β€” converts to HTML (HyperText Markup Language) by calling Jade or OpenJade.
    • man β€” converts a refentry to a Unix manual page by calling docbook2man. does not work with other SGML document types than DocBook.
    • pdf β€” converts to PDF (Portable Document Format) by calling Jade or OpenJade.
    • ps β€” converts to PostScript by calling Jade or OpenJade.
    • rtf β€” converts to RTF (Rich Text Format) by calling Jade or OpenJade. the resulting file can then be inported into MS Word or one of its Linux replacement programs.
    • tex β€” converts to TeX by calling Jade or OpenJade.
    • texi β€” converts to GNU TeXinfo pages by calling docbook2texi. does not work with other SGML document types than DocBook.
    • txt β€” converts to a bare text file by calling Jade or OpenJade, then Lynx.
  • -c file, --cat file β€” lets you use an extra SGML Open Catalog that will list other files like customization style sheets, adaptations to the DocBook Document Type Definition, special character entities, etc. this catalog is added to the list of catalogs determined by the script (see option --nostd below). it's the "and also this" of catalogs 🫢
  • -n, --nostd β€” do not use the standard SGML Open Catalogs. normally, the standard catalogs list is determined like this:
    • if the centralized catalog exists, then use it. the centralized catalog is a list of all catalogs that might be necessary that usually resides in /etc/sgml. its name is provided by the frontend β€” for example the docbook frontend returns /etc/sgml/sgml-docbook.cat.
    • otherwise, take all the files named catalog from the subdirectories of the SGML base directory (usually /usr/share/sgml).

this option is useful in conjunction with the --cat option to use only the catalogs that are specified on the command line. chaos mode: hand-picked only πŸ’€

  • -d file|default|none, --dsl file|default|none β€” lets you use a customized style sheet instead of the default one. here's the tea:
    • a "target" starting with a hash mark # can be appended to the file name. as a result, only the corresponding part of the style sheet is executed (the "style specification" whose "identificator" is equal to the target's name). a common use of this mechanism is to define #html and #print targets to trigger the corresponding part of a replacement style sheet which is common for both HTML and printout conversion. iykyk 🎯
    • by replacing the file name with "default", the default style sheet provided with the frontend is used. for example, the docbook frontend returns ./docbook.dsl#html (or ./docbook.dsl#print) in the SGML base directory.
    • by replacing the file name with "none", no replacement style sheet is used, not even the default style sheet. the style sheet which is used is also determined by the frontend. for example, the docbook frontend returns Norman Walsh's html/docbook.dsl (or print/docbook.dsl) found somewhere below the SGML base directory.

if no --dsl option is specified, then --dsl default is used. so like, she's got a default, she's not gonna leave you hanging πŸ’–

  • -l file, --dcl file β€” lets you use a customized SGML declaration instead of the default one. the file name of the default SGML declaration is not set for SGML files, and is set to xml.dcl in the SGML base directory for XML files. noted, memorized, tattooed πŸ“
  • -s path, --sgmlbase path β€” lets you use another location for the SGML base directory. this is the directory below which all SGML DTDs, style sheets, entities, etc are installed. the default value is /usr/share/sgml. relocate her, she'll thrive πŸ¦‹
  • -p program, --parser program β€” specify the parser to use (Jade or OpenJade) if several are installed. if this option is not specified, the script first tries to use Jade, then it tries OpenJade. girl's got a priority list and she's sticking to it πŸ‘‘
  • -o directory, --output directory β€” set output directory where all the resulting files will be stored. if the style sheets define a subdirectory where to store the resulting files too, the subdirectory defined by the style sheets will be placed below the subdirectory defined by this option. nesting era πŸͺ†
  • -V variable=[value] β€” set a variable (to a value, if one is specified). short, sweet, sets your variable πŸ’œ
  • -u, --nochunks β€” output only one big file. this option is useful only when generating HTML, because the output can be split into several files. this option overrides the setting that may be done in the style sheets. one big file, main character energy, no little siblings πŸ”₯
  • -i section, --include section β€” declare a SGML marked section as "include". a SGML marked section is a kind of conditional part of a document. if it is declared "ignore", it will be left ignored, otherwise it will be processed. an example of such a marked section would be:
<DOCTYPE mydoc [
  <!ENTITY % confidential "ignore">
]>
<mydoc>
  ...
  <![ %confidential [ Some confidential text... ]]>
  ...
</mydoc>

yeah, that's the conditional-text situation. very "you don't see this" of it πŸ™ˆ

  • -w type|list, --warning type|list β€” enables or disables the display of given types of warnings. several -w options might be entered on the command line. warning types that start with no- disable the corresponding warnings, the other types enable them. if the warning type is replaced with "list", then a list of allowed warning types is displayed. so you can literally just ask for the list, no guessing 🌸
  • -e type|list, --error type|list β€” disables given types of errors. several -e options might be entered on the command line. all error types start with no-. if the error type is replaced with "list", then a list of allowed error types is displayed. errors? silenced. (only the ones you name, bestie, don't get too excited) πŸ’€
  • -h, --help β€” print a short help message and exit. the classic cry for help, works every time 🫢
  • -v, --version β€” print the version identifier and exit. know your queen's birthday ✨

🌈 FILES 🌈

  • /etc/sgml/sgml-docbook.cat β€” centralized SGML open catalog. this file name might vary if another frontend than docbook is used.
  • /usr/share/sgml/docbook/utils-0.6.15/backends β€” the various backends
  • /usr/share/sgml/docbook/utils-0.6.15/frontends β€” the various frontends
  • /usr/share/sgml/docbook/utils-0.6.15/helpers β€” the various helper scripts like docbook2man or docbook2texi

⭐ AUTHORS ⭐

Eric Bischoff (jw shell script and a few backends), Jochem Huhmann (the man and texi backends). legends, both of them, no notes πŸ‘‘

✨ SEE ALSO ✨

okay bestie, you're not alone in this πŸ’– the docbook-utils girlies are all connected, and these are the siblings you'll wanna go visit next:


and that's the whole page, bestie!! 🫢 no cap, you ate that. this one's wrapping up on 05 December 2025, and it's the JW(1) page you've been reading β€” consider this your cute little sign-off, mwah πŸ’…βœ¨

πŸ“¦ where this page comes from