Daily CheckIn
This commit is contained in:
parent
1bcc6e1c15
commit
a1af60e945
9 changed files with 315 additions and 13 deletions
45
tools/yaml_syntax_highlighting.tex
Normal file
45
tools/yaml_syntax_highlighting.tex
Normal file
|
@ -0,0 +1,45 @@
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%% YAML syntax highlighting %%%%%%%%%%%%%%%%%
|
||||
|
||||
% http://tex.stackexchange.com/questions/152829/how-can-i-highlight-yaml-code-in-a-pretty-way-with-listings
|
||||
|
||||
% here is a macro expanding to the name of the language
|
||||
% (handy if you decide to change it further down the road)
|
||||
\newcommand\YAMLcolonstyle{\color{red}\mdseries}
|
||||
\newcommand\YAMLkeystyle{\color{black}\bfseries}
|
||||
\newcommand\YAMLvaluestyle{\color{blue}\mdseries}
|
||||
|
||||
\makeatletter
|
||||
|
||||
\newcommand\language@yaml{yaml}
|
||||
|
||||
\expandafter\expandafter\expandafter\lstdefinelanguage
|
||||
\expandafter{\language@yaml}
|
||||
{
|
||||
keywords={true,false,null,y,n},
|
||||
keywordstyle=\color{darkgray}\bfseries,
|
||||
basicstyle=\YAMLkeystyle, % assuming a key comes first
|
||||
sensitive=false,
|
||||
comment=[l]{\#},
|
||||
morecomment=[s]{/*}{*/},
|
||||
commentstyle=\color{purple}\ttfamily,
|
||||
stringstyle=\YAMLvaluestyle\ttfamily,
|
||||
moredelim=[l][\color{orange}]{\&},
|
||||
moredelim=[l][\color{magenta}]{*},
|
||||
moredelim=**[il][\YAMLcolonstyle{:}\YAMLvaluestyle]{:}, % switch to value style at :
|
||||
morestring=[b]',
|
||||
morestring=[b]",
|
||||
literate = {---}{{\ProcessThreeDashes}}3
|
||||
{>}{{\textcolor{red}\textgreater}}1
|
||||
{|}{{\textcolor{red}\textbar}}1
|
||||
{\ -\ }{{\mdseries\ -\ }}3,
|
||||
}
|
||||
|
||||
% switch to key style at EOL
|
||||
\lst@AddToHook{EveryLine}{\ifx\lst@language\language@yaml\YAMLkeystyle\fi}
|
||||
\makeatother
|
||||
|
||||
\newcommand\ProcessThreeDashes{\llap{\color{cyan}\mdseries-{-}-}}
|
||||
|
||||
%%%%%%%%%%% YAML syntax highlighting %%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Loading…
Add table
Add a link
Reference in a new issue