DH_SPHINXDOC(1)

πŸ’– DH_SPHINXDOC(1) β€” the debhelper girlie that fixes up ur Sphinx docs πŸ’–

okay so bestie, this is dh_sphinxdoc(1) from the Debhelper manual fam, and it is literally the most helpful little script when ur packaging Sphinx-generated documentation. no cap. let's get into it πŸ¦‹


✨ NAME ✨

dh_sphinxdoc β€” helps with packaging Sphinx-generated documentation πŸ’…


🌸 SYNOPSIS 🌸

dh_sphinxdoc [debhelper options] [-Xitem] [directory...]

πŸ‘‘ DESCRIPTION πŸ‘‘

dh_sphinxdoc is a debhelper program that gets Sphinx-generated documentation all cute and ready to be tucked into a Debian package. more specifically, here's the tea:

  • It checks if all the files referenced by searchindex.js actually exist. vibe check on ur search index fr fr πŸ”
  • It replaces known *.js files with symlinks pointing at /usr/share/javascript/sphinxdoc/, and it generates the ${sphinxdoc:Depends} substitution variable. slay πŸ’…
  • If the Sphinx RTD theme is in the mix, it swaps known files from that theme for symlinks to /usr/share/sphinx_rtd_theme/, and it adds sphinx-rtd-theme-common to ${sphinxdoc:Depends}. the theme got a glow-up ✨
  • It provides a ${sphinxdoc:Built-Using} substitution variable, for keeping track of files that just could not be symlinked 😭. examples of such files are *.js and *.css files that get generated from the corresponding *.js.jinja and *.css.jinja templates β€” these can vary depending on the theme options that were used (for instance, the basic.css file is generated from basic.css.jinja and is included in almost every Sphinx-generated documentation). Currently, this variable will contain sphinx and, if the default theme is used, alabaster, along with their versions (other themes are not supported, sorry bestie πŸ’€).
Note: in most cases you do not need this variable. Use it only if that is required by your license. See https://bugs.debian.org/1136263 for details.
  • It removes the .doctrees directory. bye girl πŸ‘‹
  • It removes the .buildinfo file. also bye 🫢
  • It removes the websupport.js file and *-stemmer.js files. gone, reduced to atoms πŸ’€

ngl, one thing to be super clear about: dh_sphinxdoc does not build the documentation. it only does all of the above operations once the documentation is already installed into the package build path. to actually build the docs, pls use the sphinx-build(1) command or the python3 -m sphinx syntax. that's a different girl's job πŸ™ˆ

and you can pass --with sphinxdoc to dh(1) so it automatically calls dh_sphinxdoc after dh_installdocs. automatic, iconic, obsessed πŸ’–


✨ OPTIONS ✨

  • directory β€” by default, dh_sphinxdoc scans ur package looking for directories that look like they contain Sphinx-generated documentation. But if you explicitly hand it one or more directories, then only those get processed. and if documentation is not found at directory, an error is raised. no docs, no vibes, error 🚨
  • -Xitem, --exclude=item β€” excludes files that contain item anywhere in their filename from being symlinked, removed, or checked for existence. like a little "not u, bestie" list πŸŽ€

πŸ› BUGS πŸ›

Symlinking translations.js is not supported. that's it, that's the bug note πŸ™ˆ


🌈 SEE ALSO 🌈

debhelper(7), dh(1).

This program is meant to be used together with debhelper. they're a package deal fr fr 🫢


πŸ’œ AUTHOR πŸ’œ

Jakub Wilk <jwilk@debian.org>


and that's the whole page bestie, go forth and package ur docs πŸ’…βœ¨

this page was brought to you by Debhelper, dated 2026-09-15. mwah πŸ’‹ πŸŽ€πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from