From 66853f1cea75486af2185ab1a4ce76047f6fd990 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 31 Mar 2026 21:32:01 +0000 Subject: [PATCH 01/12] Fix doc build outputs: replace epub with pdf, silence asciinema for non-HTML - .readthedocs.yml: remove epub format, add pdf format - asciinema.py: guard copy_asset_files to HTML builder only - asciinema.py: silently skip asciinema nodes in non-HTML builders (epub, latex, etc.) instead of emitting a warning that can break PDF builds - asciinema.py: add epub to _NODE_VISITORS so epub builds don't fail with unregistered node type https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .readthedocs.yml | 2 +- doc/_ext/sphinxcontrib_asciinema/asciinema.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 395194372..4d17f5f4c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,7 +10,7 @@ sphinx: configuration: doc/conf.py formats: - - epub + - pdf - htmlzip build: diff --git a/doc/_ext/sphinxcontrib_asciinema/asciinema.py b/doc/_ext/sphinxcontrib_asciinema/asciinema.py index 44dad2607..be82899a6 100644 --- a/doc/_ext/sphinxcontrib_asciinema/asciinema.py +++ b/doc/_ext/sphinxcontrib_asciinema/asciinema.py @@ -10,6 +10,8 @@ def copy_asset_files(app, exc): + if app.builder.format != "html": + return asset_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_static") if exc is None: # build succeeded for file in os.listdir(asset_dir): @@ -83,7 +85,6 @@ def visit_html(self, node): def visit_unsupported(self, node): - logger.warning("asciinema: unsupported output format (node skipped)") raise nodes.SkipNode @@ -177,6 +178,7 @@ def to_b64(self, filename): _NODE_VISITORS = { "html": (visit_html, depart), + "epub": (visit_unsupported, None), "latex": (visit_unsupported, None), "man": (visit_unsupported, None), "texinfo": (visit_unsupported, None), From b1e41bb6e6cdd4b38ca266fbec1e1c6637e38a6c Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 31 Mar 2026 21:34:53 +0000 Subject: [PATCH 02/12] Add PDF documentation to GitHub artifact and release - docs.yml: add pdf job that installs LaTeX, builds with latexpdf, uploads as artifact, and uploads to release when release_id is set - docs.yml: accept release_id input (mirrors how build.yml works) - ci.yml: pass release_id to docs workflow and grant contents: write https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .github/workflows/ci.yml | 5 +++- .github/workflows/docs.yml | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 317c74cd5..9e5a2a032 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,10 @@ jobs: secrets: inherit docs: + needs: prep-release uses: ./.github/workflows/docs.yml permissions: - contents: read + contents: write secrets: inherit + with: + release_id: ${{ needs.prep-release.outputs.release_id }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6bf32ba30..daab654e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -2,6 +2,11 @@ name: "Docs" on: workflow_call: + inputs: + release_id: + required: false + type: string + default: '' permissions: contents: read @@ -63,3 +68,51 @@ jobs: external_repository: dfetch-org/dfetch-org.github.io publish_branch: main deploy_key: ${{ secrets.GH_DFETCH_ORG_DEPLOY }} + + pdf: + name: PDF Documentation + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 + with: + egress-policy: audit + + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup Python + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 + with: + python-version: '3.13' + + - name: Install documentation requirements + run: | + pip install .[docs] + pip install sphinx_design + + - name: Install LaTeX + run: | + sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \ + texlive-latex-extra latexmk + + - name: Build PDF + run: make -C doc latexpdf + + - name: Store PDF artifact + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: dfetch-pdf-documentation + path: doc/_build/latex/dfetch.pdf + + - name: Upload PDF to release + if: ${{ inputs.release_id }} + uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.5.0 + with: + tag_name: ${{ inputs.release_id }} + files: doc/_build/latex/dfetch.pdf + draft: true + preserve_order: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 98a88cd3e41a4ee8e43abc6d19a395f5ceae792a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 31 Mar 2026 21:38:10 +0000 Subject: [PATCH 03/12] Add PDF support to devcontainer, clean up doc deps, add VS Code task - Dockerfile: install texlive-latex-recommended, texlive-fonts-recommended, texlive-latex-extra, latexmk so the devcontainer can generate PDFs - docs.yml: remove redundant 'pip install sphinx_design' from all jobs; sphinx_design is already declared in [project.optional-dependencies.docs] so 'pip install .[docs]' is sufficient - dfetch.code-workspace: add 'Build PDF Docs' task (make latexpdf) https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .devcontainer/Dockerfile | 8 ++++++++ .github/workflows/docs.yml | 3 --- dfetch.code-workspace | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ccadd66ac..30654046d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,6 +15,14 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ subversion=1.14.5-3 && \ rm -rf /var/lib/apt/lists/* +# Install LaTeX for PDF documentation generation +RUN apt-get update && apt-get install --no-install-recommends -y \ + texlive-latex-recommended=2023.20240207-1 \ + texlive-fonts-recommended=2023.20240207-1 \ + texlive-latex-extra=2023.20240207-1 \ + latexmk=1:4.83-1 && \ + rm -rf /var/lib/apt/lists/* + # Install ruby gem FPM for packaging RUN apt-get update && apt-get install --no-install-recommends -y \ ruby=1:3.3+b1 \ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index daab654e7..cfbbda956 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -31,7 +31,6 @@ jobs: - name: Install documentation requirements run: | pip install .[docs] - pip install sphinx_design - name: Build docs run: "make -C doc html" @@ -55,7 +54,6 @@ jobs: - name: Install dependencies run: | pip install .[docs] - pip install sphinx_design - name: Build landing-page run: "make -C doc/landing-page html" @@ -90,7 +88,6 @@ jobs: - name: Install documentation requirements run: | pip install .[docs] - pip install sphinx_design - name: Install LaTeX run: | diff --git a/dfetch.code-workspace b/dfetch.code-workspace index 0a7e5eb51..bec7a18f0 100644 --- a/dfetch.code-workspace +++ b/dfetch.code-workspace @@ -97,6 +97,30 @@ "panel": "shared" } }, + { + "label": "Build PDF Docs", + "type": "shell", + "linux": { + "command": "make" + }, + "windows": { + "command": "make.bat" + }, + "args": [ + "latexpdf" + ], + "options": { + "cwd": "${workspaceFolder}/doc" + }, + "group": { + "kind": "build", + "isDefault": false + }, + "presentation": { + "reveal": "always", + "panel": "shared" + } + }, { "label": "Build Landing page", "type": "shell", From 148b44d26f26c91790e88815c048118dced600b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 03:49:03 +0000 Subject: [PATCH 04/12] Fix PDF build: hide SVG badge from LaTeX output The Codespaces badge references an external .svg URL which pdflatex cannot include, causing a fatal error. Wrap the badge in '.. only:: html' and provide a plain hyperlink for non-HTML builders. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/howto/contributing.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/howto/contributing.rst b/doc/howto/contributing.rst index 84456bfcd..23e2ba9a9 100644 --- a/doc/howto/contributing.rst +++ b/doc/howto/contributing.rst @@ -26,10 +26,16 @@ Running in Github Codespaces Github codespaces make it possible to edit dfetch directly in the browser in a VSCode instance. All dependencies are pre-installed and makes it easy to get started. -|CodespacesLink|_ +.. only:: html -.. |CodespacesLink| image:: https://github.com/codespaces/badge.svg -.. _CodespacesLink: https://codespaces.new/dfetch-org/dfetch + |CodespacesLink|_ + + .. |CodespacesLink| image:: https://github.com/codespaces/badge.svg + .. _CodespacesLink: https://codespaces.new/dfetch-org/dfetch + +.. only:: not html + + `Open in GitHub Codespaces `_ .. tip:: From 59a95bc4756c9e45472b36866e3cdaec005644e5 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 03:52:42 +0000 Subject: [PATCH 05/12] Fix devcontainer: remove version pins from texlive packages texlive packages follow the TeX Live release cycle and their Debian package versions change frequently. Pinning to a specific version causes the build to fail when the index is updated. Other system packages (ccache, ruby, etc.) remain pinned as they are stable. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .devcontainer/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 30654046d..f368b301e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -16,11 +16,12 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ rm -rf /var/lib/apt/lists/* # Install LaTeX for PDF documentation generation +# texlive packages follow the TeX Live release cycle and are not pinned RUN apt-get update && apt-get install --no-install-recommends -y \ - texlive-latex-recommended=2023.20240207-1 \ - texlive-fonts-recommended=2023.20240207-1 \ - texlive-latex-extra=2023.20240207-1 \ - latexmk=1:4.83-1 && \ + texlive-latex-recommended \ + texlive-fonts-recommended \ + texlive-latex-extra \ + latexmk && \ rm -rf /var/lib/apt/lists/* # Install ruby gem FPM for packaging From 92e2529d62a961e62b0f558b1f96283cbcd9d274 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 03:59:33 +0000 Subject: [PATCH 06/12] Fix PDF build: use raw::html for SVG badge instead of only::html The previous fix used '.. only:: html' around the substitution, but docutils resolves substitution references before the only-node transform runs, so the image node still ended up in the LaTeX doctree and caused a pdflatex fatal error. '.. raw:: html' is processed exclusively by the HTML builder and is completely invisible to the LaTeX builder, making it the correct tool for format-specific markup that must not appear in PDF output. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/howto/contributing.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/howto/contributing.rst b/doc/howto/contributing.rst index 23e2ba9a9..33520eca0 100644 --- a/doc/howto/contributing.rst +++ b/doc/howto/contributing.rst @@ -26,12 +26,11 @@ Running in Github Codespaces Github codespaces make it possible to edit dfetch directly in the browser in a VSCode instance. All dependencies are pre-installed and makes it easy to get started. -.. only:: html - - |CodespacesLink|_ +.. raw:: html - .. |CodespacesLink| image:: https://github.com/codespaces/badge.svg - .. _CodespacesLink: https://codespaces.new/dfetch-org/dfetch + + Open in GitHub Codespaces + .. only:: not html From 902df7fe19d36028c89b8583db9909837a83df98 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 06:11:12 +0000 Subject: [PATCH 07/12] Fix PDF build: render plantweb diagrams as PNG for non-HTML builders plantweb defaults to SVG format, which pdflatex cannot include, causing a fatal 'Unknown graphics extension: .svg' error in the LaTeX build. Sphinx adds the builder name to 'tags' before executing conf.py, so we can override plantweb's defaults cache to use PNG for any non-HTML builder (latex, man, texinfo, etc.). HTML builds continue to use SVG for crisp vector output. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/conf.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 9e43440ba..9bad0ef85 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,6 +20,14 @@ # that regardless of FORCE_COLOR, and dfetch's own Rich console respects it too. os.environ["NO_COLOR"] = "1" +# plantweb renders PlantUML diagrams as SVG by default, which pdflatex cannot +# include. Override to PNG for all non-HTML builders (e.g. LaTeX/PDF). +if not tags.has("html"): # type: ignore[name-defined] # noqa: F821 + import plantweb.defaults as _plantweb_defaults + _pd = _plantweb_defaults.read_defaults() + _pd["format"] = "png" + _plantweb_defaults.read_defaults.cache = _pd + # -- General configuration ------------------------------------------------ ext_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")) From 2e8565024d5e4d8e03cc5ddba72e601622ec6583 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 06:38:24 +0000 Subject: [PATCH 08/12] Fix PDF build: use .plantwebrc to force plantweb PNG format The conf.py cache-patch approach proved unreliable because Sphinx 8.2.3 loads conf.py before adding the builder name to 'tags' (confirmed in application.py:100-108), and there were timing/subprocess concerns with patching the internal cache. .plantwebrc at the repo root is plantweb's own config mechanism: the 'git://.plantwebrc' provider (last = highest priority in DEFAULTS_PROVIDERS) runs 'git rev-parse --show-toplevel' and reads this file. This works reliably for all builders without any Sphinx internals knowledge. HTML builds now also render PlantUML as PNG, which is acceptable quality for documentation and avoids any format mismatch between builders. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .plantwebrc | 1 + doc/conf.py | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) create mode 100644 .plantwebrc diff --git a/.plantwebrc b/.plantwebrc new file mode 100644 index 000000000..c5c013911 --- /dev/null +++ b/.plantwebrc @@ -0,0 +1 @@ +{"format": "png"} diff --git a/doc/conf.py b/doc/conf.py index 9bad0ef85..9e43440ba 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,14 +20,6 @@ # that regardless of FORCE_COLOR, and dfetch's own Rich console respects it too. os.environ["NO_COLOR"] = "1" -# plantweb renders PlantUML diagrams as SVG by default, which pdflatex cannot -# include. Override to PNG for all non-HTML builders (e.g. LaTeX/PDF). -if not tags.has("html"): # type: ignore[name-defined] # noqa: F821 - import plantweb.defaults as _plantweb_defaults - _pd = _plantweb_defaults.read_defaults() - _pd["format"] = "png" - _plantweb_defaults.read_defaults.cache = _pd - # -- General configuration ------------------------------------------------ ext_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "_ext")) From 9de09a94efd85132f87ee4c14bd30519b369f5ad Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 08:27:53 +0000 Subject: [PATCH 09/12] Fix PDF build: define Unicode check/cross marks for pdflatex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit explanation/alternatives.rst uses ✔ (U+2714) and ✘ (U+2718) throughout its comparison table. pdflatex aborts with 'Unicode character not set up for use with LaTeX' when it encounters them. Add a LaTeX preamble that maps both characters to pifont dingbats (\ding{51} and \ding{55}) via the newunicodechar package. Both pifont and newunicodechar are part of texlive-latex-extra, already installed. https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/conf.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9e43440ba..d7b07b7c4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -188,18 +188,14 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', + # Map Unicode check/cross marks used in alternatives.rst to pifont dingbats + # so pdflatex doesn't abort with "Unicode character not set up for use". + "preamble": r""" +\usepackage{newunicodechar} +\usepackage{pifont} +\newunicodechar{✔}{\ding{51}} +\newunicodechar{✘}{\ding{55}} +""", } # Grouping the document tree into LaTeX files. List of tuples From b466a050a0b1330ee445f41dae1368cb6b70a375 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 08:49:41 +0000 Subject: [PATCH 10/12] Style PDF to match design system and add logo to front page - Set latex_logo to dfetch_logo.png so \sphinxlogo renders on the title page - Switch body font to Helvetica (helvet) matching the Inter/sans-serif design intent - Define design-token colours (dfprimary #c2620a, dfaccent #4e7fa0, etc.) via xcolor - Use sphinxsetup to apply tokens to chapter titles, links, code blocks and admonitions - Add custom maketitle with amber header bar, centred logo, styled title/subtitle and accent footer rule https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/conf.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index d7b07b7c4..447b8f493 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -187,14 +187,55 @@ # -- Options for LaTeX output --------------------------------------------- +latex_logo = "images/dfetch_logo.png" + latex_elements = { # Map Unicode check/cross marks used in alternatives.rst to pifont dingbats # so pdflatex doesn't abort with "Unicode character not set up for use". + # Also configure fonts and colours to match the design system. "preamble": r""" \usepackage{newunicodechar} \usepackage{pifont} \newunicodechar{✔}{\ding{51}} \newunicodechar{✘}{\ding{55}} +\usepackage{helvet} +\renewcommand*\familydefault{\sfdefault} +\usepackage[T1]{fontenc} +\usepackage{xcolor} +\definecolor{dfprimary}{HTML}{c2620a} +\definecolor{dfaccent}{HTML}{4e7fa0} +\definecolor{dftextmuted}{HTML}{78716c} +\definecolor{dfnearblack}{HTML}{1c1917} +""", + # Design-token colours for Sphinx's built-in LaTeX style hooks + "sphinxsetup": ( + "TitleColor={rgb}{0.761,0.384,0.039}," + "InnerLinkColor={rgb}{0.306,0.498,0.627}," + "OuterLinkColor={rgb}{0.306,0.498,0.627}," + "VerbatimColor={rgb}{0.996,0.973,0.941}," + "VerbatimBorderColor={rgb}{0.906,0.878,0.847}," + "noteBorderColor={rgb}{0.306,0.498,0.627}," + "warningBorderColor={rgb}{0.761,0.384,0.039}," + ), + # Custom title page with amber header bar, logo, and accent footer + "maketitle": r""" +\begin{titlepage} + \noindent{\color{dfprimary}\rule{\linewidth}{6pt}}\par + \vfill + \begin{center} + \sphinxlogo\par + \vspace{1.8cm} + {\fontsize{40}{44}\selectfont\bfseries\color{dfprimary}Dfetch\par} + \vspace{0.4cm} + {\LARGE\color{dfnearblack}Documentation\par} + \vspace{0.8cm} + {\large\color{dftextmuted}\textit{vendor dependencies without the pain}\par} + \vspace{2.5cm} + {\large\color{dftextmuted}\py@release\par} + \end{center} + \vfill + \noindent{\color{dfaccent}\rule{\linewidth}{4pt}}\par +\end{titlepage} """, } From fd076ef1429b4d84b1c8f624d1d84d90f8002dad Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 09:15:50 +0000 Subject: [PATCH 11/12] Fix \py@release in custom maketitle by adding \makeatletter guard \py@release contains @ which is only a letter inside \makeatletter scope. Without the guard pdflatex aborts with "Missing number, treated as zero". https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- doc/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 447b8f493..490d60b79 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -217,8 +217,11 @@ "noteBorderColor={rgb}{0.306,0.498,0.627}," "warningBorderColor={rgb}{0.761,0.384,0.039}," ), - # Custom title page with amber header bar, logo, and accent footer + # Custom title page with amber header bar, logo, and accent footer. + # \makeatletter/\makeatother are required to access \py@release (@ is a + # letter in LaTeX package code but not in regular document mode). "maketitle": r""" +\makeatletter \begin{titlepage} \noindent{\color{dfprimary}\rule{\linewidth}{6pt}}\par \vfill @@ -236,6 +239,7 @@ \vfill \noindent{\color{dfaccent}\rule{\linewidth}{4pt}}\par \end{titlepage} +\makeatother """, } From 25b3130e22d30d99afa330014a0eafd4bd3ce786 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 12:06:22 +0000 Subject: [PATCH 12/12] Fix title page to single page, add version to filename and front page - Set release = __version__ so \py@release renders the version on the title page - Use \includegraphics[width=0.35\linewidth] instead of \sphinxlogo to constrain the logo size; \sphinxlogo has no width limit and caused the title page to spill across 3 pages when the PNG natural resolution was large - Replace double \vfill with \vspace*{\fill} so the two rules and centered block sit correctly within the single titlepage environment - Include version in latex_documents filename: dfetch-.pdf - Update docs.yml artifact/release paths to dfetch-*.pdf glob https://claude.ai/code/session_014hVQ5UrK1B4N9ar4UfYpm4 --- .github/workflows/docs.yml | 4 ++-- doc/conf.py | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index cfbbda956..31cfa6c56 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -101,14 +101,14 @@ jobs: uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: dfetch-pdf-documentation - path: doc/_build/latex/dfetch.pdf + path: doc/_build/latex/dfetch-*.pdf - name: Upload PDF to release if: ${{ inputs.release_id }} uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.5.0 with: tag_name: ${{ inputs.release_id }} - files: doc/_build/latex/dfetch.pdf + files: doc/_build/latex/dfetch-*.pdf draft: true preserve_order: true env: diff --git a/doc/conf.py b/doc/conf.py index 490d60b79..e295ab664 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -80,7 +80,7 @@ # The short X.Y version. version = __version__ # The full version, including alpha/beta/rc tags. -release = "" +release = __version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -220,23 +220,26 @@ # Custom title page with amber header bar, logo, and accent footer. # \makeatletter/\makeatother are required to access \py@release (@ is a # letter in LaTeX package code but not in regular document mode). + # \sphinxlogo is NOT used here because it has no size constraint; instead + # we include the logo directly with an explicit width to keep the page count + # at exactly one regardless of the image's natural resolution. "maketitle": r""" \makeatletter \begin{titlepage} \noindent{\color{dfprimary}\rule{\linewidth}{6pt}}\par - \vfill + \vspace*{\fill} \begin{center} - \sphinxlogo\par - \vspace{1.8cm} + \includegraphics[width=0.35\linewidth]{dfetch_logo.png}\par + \vspace{1.2cm} {\fontsize{40}{44}\selectfont\bfseries\color{dfprimary}Dfetch\par} - \vspace{0.4cm} + \vspace{0.3cm} {\LARGE\color{dfnearblack}Documentation\par} - \vspace{0.8cm} + \vspace{0.6cm} {\large\color{dftextmuted}\textit{vendor dependencies without the pain}\par} - \vspace{2.5cm} + \vspace{1.5cm} {\large\color{dftextmuted}\py@release\par} \end{center} - \vfill + \vspace*{\fill} \noindent{\color{dfaccent}\rule{\linewidth}{4pt}}\par \end{titlepage} \makeatother @@ -247,7 +250,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, "dfetch.tex", "Dfetch Documentation", "Dfetch", "manual"), + (master_doc, f"dfetch-{__version__}.tex", "Dfetch Documentation", "Dfetch", "manual"), ]