Skip to content

Instantly share code, notes, and snippets.

@zoechi
Created March 12, 2015 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoechi/8b0e04d454e1e3f43118 to your computer and use it in GitHub Desktop.
Save zoechi/8b0e04d454e1e3f43118 to your computer and use it in GitHub Desktop.
AsciiDoc dblatex.sty with Dart support
%%
%% This style is derived from the docbook one.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{asciidoc}[2008/06/05 AsciiDoc DocBook Style]
%% Just use the original package and pass the options.
\RequirePackageWithOptions{docbook}
% Sidebar is a boxed minipage that can contain verbatim.
% Changed shadow box to double box.
\renewenvironment{sidebar}[1][0.95\textwidth]{
\hspace{0mm}\newline%
\noindent\begin{Sbox}\begin{minipage}{#1}%
\setlength\parskip{\medskipamount}%
}{
\end{minipage}\end{Sbox}\doublebox{\TheSbox}%
}
% For DocBook literallayout elements, see `./dblatex/dblatex-readme.txt`.
\usepackage{alltt}
%% documentation http://ctan.sharelatex.com/tex-archive/macros/latex/contrib/listings/listings.pdf
%% example https://svn.opsi.org/filedetails.php?repname=opsidoc&path=%2Ftrunk%2Fconf%2Fdblatex%2Fasciidoc-dblatex.sty&rev=2
\definecolor{listingDartDocCommentColor}{rgb}{0.0,0.5,0.0}
\definecolor{listingDartTodoColor}{rgb}{0.6,0.0,0.0}
\definecolor{listingDartKeywordColor}{rgb}{0.1,0.0,0.5}
\lstdefinelanguage{dart} {
morekeywords={assert,break,case,catch,class,const,continue,default,do,else,
enum,extends,false,final,finally,for,if,in,is,new,null,rethrow,return,super,
switch,this,throw,true,try,var,void,while,with,abstract,as,deferred,dynamic,
export,external,factory,get,implements,import,library,operator,part,set,
static,typedef,async,async*,sync*,await,yield},
morekeywords=[2]{String,int,num},
sensitive=true,
morecomment=[l]{//},
morecomment=[l][\color{listingDartDocCommentColor}\bfseries]{///},
morecomment=[l][\color{listingDartTodoColor}\bfseries]{//\ TODO},
morecomment=[l][\color{listingDartTodoColor}\bfseries]{///\ TODO},
morecomment=[s]{/*}{*/},
morecomment=[s][\color{listingDartTodoColor}\bfseries]{/*\ TODO}{*/},
morestring=[b]",
morestring=[b]',
morestring=[b]''',
%% doesn't work moredelim=*[s][\color{listingDartKeywordColor}\bfseries]{\{}{\}},
%% probably a solution http://tex.stackexchange.com/questions/152829/
extendedchars=true,
keywordstyle={\color{listingDartKeywordColor}},
keywordstyle=[2]{\color{blue}},
identifierstyle=\color{black},
breaklines={true},
}
\definecolor{gray}{rgb}{0.4,0.4,0.4}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
\lstdefinelanguage{XML}
{
morestring=[b]",
morestring=[s]{>}{<},
morecomment=[s]{<?}{?>},
morecomment=[s]{<!--}{-->},
stringstyle=\color{black},
identifierstyle=\color{darkblue},
keywordstyle=\color{cyan},
morekeywords={xmlns,version,type}% list your attributes here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment