Skip to content

Commit

Permalink
Update PDF startpage (#270)
Browse files Browse the repository at this point in the history
Update PDF startpage

Reviewed-by: Tino Schr
  • Loading branch information
SebastianGode authored Nov 13, 2024
1 parent aae644a commit 651eaa1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 43 deletions.
1 change: 1 addition & 0 deletions bindep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ zlib1g-dev [platform:dpkg]
inkscape
texlive-latex-base [platform:dpkg]
texlive-latex-extra [platform:dpkg]
texlive-background [platform:rpm]
texlive-xetex [platform:dpkg]
texlive-fonts-recommended [platform:dpkg]
fonts-freefont-otf [platform:dpkg]
Expand Down
7 changes: 6 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@
'papersize': 'a4paper',
'pointsize': '12pt',
'figure_align': 'H',
'preamble': r'\newcommand{\githash}{' + current_commit_hash + '}',
'preamble': rf'''
\newcommand{{\githash}}{{{current_commit_hash}}}
\newcommand{{\gitcommittime}}{{{current_commit_time}}}
\newcommand{{\doctitle}}{{{otcdocs_doc_title}}}
\newcommand{{\servicetitle}}{{{otcdocs_service_title}}}
''',
'sphinxsetup': 'hmargin={15mm,15mm}, vmargin={20mm,30mm}, marginpar=10mm'
}
79 changes: 37 additions & 42 deletions otcdocstheme/theme/otcdocs_pdf/pdftheme.sty
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@
\usepackage[multidot]{grffile}
\usepackage{longtable}
\usepackage{tabularx}

% \documentclass[12pt, a4paper]{article}
% % head=70pt showcrop
% \usepackage[skip=0.5\baselineskip plus 2pt, indent=0pt, parfill=30pt]{parskip}
% \linespread{1.25}
% \usepackage[margin=10mm]{geometry}
\PassOptionsToPackage{margin=0.1mm}{geometry}

% Font selection (English)
\usepackage{fontspec}
% \defaultfontfeatures{Scale=MatchLowercase}
\setmainfont{TeleNeo Office}[Path = {./}]
% \setmonofont[SmallCapsFont={Source Code Pro}]{Source Code Pro}'
\setmonofont{Source Code Pro}[Path = {./}]
\setsansfont{TeleNeo Office ExtraBold}[Path = {./}]
\newfontface\otcneoextrabold{TeleNeo Office ExtraBold}[Path = {./}]
Expand All @@ -29,50 +21,56 @@
\renewcommand{\sphinxstyletheadfamily}{\sffamily\raggedright}
\renewcommand{\sphinxbooktabsspecialmidrule}{\raggedright}

% Import background package to add background image
\usepackage{background}

% Import xstring package for string manipulation
\usepackage{xstring}

% Configure background for title page only
\newcommand{\applytitlepagebg}{
\backgroundsetup{
scale=1,
color=black,
opacity=0.2,
angle=0,
position=current page.south,
vshift=14.5cm, % adjust this based on image position
contents={\includegraphics[width=\paperwidth, height=\paperheight]{u4-blobs.pdf}}
}
\BgThispage % Applies the background image to the title page only
}

% Reset background for subsequent pages
\newcommand{\resetbackground}{
\backgroundsetup{contents={}} % Clears the background content for the following pages
}

% Get only the first 7 characters of githash
\newcommand{\githashshort}{\StrLeft{\githash}{7}}

% Defines title page
\renewcommand{\sphinxmaketitle}{
\begin{titlepage}

\applytitlepagebg % Apply background on title page
\raggedleft
\vspace*{5cm}
\otcfont{\otcneobold}{18pt}{Open Telekom Cloud Platform Documentation}
\color{white} % Set text color to white for the title page
\vspace*{6cm}
\otcfont{\otcneobold}{18pt}{Open Telekom Cloud Documentation}
\vspace*{1em}\\
\otcfont{\otcneoextrabold}{50pt}{Cloud Container\\Engine Service}
\otcfont{\otcneoextrabold}{50pt}{\servicetitle}
\vspace*{1em}\\
\otcfont{\otcneothin}{24pt}{API Reference}
\otcfont{\otcneothin}{24pt}{\doctitle}
\vspace*{1em}\\
\otcfont{\otcneomedium}{18pt}{Released February 15, 2024\\Git commit \githash}
\otcfont{\otcneomedium}{18pt}{Released \gitcommittime\\\vspace*{0.5em}Git commit \githashshort}
\vspace*{1em}\\

\author{Editorial teams of the Open Telekom Cloud squads\\Contact via
Ecosysystem Squad, otc\_ecosystem\_[email protected]}
\date{Compilation time: \today, \thistime}
% \begin{flushleft}
% \includegraphics[width=1.6cm, height=0.8cm]{\otclogo}
% \end{flushleft}
% \vskip 6em%
% \begin{center}
% % Document title
% {\Huge \textbf \@title}
% \end{center}

% \begin{flushright}
% % Expect align right but center
% \vskip 2em%
% % RELEASE VERSION
% {\osreleasetitle}
% \end{flushright}

% \vskip 6em%

% \begin{flushright}
% % Author
% {\LARGE \@author}
% \vskip 20em%
% % Creation date
% {\Large \@date}
% \end{flushright}
\end{titlepage}
\resetbackground % Clear background after title page
\color{black} % Reset text color to black for subsequent pages
}

% Customizes page header & footer for otc
Expand All @@ -81,7 +79,6 @@
\fancyhf{}
\fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
\fancyfoot[RE,LO]{{\py@HeaderFamily\nouppercase\rightmark}}
% \fancyfoot[LE,RO]{{Alpha\\Beta\\Gamma}}
\fancyhead[LE,RO]{{\py@HeaderFamily\@title}}
\fancyhead[RE,LO]{{\py@HeaderFamily\includegraphics[width=10mm, height=12mm]{\otclogo}}}
\setlength{\headheight}{15mm}
Expand All @@ -92,5 +89,3 @@

% Do not use chapter and section number
\setcounter{secnumdepth}{-1}


0 comments on commit 651eaa1

Please sign in to comment.