Generate a Unix man page from the Jargon File so you can read it with
man jargon.
The script parses the Jargon File as distributed in GNU Info (Texinfo .info)
form — e.g. jarg400.info — and emits a single classic man(7)-macro page
covering the front matter, all ~2,000 lexicon entries, and the appendices.
The The New Hacker’s Dictionary / Jargon File is a historically evolving lexicon and cultural record of hacker, programmer, and Internet subculture slang, traditions, humor, and technical folklore originating from early academic computing communities such as MIT AI Lab and Stanford AI Lab.
Wikipedia: Jargon File (Wikipedia)
This script uses the debian-maintained jargon file, hosted at: https://salsa.debian.org/debian/jargon/-/tree/2420aed100bf9afb10c0f7eee965f64834dda003/
| Component | Needed for |
|---|---|
| Python ≥ 3.8 | running the script (standard library only, no deps) |
jarg400.info |
input — the 4.x Jargon File in Texinfo .info format |
groff / mandoc |
rendering the page (man already pulls one in) |
mandb or makewhatis |
building the whatis/apropos index (optional) |
The script itself imports only the Python standard library.
# render + install into a user-owned man directory
python3 jargon-mandoc.py jarg400.info --install
man jargon--install writes to ~/.local/share/man/man7/jargon.7. If man jargon
doesn’t find it, that directory isn’t on your man search path — see
Making man jargon resolve below.
python3 jargon-mandoc.py INPUT [INPUT ...] [options]
| Option | Effect |
|---|---|
INPUT |
one or more jarg*.info files (concatenated into one page) |
-o, --output-dir DIR |
directory to write jargon.7 into (default: ./jargon-man) |
--gzip |
also emit jargon.7.gz |
--install |
copy the page into ~/.local/share/man/man7 |
--install-dir DIR |
copy the page into DIR instead (implies install) |
All path arguments accept ~ and $VAR; they are expanded by the script even
when the shell leaves them literal (see Gotchas).
# just generate the page, inspect it, install nothing
python3 jargon-mandoc.py jarg400.info -o ./build
groff -man -Tutf8 ./build/jargon.7 | less -R
# generate a compressed copy as well
python3 jargon-mandoc.py jarg400.info -o ./build --gzip
# install system-wide (needs write access / sudo)
sudo python3 jargon-mandoc.py jarg400.info --install-dir /usr/local/share/man/man7A man page is found only if the directory above its manN/ subdirectory is
on the man search path. Pick the workflow matching your man implementation.
python3 jargon-mandoc.py jarg400.info --install
mandb ~/.local/share/man # index the directory you own
export MANPATH="$HOME/.local/share/man:$(manpath)" # add to ~/.profile etc.
man jargonmandocdb was renamed to makewhatis; use whichever your system ships.
python3 jargon-mandoc.py jarg400.info --install
makewhatis ~/.local/share/man # writes ~/.local/share/man/mandoc.db
export MANPATH="$HOME/.local/share/man:" # trailing ':' = append defaults
man jargonOverride the search path for a single invocation — no MANPATH, no database:
man -M ~/.local/share/man jargonmandoc’s man does a filesystem fallback search, so this works even before
you build an index. groff/man-db likewise accept -M.
man -l ./build/jargon.7 # man-db and recent mandoc
mandoc ./build/jargon.7 # mandoc, alwaysVerify resolution and indexing:
man -w jargon # prints the resolved path
whatis jargon # NAME line, from the database
apropos hacker # full-text search, from the databaseThe Info file stores the document as a flat list of nodes separated by the
byte 0x1f, each opening with a File:/Node:/Next:/Prev:/Up: header. Lexicon
entries are the nodes whose Up: field is a letter bucket (= A =, = B =,
…) and whose body begins with a :term: marker. The script keys off that
structure rather than guessing from prose.
- Headwords are set in bold;
{cross-references}are set in italic with their braces kept, so in-pager searches like/{foo}still work. - Lexicon bodies are rendered verbatim (
.nf/.fi, no-fill). The Jargon File is hand-wrapped at ~70 columns and full of ASCII art, aligned tables, and quoted code; reflowing would destroy that layout. The tradeoff is that art lines do not adapt to terminals narrower than 80 columns.
- Literal
~in--install-dir=...— the shell performs tilde expansion only when~is word-initial.--install-dir=~/manleaves the~literal;--install-dir ~/man(space) does not. The script expands either form, but if you ran an older copy and ended up with a directory literally named~, remove it withrm -ri ./~(the./prevents the shell from expanding it to your home directory). MANPATHsemantics differ slightly. Withmandoc, an empty element (leading/trailing colon) is replaced by the compiled-in default path, so"$HOME/.local/share/man:"means “mine first, then the defaults.”man-dbhonors the same convention;$(manpath)spells the defaults explicitly.man-dbdoes not auto-search~/.local/share/manunless that root is derivable from yourPATHor already inmanpath. SetMANPATHor install into a system man root.--gzipplus a plain copy in the same directory yields a duplicateapropos/whatishit, since the indexer reads bothjargon.7andjargon.7.gz. Keep only one.- Input format. The script targets the 4.x Texinfo
.infobuild. The older 2.x/3.x flat-text releases (jargXXX.txt) have no node structure and will not parse — the script reportsno Info nodes found.
The Jargon File is in the public domain. This script is provided as-is; treat it as public domain as well.