DH_DOC_PRIVACY(1)
β¨ DH_DOC_PRIVACY β the dh_doc_privacy glow-up β¨
okay bestie so this is a Debhelper Commands girlie, she lives in section 1 of the manual, and her whole personality is: yeeting remote stuff out of your docs before your docs get shipped. let's get into it π
πΈ NAME πΈ
dh_doc_privacy β removes those remotely hosted assets from your package documentation, no cap π§Ήβ¨
π DESCRIPTION π
So here's the tea: this debhelper command removes remotely hosted assets from documentation before the documentation gets converted to HTML or installed under /usr/share/doc. π«Ά
Why do we care? Because she is intended to stop installed documentation from triggering network requests for badges, embedded widgets, or tracking scripts when somebody opens it in a web browser. like... no phone-home energy in my /usr/share/doc, thank you very much. π
The command rewrites matching files in place. and when a file gets modified during a package build, its original content is stored so that dh_clean can restore it from debian/.debhelper/. that's the safety net, bestie, she's got you π₯Ί
here's the usage, verbatim, because she's iconic and we don't mess with her:
usage: dh_doc_privacy [-h] [-X PATTERN] [--no-act] [--verbose]
[--version] [--sourcedir DIR] [-a] [-i] [-p PACKAGE] [-N PACKAGE]
[-P DIR] [--remaining-packages] [PATH ...]
tl;dr of what she does: Remove remote badge images, iframes, and tracking scripts from documentation files before they are shipped in a Debian package. π§Ό
By default the command scans the top-level README.md, README.rst, and README.html files. You can also pass explicit files or directories to process. sky's the limit, kind of π
π positional arguments π
PATHβ file or directory to process; defaults to top-level README files
π options π
-h,--helpβ show this help message and exit-X,--excludePATTERN β skip files whose path contains PATTERN; may be specified multiple times (stack 'em, queen π)--no-act,-nβ report files that would be changed without modifying them (a vibe check, not a makeover π)--verbose,-vβ print a message for each file that is examined or changed (she's chatty, we love her π£οΈ)--versionβ show program's version number and exit--sourcedirDIR β treat DIR as the package source root instead of the current directory
π¦ debhelper compatibility π¦
these are accepted without changing which source files are cleaned β they're here for the vibes, not the ~impact~ π
-a,--arch-i,--indep-p,--packagePACKAGE-N,--no-packagePACKAGE-P,--tmpdirDIR--remaining-packages
π₯ SEQUENCE INTEGRATION π₯
Wanna make this automatic? Add dh-sequence-doc-privacy to Build-Depends and boom, automatic cleanup is enabled. π₯ Alternatively, depend on dh-doc-privacy and pass --with doc_privacy to dh.
Timing matters, so listen up: the command runs before dh_update_autotools_config, ahead of configuration and building, and processes the top-level README files by default. front of the line, main character energy, periodt. β¨
Now, about those options β -a/--arch, -i/--indep, -p/--package, -N/--no-package, -P/--tmpdir, and --remaining-packages are accepted for compatibility. They do not restrict cleanup, which operates on the shared source tree. So if you actually want to pick and choose documentation files, use PATH arguments and -X. π―
ngl this next part matters: Forwarded -O options are ignored; other unknown options are errors. she does not play about unknown flags. π
To customise paths with the sequence enabled:
override_dh_doc_privacy:
dh_doc_privacy README.md docs/source/ -Xgenerated
π LIMITATIONS π
We keep it honest in this house:
- Markdown reference-style images are not currently removed. (iykyk, hopefully someday π)
- In RST raw HTML blocks, remote image, iframe, script, and link elements are removed; ordinary hyperlinks and unrelated content are retained. she's surgical, not chaotic βοΈβ¨
π FILES π
Without explicit PATH arguments, dh_doc_privacy examines README.md, README.rst, and README.html in the top level of the source tree.
When a directory is given, files ending in .md, .rst, and .html below that directory are processed recursively. she will find them. she always finds them. πΈ
π§ EXAMPLES π§
Run during a package build before generating documentation:
override_dh_auto_build:
dh_doc_privacy README.md docs/source/
dh_auto_build
π SEE ALSO π
okay that's the whole page, bestie!! π«Ά this one's from Debian, dated September 2026, and it's DH_DOC_PRIVACY(1) in the Debhelper Commands collection β go forth and ship clean docs, you absolute legend πβ¨
π¦ where this page comes from
- ubuntu stonking: dh-doc-privacy 0.6 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms