Skip to content

Commit 9070200

Browse files
committed
Cleanup PDF docs
1 parent 861b5e4 commit 9070200

13 files changed

Lines changed: 241 additions & 32 deletions

File tree

.claude/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"Bash(xargs pyupgrade:*)",
2222
"Bash(lint-imports)",
2323
"Bash(pip install:*)",
24-
"Bash(pytest tests/test_sbom_reporter.py -q)"
24+
"Bash(pytest tests/test_sbom_reporter.py -q)",
25+
"Bash(make -C doc latexpdf)",
26+
"Bash(make -C doc clean)",
2527
]
2628
}
2729
}

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
1717

1818
# Install LaTeX for PDF documentation generation
1919
# texlive packages follow the TeX Live release cycle and are not pinned
20+
# texlive-xetex: xelatex engine (required by latex_engine = "xelatex" in conf.py)
21+
# texlive-latex-extra: pulls in texlive-pictures (TikZ) as a dependency
2022
RUN apt-get update && apt-get install --no-install-recommends -y \
2123
texlive-latex-recommended \
2224
texlive-fonts-recommended \
2325
texlive-latex-extra \
26+
texlive-xetex \
2427
latexmk && \
2528
rm -rf /var/lib/apt/lists/*
2629

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
- name: Install LaTeX
9797
run: |
9898
sudo apt-get install -y texlive-latex-recommended texlive-fonts-recommended \
99-
texlive-latex-extra latexmk
99+
texlive-latex-extra texlive-xetex latexmk
100100
101101
- name: Build PDF
102102
run: make -C doc latexpdf

dfetch.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ manifest:
55
- name: github
66
url-base: https://github.com/
77

8+
- name: ctan
9+
url-base: https://mirrors.ctan.org/
10+
811
projects:
912
- name: demo-magic
1013
repo-path: paxtonhare/demo-magic.git
@@ -67,3 +70,30 @@ manifest:
6770
- metadata
6871
integrity:
6972
hash: sha256:218d19fdec1bd898d1c78683f3c72e71bcc9e5f9bb3e065f99a5c3cdc48e0d66
73+
74+
- name: poiret-one-font
75+
remote: github
76+
src: fonts
77+
dst: doc/static/fonts/poiretone
78+
branch: master
79+
repo-path: alexeiva/poiretone.git
80+
ignore:
81+
- otf
82+
83+
- name: tex-gyre-heros-font
84+
remote: ctan
85+
vcs: archive
86+
src: opentype/
87+
dst: doc/static/fonts/texgyreheros
88+
repo-path: fonts/tex-gyre.zip
89+
ignore:
90+
- texgyreadventor*
91+
- texgyrebonum*
92+
- texgyrechorus*
93+
- texgyrecursor*
94+
- texgyreheroscn*
95+
- texgyrepagella*
96+
- texgyreschola*
97+
- texgyretermes*
98+
integrity:
99+
hash: sha256:1773c470f9e388e087b68e3426e115af2cd236845a7e05ceb25b2a503409a7a3

doc/conf.py

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@
191191

192192
# -- Options for LaTeX output ---------------------------------------------
193193

194+
latex_engine = "xelatex"
195+
latex_use_xindy = False
196+
194197
latex_logo = "images/dfetch_logo.png"
195198

196199
latex_elements = {
@@ -202,14 +205,33 @@
202205
\usepackage{pifont}
203206
\newunicodechar{✔}{\ding{51}}
204207
\newunicodechar{✘}{\ding{55}}
205-
\usepackage{helvet}
206-
\renewcommand*\familydefault{\sfdefault}
207-
\usepackage[T1]{fontenc}
208208
\usepackage{xcolor}
209209
\definecolor{dfprimary}{HTML}{c2620a}
210210
\definecolor{dfaccent}{HTML}{4e7fa0}
211211
\definecolor{dftextmuted}{HTML}{78716c}
212212
\definecolor{dfnearblack}{HTML}{1c1917}
213+
% Cover page colours (dfetch brand palette)
214+
\definecolor{dfetchCoverTop}{HTML}{3a6682}
215+
\definecolor{dfetchCoverDark}{HTML}{1c1917}
216+
\definecolor{dfetchCoverBottom}{HTML}{c2620a}
217+
\definecolor{dfetchCoverAccent}{HTML}{4e7fa0}
218+
\definecolor{dfetchCoverLight}{HTML}{fef8f0}
219+
% TikZ for cover page
220+
\usepackage{tikz}
221+
""",
222+
# XeLaTeX font setup using vendored fonts (see dfetch.yaml).
223+
# Both fonts are copied into the LaTeX build root via latex_additional_files,
224+
# so Path=./ resolves correctly at compile time.
225+
# \PoiretOne is declared here so it is available to the cover page.
226+
"fontpkg": r"""
227+
\usepackage{fontspec}
228+
\setsansfont{texgyreheros-regular}[
229+
Extension=.otf, Path=./, Scale=0.95,
230+
BoldFont=texgyreheros-bold,
231+
ItalicFont=texgyreheros-italic,
232+
BoldItalicFont=texgyreheros-bolditalic]
233+
\renewcommand*\familydefault{\sfdefault}
234+
\newfontface\PoiretOne{PoiretOne-Regular}[Extension=.ttf, Path=./]
213235
""",
214236
# Design-token colours for Sphinx's built-in LaTeX style hooks
215237
"sphinxsetup": (
@@ -221,33 +243,9 @@
221243
"noteBorderColor={rgb}{0.306,0.498,0.627},"
222244
"warningBorderColor={rgb}{0.761,0.384,0.039},"
223245
),
224-
# Custom title page with amber header bar, logo, and accent footer.
225-
# \makeatletter/\makeatother are required to access \py@release (@ is a
226-
# letter in LaTeX package code but not in regular document mode).
227-
# \sphinxlogo is NOT used here because it has no size constraint; instead
228-
# we include the logo directly with an explicit width to keep the page count
229-
# at exactly one regardless of the image's natural resolution.
230-
"maketitle": r"""
231-
\makeatletter
232-
\begin{titlepage}
233-
\noindent{\color{dfprimary}\rule{\linewidth}{6pt}}\par
234-
\vspace*{\fill}
235-
\begin{center}
236-
\includegraphics[width=0.35\linewidth]{dfetch_logo.png}\par
237-
\vspace{1.2cm}
238-
{\fontsize{40}{44}\selectfont\bfseries\color{dfprimary}Dfetch\par}
239-
\vspace{0.3cm}
240-
{\LARGE\color{dfnearblack}Documentation\par}
241-
\vspace{0.6cm}
242-
{\large\color{dftextmuted}\textit{vendor dependencies without the pain}\par}
243-
\vspace{1.5cm}
244-
{\large\color{dftextmuted}\py@release\par}
245-
\end{center}
246-
\vspace*{\fill}
247-
\noindent{\color{dfaccent}\rule{\linewidth}{4pt}}\par
248-
\end{titlepage}
249-
\makeatother
250-
""",
246+
# Cover page is in doc/dfetch_cover.inc (listed in latex_additional_files).
247+
# \makeatletter/\makeatother expose \py@release inside the included file.
248+
"maketitle": r"\makeatletter\input{dfetch_cover.inc}\makeatother",
251249
}
252250

253251
# Grouping the document tree into LaTeX files. List of tuples
@@ -263,6 +261,15 @@
263261
),
264262
]
265263

264+
latex_additional_files = [
265+
"dfetch_cover.inc",
266+
"static/fonts/poiretone/ttf/PoiretOne-Regular.ttf",
267+
"static/fonts/texgyreheros/texgyreheros-regular.otf",
268+
"static/fonts/texgyreheros/texgyreheros-bold.otf",
269+
"static/fonts/texgyreheros/texgyreheros-italic.otf",
270+
"static/fonts/texgyreheros/texgyreheros-bolditalic.otf",
271+
]
272+
266273

267274
# -- Options for manual page output ---------------------------------------
268275

doc/dfetch_cover.inc

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
% dfetch cover page
2+
%
3+
% \input{dfetch_cover} is called from latex_elements['maketitle'] in conf.py.
4+
%
5+
% Prerequisites (declared in the preamble via latex_elements):
6+
% packages : tikz, xcolor, fontspec, graphicx
7+
% colours : dfetchCoverTop, dfetchCoverDark, dfetchCoverBottom,
8+
% dfetchCoverAccent, dfetchCoverLight
9+
% fontface : \PoiretOne (\newfontface from fontspec)
10+
%
11+
\begin{titlepage}
12+
\thispagestyle{empty}
13+
\begin{tikzpicture}[remember picture, overlay]
14+
15+
% ------------------------------------------------------------------ %
16+
% BACKGROUND SECTIONS %
17+
% ------------------------------------------------------------------ %
18+
19+
% Top 60 % — Slate Dark (#3a6682, --accent-dark)
20+
\fill[dfetchCoverTop]
21+
(current page.north west) rectangle
22+
([yshift=0.4\paperheight]current page.south east);
23+
24+
% Middle 20 % — Near Black (#1c1917, --text)
25+
\fill[dfetchCoverDark]
26+
([yshift=0.2\paperheight]current page.south west) rectangle
27+
([yshift=0.4\paperheight]current page.south east);
28+
29+
% Bottom 20 % — Amber Orange (#c2620a, --primary)
30+
\fill[dfetchCoverBottom]
31+
(current page.south west) rectangle
32+
([yshift=0.2\paperheight]current page.south east);
33+
34+
% ------------------------------------------------------------------ %
35+
% TOP SECTION: GRID PATTERN %
36+
% ------------------------------------------------------------------ %
37+
\begin{scope}
38+
\clip (current page.north west) rectangle
39+
([yshift=0.4\paperheight]current page.south east);
40+
41+
% Vertical lines
42+
\foreach \i in {1,2,...,14}{
43+
\pgfmathsetmacro{\xfrac}{\i/15}
44+
\draw[dfetchCoverAccent!60!dfetchCoverTop, line width=0.3pt, opacity=0.30]
45+
([xshift=\xfrac\paperwidth]current page.south west) --
46+
([xshift=\xfrac\paperwidth]current page.north west);
47+
}
48+
49+
% Horizontal lines
50+
\foreach \i in {1,2,...,8}{
51+
\pgfmathsetmacro{\yfrac}{0.4 + \i * 0.075}
52+
\draw[dfetchCoverAccent!60!dfetchCoverTop, line width=0.3pt, opacity=0.30]
53+
([yshift=\yfrac\paperheight]current page.south west) --
54+
([yshift=\yfrac\paperheight]current page.south east);
55+
}
56+
57+
% Sparse node dots at grid intersections
58+
\foreach \xi in {1,3,5,7,9,11,13}{
59+
\foreach \yi in {1,3,5,7}{
60+
\pgfmathsetmacro{\xdot}{\xi/15}
61+
\pgfmathsetmacro{\ydot}{0.4 + \yi * 0.075}
62+
\fill[dfetchCoverLight, opacity=0.22]
63+
([xshift=\xdot\paperwidth, yshift=\ydot\paperheight]current page.south west)
64+
circle (1.5pt);
65+
}
66+
}
67+
\end{scope}
68+
69+
% ------------------------------------------------------------------ %
70+
% TOP SECTION: LOGO (off-centre, right side of blue area) %
71+
% ------------------------------------------------------------------ %
72+
\node[anchor=center, opacity=0.90]
73+
at ([xshift=0.70\paperwidth, yshift=0.65\paperheight]current page.south west)
74+
{\includegraphics[width=0.35\paperwidth]{dfetch_logo.png}};
75+
76+
% ------------------------------------------------------------------ %
77+
% ACCENT RULE (Amber Orange, top edge of middle band) %
78+
% ------------------------------------------------------------------ %
79+
\draw[dfetchCoverBottom, line width=2.5pt]
80+
([yshift=0.4\paperheight]current page.south west) --
81+
([yshift=0.4\paperheight]current page.south east);
82+
83+
% ------------------------------------------------------------------ %
84+
% MIDDLE BAND: TITLE BLOCK %
85+
% ------------------------------------------------------------------ %
86+
87+
% "User Manual" eyebrow
88+
\node[anchor=base west, text=dfetchCoverAccent,
89+
font={\sffamily\itshape\fontsize{10}{12}\selectfont},
90+
inner sep=0pt]
91+
at ([xshift=1.4cm, yshift=0.375\paperheight]current page.south west)
92+
{User Manual};
93+
94+
% Main title — Poiret One
95+
\node[anchor=base west, text=dfetchCoverLight,
96+
font={\PoiretOne\fontsize{30}{34}\selectfont},
97+
inner sep=0pt]
98+
at ([xshift=1.4cm, yshift=0.318\paperheight]current page.south west)
99+
{DFetch};
100+
101+
% Subtitle
102+
\node[anchor=base west, text=dfetchCoverAccent,
103+
font={\sffamily\fontsize{13}{16}\selectfont},
104+
inner sep=0pt]
105+
at ([xshift=1.4cm, yshift=0.263\paperheight]current page.south west)
106+
{Vendor dependencies without the pain.};
107+
108+
% Thin amber accent rule under subtitle
109+
\draw[dfetchCoverBottom, line width=1.5pt]
110+
([xshift=1.4cm, yshift=0.238\paperheight]current page.south west) --
111+
([xshift=0.60\paperwidth, yshift=0.238\paperheight]current page.south west);
112+
113+
% ------------------------------------------------------------------ %
114+
% BOTTOM SECTION: DOTTED PATTERN %
115+
% ------------------------------------------------------------------ %
116+
\begin{scope}
117+
\clip (current page.south west) rectangle
118+
([yshift=0.2\paperheight]current page.south east);
119+
\foreach \xi in {1,2,...,19}{
120+
\foreach \yi in {1,2,3,4}{
121+
\pgfmathsetmacro{\xdot}{\xi/20}
122+
\pgfmathsetmacro{\ydot}{\yi * 0.038}
123+
\fill[dfetchCoverLight, opacity=0.15]
124+
([xshift=\xdot\paperwidth, yshift=\ydot\paperheight]current page.south west)
125+
circle (1.2pt);
126+
}
127+
}
128+
\end{scope}
129+
130+
% ------------------------------------------------------------------ %
131+
% BOTTOM SECTION: FOOTER %
132+
% ------------------------------------------------------------------ %
133+
\node[anchor=south west, text=dfetchCoverLight,
134+
font={\sffamily\fontsize{10}{12}\selectfont},
135+
inner sep=0pt]
136+
at ([xshift=1.4cm, yshift=0.9cm]current page.south west)
137+
{dfetch-org $\cdot$ \py@release};
138+
139+
\node[anchor=south east, text=dfetchCoverLight,
140+
font={\sffamily\fontsize{10}{12}\selectfont},
141+
inner sep=0pt]
142+
at ([xshift=-1.4cm, yshift=0.9cm]current page.south east)
143+
{User Manual};
144+
145+
\end{tikzpicture}
146+
\null
147+
\end{titlepage}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This is a generated file by dfetch. Don't edit this, but edit the manifest.
2+
# For more info see https://dfetch.rtfd.io/en/latest/getting_started.html
3+
dfetch:
4+
branch: master
5+
hash: a4e4b8aa1c4c48a4b80d57672565c300
6+
last_fetch: 13/04/2026, 18:46:53
7+
patch: ''
8+
remote_url: https://github.com/alexeiva/poiretone.git
9+
revision: 6d06a1fc0cc56413127af958c3ac6e6315c7b25c
10+
tag: ''
127 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This is a generated file by dfetch. Don't edit this, but edit the manifest.
2+
# For more info see https://dfetch.rtfd.io/en/latest/getting_started.html
3+
dfetch:
4+
branch: ''
5+
hash: 30a10fe31c4166adc68407a78d3c011a
6+
last_fetch: 13/04/2026, 19:01:37
7+
patch: ''
8+
remote_url: https://mirrors.ctan.org/fonts/tex-gyre.zip
9+
revision: sha256:1773c470f9e388e087b68e3426e115af2cd236845a7e05ceb25b2a503409a7a3
10+
tag: ''
132 KB
Binary file not shown.

0 commit comments

Comments
 (0)