Skip to content

Commit e2dc870

Browse files
committed
page numbers, section title style
JIRA: CI-526
1 parent 6f79749 commit e2dc870

File tree

4 files changed

+123
-141
lines changed

4 files changed

+123
-141
lines changed

_static/images/pdf-lastpage.png

279 KB
Loading

_static/js/versions.js

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
* Phoenix-RTOS
3+
*
4+
* Copyright 2024 Phoenix Systems
5+
* Author: Damian Loewnau
6+
*
7+
* This file is part of Phoenix-RTOS.
8+
*
9+
* %LICENSE%
10+
*/
11+
112
const curr_version = document.querySelector('.curr-version');
213
const currentPath = window.location.pathname;
314
const pathSegments = currentPath.split('/').filter(segment => segment !== '');

_static/latex/preamble.tex

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
%
2+
% Phoenix-RTOS
3+
%
4+
% Copyright 2025 Phoenix Systems
5+
% Author: Adam Debek
6+
%
7+
% This file is part of Phoenix-RTOS.
8+
%
9+
% %LICENSE%
10+
11+
\setmainfont{Liberation Sans}
12+
\addtolength{\cftsubsecnumwidth}{5pt}
13+
\setcounter{secnumdepth}{3}
14+
\definecolor{darkblue}{HTML}{26384f}
15+
\definecolor{ps-orange}{HTML}{ea5b22}
16+
\addto\captionsenglish{\renewcommand{\contentsname}{\textcolor{ps-orange}{Table of contents}}}
17+
18+
\titleformat{\section}{\bfseries\Large\color{darkblue}}{\thesection}{1em}{}
19+
\titleformat{\subsection}{\bfseries\large\color{darkblue}}{\thesubsection}{1em}{}
20+
\titleformat{\subsubsection}{\bfseries\normalsize\color{darkblue}}{\thesubsubsection}{1em}{}
21+
\titleformat{\paragraph}{\bfseries\color{darkblue}}{\theparagraph}{1em}{}
22+
\titleformat{\subparagraph}{\bfseries\color{darkblue}}{\thesubparagraph}{1em}{}
23+
24+
% Section title styling
25+
\makeatletter
26+
\def\@makesectionhead#1{%
27+
{\parindent \z@
28+
\interlinepenalty\@M
29+
\noindent\textcolor{orange}{\rule{\textwidth}{2pt}}
30+
\par\vspace{0.5em}
31+
{\bfseries\Large\itshape#1}
32+
\noindent\textcolor{orange}{\rule{\textwidth}{2pt}}
33+
}}
34+
\renewcommand{\section}{\@startsection{section}{1}{\z@}%
35+
{-3.5ex \@plus -1ex \@minus -.2ex}%
36+
{2.3ex \@plus.2ex}%
37+
{\@makesectionhead}}
38+
\makeatother
39+
% Add dot to the section title only
40+
\renewcommand{\thesection}{\arabic{section}.\hspace{-0.5em}}
41+
\renewcommand{\thesubsection}{\arabic{section}.\arabic{subsection}}
42+
\renewcommand{\thesubsubsection}{\arabic{section}.\arabic{subsection}.\arabic{subsubsection}}
43+
44+
\fancypagestyle{toc}{
45+
\fancyhf{}
46+
\fancyfoot[R]{%
47+
\begin{tikzpicture}
48+
\node[circle, fill=ps-orange, text=white, minimum size=20pt, inner sep=0pt, font=\bfseries] {\thepage};
49+
\end{tikzpicture}%
50+
}
51+
}
52+
53+
\fancypagestyle{normal}[toc]{
54+
\fancyhead[R]{\includegraphics[width=2.5cm]{small_logo.png}}
55+
}
56+
57+
% Apply the style to all pages
58+
\pagestyle{normal}
59+
60+
% Make chapters start on new pages
61+
\newcommand{\sectionbreak}{\clearpage}
62+
63+
% Override Sphinx verbatim settings
64+
\fvset{
65+
frame=none,
66+
numbers=none,
67+
fontfamily=ttfamily,
68+
baselinestretch=1.2
69+
}
70+
% Sphinx-specific settings
71+
\sphinxsetup{
72+
VerbatimColor={rgb}{0.97,0.97,0.97},
73+
VerbatimBorderColor={rgb}{0.97,0.97,0.97},
74+
verbatimwithframe=false,
75+
verbatimsep=8pt,
76+
verbatimborder=0pt
77+
}
78+
79+
% Additional frame removal
80+
\renewenvironment{Verbatim}{%
81+
\setlength{\fboxsep}{0pt}%
82+
\setlength{\fboxrule}{0pt}%
83+
\begin{flushleft}%
84+
}{%
85+
\end{flushleft}%
86+
}

conf.py

+26-141
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

99
from version_management import get_version_context
10+
from pathlib import Path
1011

1112
project = ""
1213
copyright = "2024, Phoenix Systems"
@@ -19,7 +20,6 @@
1920

2021
templates_path = ["_templates"]
2122
exclude_patterns = ["README.md", "_build", "Thumbs.db", ".DS_Store"]
22-
# exclude_patterns = ["*.md", "_build", "Thumbs.db", ".DS_Store", "**/*.md"]
2323
myst_heading_anchors = 3
2424
pygments_dark_style = "tango"
2525

@@ -42,11 +42,26 @@
4242
latex_documents = [
4343
("index", "phoenix.tex", "Phoenix-RTOS Documentation", author, "howto", True),
4444
]
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+
]
4652
latex_elements = {
4753
'makeindex': r'',
4854
'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}',
5065
'extrapackages': r'''
5166
\usepackage{graphicx}
5267
\usepackage{tocloft}
@@ -55,91 +70,13 @@
5570
\usepackage{fontspec}
5671
\usepackage[english]{babel}
5772
\usepackage{fancyhdr}
58-
\usepackage{tikz} % Add this for drawing the circle
73+
\usepackage{tikz}
5974
\usepackage{fancyvrb}
6075
\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
9676
\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
11277
\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}
14278
''',
79+
'preamble': Path("_static/latex/preamble.tex").read_text(),
14380
'maketitle': r'''
14481
\newgeometry{margin=0pt}
14582
\thispagestyle{empty}
@@ -150,65 +87,13 @@
15087
\restoregeometry
15188
''',
15289
'atendofbody': r'''
153-
\clearpage
90+
\newgeometry{margin=0pt}
15491
\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+
''',
21297
}
21398

21499
# TODO: add dark mode support

0 commit comments

Comments
 (0)