DH_DOC_PRIVACY(1)

πŸ“¦ version 0.6, in ubuntu stonking

✨ 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, --exclude PATTERN β€” 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
  • --sourcedir DIR β€” 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, --package PACKAGE
  • -N, --no-package PACKAGE
  • -P, --tmpdir DIR
  • --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