diff --git a/contrib/teamcity/build-configurations.yml b/contrib/teamcity/build-configurations.yml --- a/contrib/teamcity/build-configurations.yml +++ b/contrib/teamcity/build-configurations.yml @@ -113,7 +113,8 @@ build-docs: targets: - - doc-rpc - - install-manpages-html + post_build: | + xvfb-run -a -e /dev/stderr ninja install-manpages-html timeout: 600 artifacts: doc/*: doc diff --git a/doc/man/README.md b/doc/man/README.md new file mode 100644 --- /dev/null +++ b/doc/man/README.md @@ -0,0 +1,45 @@ +# Generating the man pages + +## Generation + +The man pages are generated on demand using the `help2man` helper. To install on +Debian: + +```shell +sudo apt-get install help2man +``` + +To generate a man page, use the `doc-manpage-` where `executable` is the +name of the executable you want to generate the man page for: + +```shell +ninja doc-manpage-bitcoind +``` + +An easiest solution to generate all the man pages at the same time is to use the +installation target. They will be copied to your installation directory as well: + +```shell +ninja install-manpages +``` + +## Headless generation + +Generating the man page for `bitcoin-qt` will require a X server. If you are +running headlessly, you can use the `xfvb-run` utility included in the `xvfb` +package: + +```shell +sudo apt-get install xvfb +xvfb-run ninja install-manpages +``` + +## Generate as HTML + +It is possible to convert the man pages to HTML using `pandoc`. Version 2.4 or +greater is required: + +```shell +sudo apt-get install pandoc +ninja install-manpages-html +``` diff --git a/doc/man/gen-manpages.sh b/doc/man/gen-manpages.sh --- a/doc/man/gen-manpages.sh +++ b/doc/man/gen-manpages.sh @@ -25,14 +25,6 @@ exit 2 fi -# Unfortunately bitcoin-qt requires a handle on the DISPLAY, even for the -# --help option. We can spoof an X window using xvfb. -if ! command -v xvfb-run -then - echo "xvfb is required to run $0 headlessly, please install it" - exit 3 -fi - BITCOIND="$1" BIN="$2" MANPAGE="$3" @@ -64,6 +56,5 @@ echo "[COPYRIGHT]" > "${FOOTER}" "${BITCOIND}" --version | sed -n '1!p' >> "${FOOTER}" -xvfb-run -a -e /dev/stderr \ - help2man -N --version-string="${VERSION[0]}" --include="${FOOTER}" -o "${MANPAGE}" "${BIN}" +help2man -N --version-string="${VERSION[0]}" --include="${FOOTER}" -o "${MANPAGE}" "${BIN}" sed -i "s/\\\-${VERSION[1]}//g" "${MANPAGE}"