Scroll to navigation

DH_DOC_PRIVACY(1) Debhelper Commands DH_DOC_PRIVACY(1)

NAME

dh_doc_privacy - remove remote assets from package documentation

DESCRIPTION

This debhelper command removes remotely hosted assets from documentation before the documentation is converted to HTML or installed under /usr/share/doc.

It is intended to prevent installed documentation from triggering network requests for badges, embedded widgets, or tracking scripts when viewed in a web browser.

The command rewrites matching files in place. When a file is modified during a package build, its original content is stored so that dh_clean can restore it from debian/.debhelper/.

usage: dh_doc_privacy [-h] [-X PATTERN] [--no-act] [--verbose] [--version]

[--sourcedir DIR]
[PATH ...]

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.

positional arguments:

file or directory to process; defaults to top-level README files

options:

show this help message and exit
skip files whose path contains PATTERN; may be specified multiple times
report files that would be changed without modifying them
print a message for each file that is examined or changed
show program's version number and exit
treat DIR as the package source root instead of the current directory

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.

EXAMPLES

Run during a package build before generating documentation:

override_dh_auto_build:
	dh_auto_build
	dh_doc_privacy README.md docs/source/

SEE ALSO

debhelper(7), dh(1), lintian(1)

March 2026 Debian