|
7 | 7 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
8 | 8 |
|
9 | 9 | from version_management import get_version_context
|
| 10 | +from pathlib import Path |
10 | 11 |
|
11 | 12 | project = ""
|
12 | 13 | copyright = "2024, Phoenix Systems"
|
|
19 | 20 |
|
20 | 21 | templates_path = ["_templates"]
|
21 | 22 | exclude_patterns = ["README.md", "_build", "Thumbs.db", ".DS_Store"]
|
22 |
| -# exclude_patterns = ["*.md", "_build", "Thumbs.db", ".DS_Store", "**/*.md"] |
23 | 23 | myst_heading_anchors = 3
|
24 | 24 | pygments_dark_style = "tango"
|
25 | 25 |
|
|
42 | 42 | latex_documents = [
|
43 | 43 | ("index", "phoenix.tex", "Phoenix-RTOS Documentation", author, "howto", True),
|
44 | 44 | ]
|
45 |
| -latex_additional_files = ["_static/images/pdf-titlepage.png", "_static/images/small_logo.png", "_static/images/companylogo.png", "_static/images/endpage.png"] |
| 45 | +latex_additional_files = [ |
| 46 | + "_static/images/pdf-titlepage.png", |
| 47 | + "_static/images/pdf-lastpage.png", |
| 48 | + "_static/images/small_logo.png", |
| 49 | + "_static/images/companylogo.png", |
| 50 | + "_static/images/endpage.png" |
| 51 | +] |
46 | 52 | latex_elements = {
|
47 | 53 | 'makeindex': r'',
|
48 | 54 | 'papersize': r'a4paper',
|
49 |
| - 'babel': '\\usepackage[english]{babel}', |
| 55 | + 'tableofcontents':r''' |
| 56 | + \makeatletter |
| 57 | + \begingroup |
| 58 | + \pagestyle{toc} |
| 59 | + \@starttoc{toc} |
| 60 | + \clearpage |
| 61 | + \endgroup |
| 62 | + \makeatother |
| 63 | + ''', |
| 64 | + 'babel': r'\usepackage[english]{babel}', |
50 | 65 | 'extrapackages': r'''
|
51 | 66 | \usepackage{graphicx}
|
52 | 67 | \usepackage{tocloft}
|
|
55 | 70 | \usepackage{fontspec}
|
56 | 71 | \usepackage[english]{babel}
|
57 | 72 | \usepackage{fancyhdr}
|
58 |
| - \usepackage{tikz} % Add this for drawing the circle |
| 73 | + \usepackage{tikz} |
59 | 74 | \usepackage{fancyvrb}
|
60 | 75 | \usepackage{framed}
|
61 |
| - ''', |
62 |
| - 'preamble': r''' |
63 |
| - \setmainfont{Liberation Sans} |
64 |
| - \addtolength{\cftsubsecnumwidth}{5pt} |
65 |
| - \setcounter{secnumdepth}{3} |
66 |
| - \definecolor{darkblue}{HTML}{26384F} |
67 |
| - \definecolor{ps-orange}{HTML}{ea5b22} |
68 |
| - \definecolor{lightgray}{RGB}{245, 245, 245} |
69 |
| - \addto\captionsenglish{\renewcommand{\contentsname}{\textcolor{ps-orange}{Table of contents}}} |
70 |
| -
|
71 |
| - \titleformat{\section}{\bfseries\Large\color{darkblue}}{\thesection}{1em}{} |
72 |
| - \titleformat{\subsection}{\bfseries\large\color{darkblue}}{\thesubsection}{1em}{} |
73 |
| - \titleformat{\subsubsection}{\bfseries\normalsize\color{darkblue}}{\thesubsubsection}{1em}{} |
74 |
| - \titleformat{\paragraph}{\bfseries\color{darkblue}}{\theparagraph}{1em}{} |
75 |
| - \titleformat{\subparagraph}{\bfseries\color{darkblue}}{\thesubparagraph}{1em}{} |
76 |
| -
|
77 |
| - % Force empty page style for all ToC pages to not print page numbers |
78 |
| - \makeatletter |
79 |
| - \renewcommand{\tableofcontents}{% |
80 |
| - \begingroup |
81 |
| - \pagestyle{empty} |
82 |
| - \setcounter{page}{0} % Reset page counter |
83 |
| - \@starttoc{toc}% |
84 |
| - \endgroup |
85 |
| - \cleardoublepage |
86 |
| - \pagestyle{normal} % Restore normal page style |
87 |
| - } |
88 |
| - \makeatother |
89 |
| -
|
90 |
| - \AtBeginDocument{ |
91 |
| - \addtocontents{toc}{\protect\pagestyle{empty}} |
92 |
| - \addtocontents{toc}{\protect\thispagestyle{empty}} |
93 |
| - } |
94 |
| -
|
95 |
| - % Make chapters start on new pages |
96 | 76 | \usepackage{titlesec}
|
97 |
| - \newcommand{\sectionbreak}{\clearpage} |
98 |
| -
|
99 |
| - % Define the fancy page style |
100 |
| - \fancypagestyle{normal}{ |
101 |
| - \fancyhf{} % Clear all header/footer fields |
102 |
| - \fancyhead[R]{\includegraphics[width=2.5cm]{small_logo.png}} % Logo in right header |
103 |
| - \fancyfoot[R]{% |
104 |
| - \begin{tikzpicture} |
105 |
| - \node[circle, fill=ps-orange, text=white, minimum size=20pt, inner sep=0pt, font=\bfseries] {\thepage}; |
106 |
| - \end{tikzpicture}% |
107 |
| - } |
108 |
| - \renewcommand{\headrulewidth}{0pt} % Remove header line |
109 |
| - } |
110 |
| -
|
111 |
| - % Code block styling |
112 | 77 | \usepackage{listings}
|
113 |
| - \definecolor{lightgray}{RGB}{248,248,248} |
114 |
| -
|
115 |
| - % Override Sphinx verbatim settings |
116 |
| - \fvset{ |
117 |
| - frame=none, |
118 |
| - numbers=none, |
119 |
| - fontfamily=ttfamily, |
120 |
| - baselinestretch=1.2 |
121 |
| - } |
122 |
| - % Sphinx-specific settings |
123 |
| - \sphinxsetup{ |
124 |
| - VerbatimColor={rgb}{0.97,0.97,0.97}, % Background color for code blocks |
125 |
| - VerbatimBorderColor={rgb}{0.97,0.97,0.97}, % Make border same as background |
126 |
| - verbatimwithframe=false, |
127 |
| - verbatimsep=8pt, |
128 |
| - verbatimborder=0pt % Set border width to 0 |
129 |
| - } |
130 |
| -
|
131 |
| - % Additional frame removal |
132 |
| - \renewenvironment{Verbatim}{% |
133 |
| - \setlength{\fboxsep}{0pt}% |
134 |
| - \setlength{\fboxrule}{0pt}% |
135 |
| - \begin{flushleft}% |
136 |
| - }{% |
137 |
| - \end{flushleft}% |
138 |
| - } |
139 |
| -
|
140 |
| - % Apply the style to all pages |
141 |
| - \pagestyle{normal} |
142 | 78 | ''',
|
| 79 | + 'preamble': Path("_static/latex/preamble.tex").read_text(), |
143 | 80 | 'maketitle': r'''
|
144 | 81 | \newgeometry{margin=0pt}
|
145 | 82 | \thispagestyle{empty}
|
|
150 | 87 | \restoregeometry
|
151 | 88 | ''',
|
152 | 89 | 'atendofbody': r'''
|
153 |
| - \clearpage |
| 90 | + \newgeometry{margin=0pt} |
154 | 91 | \thispagestyle{empty}
|
155 |
| - |
156 |
| - % Company logo in upper left corner |
157 |
| - \begin{textblock*}{10cm}(2cm,2cm) % Adjust position as needed |
158 |
| - \includegraphics[width=8cm]{companylogo.png} |
159 |
| - \end{textblock*} |
160 |
| - |
161 |
| - % Right side main image |
162 |
| - \vspace*{1.5cm} % Adjust space from top |
163 |
| - \begin{flushright} |
164 |
| - \makebox[0pt][r]{ % Creates box that won't affect other elements |
165 |
| - \rlap{\hspace{-12.5cm}\includegraphics[width=1\textwidth]{endpage.png}} |
166 |
| - } |
167 |
| - \end{flushright} |
168 |
| - |
169 |
| - % Three text blocks stacked vertically |
170 |
| - \vspace{2cm} % Adjust space before text blocks |
171 |
| - \begin{flushright} |
172 |
| - \hspace{0.5cm} % Left margin |
173 |
| - {\fontsize{24}{28} \selectfont \textbf{Phoenix Systems Sp. z o. o.}} |
174 |
| -
|
175 |
| - \vspace{1cm} |
176 |
| - {\fontsize{11}{15} TAX ID: PL113-285-28-93, National Official Business Registry Number: 145963772\\ |
177 |
| -KRS: 0000417999 (XIV Commercial Division of the National Court Register)\\ |
178 |
| -Share capital 241 650,00 PLN (fully paid)} |
179 |
| -
|
180 |
| - \vspace{1cm} |
181 |
| - {\fontsize{14}{18} \textcolor{orange}{phoenix-rtos.com} | github.com/phoenix-rtos} |
182 |
| - |
183 |
| - \vspace{0cm} |
184 |
| - {\fontsize{14}{18} Contact: contact@phoenix-rtos.com} |
185 |
| - \end{flushright} |
186 |
| - |
187 |
| - % Three bottom blocks horizontally aligned |
188 |
| - \vspace{1.6cm} % Space before bottom blocks |
189 |
| - \begin{center} |
190 |
| - \begin{minipage}{0.4\textwidth} |
191 |
| - {\fontsize{11}{15} \textbf{POLAND (HQ)} \\ Ostrobramska 86 \\ |
192 |
| -04-163 Warsaw, Poland} |
193 |
| - \end{minipage}% |
194 |
| - \hspace{-2cm}% % Negative space between first and second block |
195 |
| - \begin{minipage}{0.4\textwidth} |
196 |
| - {\fontsize{11}{15} \textbf{POLAND} \\ Sienkiewicza 10/17 \\ |
197 |
| -18-400 Łomża, Poland} |
198 |
| - \end{minipage}% |
199 |
| - \hspace{-2cm}% % Negative space between first and second block |
200 |
| - \begin{minipage}{0.4\textwidth} |
201 |
| - {\fontsize{11}{15} \textbf{UNITED KINGDOM} \\ Engine Shed, Station Approach \\ |
202 |
| -Temple Meads, Bristol, BS1 6QH, UK} |
203 |
| - \end{minipage} |
204 |
| - \end{center} |
205 |
| - |
206 |
| - % Orange line below bottom blocks |
207 |
| - \vspace{1cm} |
208 |
| - \begin{center} |
209 |
| - \color{orange}\rule{\textwidth}{2pt} |
210 |
| - \end{center} |
211 |
| -''', |
| 92 | + \begin{figure} |
| 93 | + \includegraphics[width=\paperwidth,height=\paperheight]{pdf-lastpage.png} |
| 94 | + \end{figure} |
| 95 | + \restoregeometry |
| 96 | + ''', |
212 | 97 | }
|
213 | 98 |
|
214 | 99 | # TODO: add dark mode support
|
|
0 commit comments