For my documentation, I need to provide a way on how to structure some Python code in a project. My approach to show it was to simply use a structure of text like this:
app/
├─ ...
├─ controllers/
│ ├─ ...
├─ services/
│ ├─ __init__.py
│ ├─ issuesService.py
│ ├─ projectsService.py
│ ├─ sprintsServices.py
│ ├─ ...
│ ├─ providerService.py
├─ providers/
│ ├─ ...
├─ ...
As I am also show off some Python code in the documentation, I make use of the lstlisting like this:
\begin{lstlisting}[language=Python, caption=A fancy caption]
some code here
\end{lstlisting}
This works completely fine, although it works not for the txt input from above...

The configuration styles for my lstlistings look like this:
%JetBrains Mono-Font für Code
\setmonofont{JetBrains Mono}[
Path = ./Fonts/Code/,
Extension = .ttf,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic,
Contextuals = Alternate,
]
\lstset{
basicstyle = \ttfamily,
columns = flexible,
aboveskip=\baselineskip,
belowskip=\baselineskip
}
\makeatletter
\renewcommand*\verbatim@nolig@list{}
\makeatother
\definecolor{codegreen}{HTML}{067D17}
\definecolor{codegray}{HTML}{969696}
\definecolor{codepurple}{HTML}{871094}
\definecolor{codeblue}{HTML}{0086B3}
\definecolor{codeblack}{HTML}{333333}
\definecolor{background}{HTML}{F5F5F5}
\lstdefinestyle{codestyle}{
backgroundcolor=\color{background},
commentstyle=\color{codepurple},
keywordstyle=\color{codeblue},
identifierstyle=\color{codeblack},
stringstyle=\color{codegreen},
numberstyle=\small\color{codegray},
basicstyle=\ttfamily\small,
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
frame=single,
tabsize=2
}
\lstset{style=codestyle}
\definecolor{delim}{RGB}{20,105,176}
\definecolor{numb}{RGB}{106, 109, 32}
\definecolor{string}{rgb}{0.64,0.08,0.08}
\lstdefinelanguage{JSON}{
rulecolor=\color{black},
postbreak=\raisebox{0ex}[0ex][0ex]{\ensuremath{\color{gray}\hookrightarrow\space}},
upquote=true,
morestring=[b]",
stringstyle=\color{string},
literate=
*{0}{{{\color{numb}0}}}{1}
{1}{{{\color{numb}1}}}{1}
{2}{{{\color{numb}2}}}{1}
{3}{{{\color{numb}3}}}{1}
{4}{{{\color{numb}4}}}{1}
{5}{{{\color{numb}5}}}{1}
{6}{{{\color{numb}6}}}{1}
{7}{{{\color{numb}7}}}{1}
{8}{{{\color{numb}8}}}{1}
{9}{{{\color{numb}9}}}{1}
{{}{{{\color{delim}{{}}}}{1}
{}}{{{\color{delim}{}}}}}{1}
{[}{{{\color{delim}{[}}}}{1}
{]}{{{\color{delim}{]}}}}{1},
}
It doesn't work either for any other language... I assume an issue with ├─ and | in the listing. Does anyone know where the issue lies or can recommend another package for this?


