Skip to content
Snippets Groups Projects

Full rebase of Marco's changes

Open Simon Schuster requested to merge marcos-full-changes-rebased into master
4 files
+ 78
59
Compare changes
  • Side-by-side
  • Inline
Files
4
  • 6ee5c678
    Listings: use minted/pygments · 6ee5c678
    Marco Ammon authored
    Syntax highlighting with ```lstlistings``` is semi-broken as highlighting
    keywords does not work correctly.
    
    This patch introduces ```minted``` instead, which uses the python script
    ```pygmentize```.
+ 26
14
@@ -186,20 +186,32 @@ Based on the periodically transmitted \texttt{hello} messages, the joining node
\subsection{Program Code}
Program code should be omitted, but if absolutely necessary, it should be set as seen in \cref{lst:code}.
\begin{lstlisting}[style=txt,caption=Sample application,label=lst:code]{}
APPLICATION("printU", 192, arg)
{
// Set Priority
NutThreadSetPriority(16);
// main() loop
for (;;) {
putchar('U');
NutSleep(125);
}
}
\end{lstlisting}
Program code should be omitted, but if absolutely necessary, it should be set as seen in \Cref{lst:example-full,lst:example-partial,lst:example-document}.
\begin{listing}
\inputminted{C}{example.c}
\caption{Listing from example file, fully included}
\label{lst:example-full}
\end{listing}
\begin{listing}
\inputminted[firstline=1, lastline=2]{C}{example.c}
\caption{Listing from example file, partially included}
\label{lst:example-partial}
\end{listing}
\begin{listing}
\begin{minted}[autogobble]{C}
#include <stdio.h>
void main (int argc, char **argv) {
for (int i = 0; i < 42; i++) {
printf("\%d\n", i);
}
}
\end{minted}
\caption{Listing defined in document}
\label{lst:example-document}
\end{listing}
\subsection{References}
Loading