Skip to content

Commit

Permalink
And also do html-docs, tarball and pdf for auth
Browse files Browse the repository at this point in the history
  • Loading branch information
omoerbeek committed Feb 17, 2025
1 parent 5f58af5 commit 01ee2c5
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 11 deletions.
10 changes: 5 additions & 5 deletions docs/generate-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main():
files = list(itertools.chain.from_iterable(files))
sphinx_build = venv_directory.joinpath("bin").joinpath("sphinx-build")

if args.latex_name:
if args.pdf_name:
buildargs = [

Check warning on line 44 in docs/generate-docs.py

View workflow job for this annotation

GitHub Actions / Spell checking

`buildargs` is not a recognized word. (unrecognized-spelling)
sphinx_build,
"-M",
Expand All @@ -60,8 +60,8 @@ def main():
buildargs + files, # default is to do all

Check warning on line 60 in docs/generate-docs.py

View workflow job for this annotation

GitHub Actions / Spell checking

`buildargs` is not a recognized word. (unrecognized-spelling)
check=True
)
if args.latex_name:
os.rename(build_root.joinpath('latex').joinpath(args.latex_name), args.latex_name)
if args.pdf_name:
os.rename(build_root.joinpath('latex').joinpath(args.pdf_name), args.pdf_name)

def create_argument_parser():
"""Create command-line argument parser."""
Expand Down Expand Up @@ -105,10 +105,10 @@ def create_argument_parser():
help="Target directory for man-pages relative to the build root",
)
parser.add_argument(
"--latex-name",
"--pdf-name",
type=Path,
required=False,
help="Generate latex instead of html",
help="Generate pdf instead of html",
)
parser.add_argument(
"files",
Expand Down
44 changes: 44 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -1123,3 +1123,47 @@ if get_option('unit-tests-backends')
endif
endforeach
endif

html_docs = custom_target(
'html-docs',
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@' / 'html-docs',
],
output: 'html-docs',
console: true,
)

docs_tarball = custom_target(
'html-docs.tar.bz2',
command: ['tar', 'cjf', 'html-docs.tar.bz2', html_docs],
output: 'html-docs.tar.bz2',
)

pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
'--build-root', '@BUILD_ROOT@',
'--source-root', '@SOURCE_ROOT@',
'--venv-name', 'venv-docs',
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--pdf-name', 'PowerDNS-Authoritative.pdf',
],
output: 'PowerDNS-Authoritative.pdf',
console: true,
)

run_target(
'all-docs',
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)

6 changes: 3 additions & 3 deletions pdns/dnsdistdist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ docs_tarball = custom_target(
output: 'html-docs.tar.bz2',
)

latex_docs = custom_target(
pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
Expand All @@ -722,13 +722,13 @@ latex_docs = custom_target(
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--latex-name', 'dnsdist.pdf',
'--pdf-name', 'dnsdist.pdf',
],
output: 'dnsdist.pdf',
console: true,
)

run_target(
'all-docs',
command: ['echo', html_docs, docs_tarball, latex_docs],
command: ['echo', html_docs, docs_tarball, pdf_docs],
)
6 changes: 3 additions & 3 deletions pdns/recursordist/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ docs_tarball = custom_target(
output: 'html-docs.tar.bz2',
)

latex_docs = custom_target(
pdf_docs = custom_target(
command: [
python,
product_source_dir / docs_dir / 'generate-docs.py',
Expand All @@ -766,14 +766,14 @@ latex_docs = custom_target(
'--requirements-file', docs_dir / 'requirements.txt',
'--source-directory', docs_dir,
'--target-directory', '@BUILD_ROOT@',
'--latex-name', 'PowerDNS-Recursor.pdf',
'--pdf-name', 'PowerDNS-Recursor.pdf',
],
output: 'PowerDNS-Recursor.pdf',
console: true,
)

run_target(
'all-docs',
command: ['echo', 'Generated', html_docs, docs_tarball, latex_docs],
command: ['echo', 'Generated', html_docs, docs_tarball, pdf_docs],
)

0 comments on commit 01ee2c5

Please sign in to comment.