Generate man pages with Sphinx

This commit is contained in:
Chris Mayo 2020-08-06 19:29:24 +01:00
parent 22089a5af2
commit 7fcca21c45
6 changed files with 28 additions and 2944 deletions

View file

@ -42,8 +42,7 @@ recursive-include doc \
*.txt \
*.yml \
Makefile \
linkcheckerrc_* \
po4a.conf
linkcheckerrc_*
recursive-include po \
*.mo \
*.po \

View file

@ -1,7 +1,7 @@
MANFILES:=linkchecker.1 linkcheckerrc.5
LOCALES:=en de
all:
all: html man
code: clean
PYTHONPATH=.. sphinx-autogen src/code/index.rst
@ -9,23 +9,23 @@ code: clean
html:
make -C src html
po4a:
po4a --localized-charset=UTF-8 po4a.conf
man:
make -C src man; \
make -C src -e SPHINXOPTS="-D language='de'" LANGUAGE="de" man
# check all makefiles for formatting warnings
check:
@t=$(shell tempfile); \
for loc in $(LOCALES); do \
@for loc in $(LOCALES); do \
for manfile in $(MANFILES); do \
echo "Checking $$loc/$$manfile"; \
LC_ALL=en_US.UTF-8 MANWIDTH=80 man --warnings -E UTF-8 -l $$loc/$$manfile > /dev/null 2>$$t ; \
if [ -s $$t ]; then cat $$t; exit 1; fi; \
LC_ALL=en_US.UTF-8 MANWIDTH=80 mandoc -T lint -W error $$loc/$$manfile; \
done; \
done
clean:
rm -rf src/_build; \
rm -rf src/code/linkcheck; \
rm -rf html
rm -rf html; \
rm -rf man
.PHONY: po4a check clean html
.PHONY: check clean html man

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
[po4a_langs] de
[po4a_paths] linkchecker.doc.pot $lang:$lang.po
[type: man] en/linkchecker.1 $lang:$lang/linkchecker.1
[type: man] en/linkcheckerrc.5 $lang:$lang/linkcheckerrc.5

View file

@ -4,6 +4,7 @@ SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
LANGUAGE = en
# Put it first so that "make" without argument is like "make help".
help:
@ -12,7 +13,10 @@ help:
html:
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" -d "$(BUILDDIR)/doctrees" ../html $(SPHINXOPTS) $(O)
.PHONY: help html Makefile
man:
@$(SPHINXBUILD) -b man "$(SOURCEDIR)" -d "$(BUILDDIR)/doctrees" ../man/$(LANGUAGE) $(SPHINXOPTS) $(O)
.PHONY: help html man Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

View file

@ -40,6 +40,19 @@ html_theme_options = {
# only use :manpage: within man pages
manpages_url = '{page}.html'
# -- Options for man output -------------------------------------------------
man_pages = [
(
'man/linkchecker', 'linkchecker',
'command line client to check HTML documents and websites for broken links',
['Bastian Kleineidam <bastian.kleineidam@web.de>'], 1),
(
'man/linkcheckerrc', 'linkcheckerrc',
'configuration file for LinkChecker',
['Bastian Kleineidam <bastian.kleineidam@web.de>'], 5),
]
# -- Extension configuration -------------------------------------------------
autoclass_content = 'both'