doc/manual: put back the manual in the main repository
[nit.git] / doc / manual / nitlanguage.sty
diff --git a/doc/manual/nitlanguage.sty b/doc/manual/nitlanguage.sty
new file mode 100644 (file)
index 0000000..f8d8b11
--- /dev/null
@@ -0,0 +1,45 @@
+% This file is part of Nit ( http://www.nitlanguage.org ).
+%
+% Copyright 2011 Jean Privat <jean@pryen.org>
+%
+% Licensed under the Apache License, Version 2.0 (the "License");
+% you may not use this file except in compliance with the License.
+% You may obtain a copy of the License at
+%
+%     http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS,
+% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+% See the License for the specific language governing permissions and
+% limitations under the License.
+
+\usepackage{lmodern} % because there is a bizarre 'pdfTeX error (font expansion): auto expansion is only possible with scalable fonts' unless
+\usepackage{listings} % because we extends it
+\usepackage{xcolor} % because we like colors
+
+% definition of the nit language
+\lstdefinelanguage{nit}{%
+keywords={import,class,interface,universal,super,fun,var,redef,protected,private,module,init,do,end,new,%
+               return,if,then,else,while,for,loop,in,isa,isset,break,continue,label,%
+               is,abstract,self,true,false,null,nullable,writable,assert,and,or,not,extern,intern},%
+morecomment=[l]{\#},%
+morestring=[b]",%
+}
+
+% disable spaces ij strings by default
+\lstset{showstringspaces=false}
+
+% easy nice environement for nit listings
+%\lstnewenvironment{lst}[1][]{%
+       \lstset{basicstyle=\scriptsize\ttfamily,%
+       keywordstyle=\bf\color{blue!30!black},%
+       commentstyle=\itshape\color{green!30!black},%
+       language=nit,%
+       backgroundcolor=\color{black!10},%
+       moredelim=[is][\color{yellow!30!black}]{@}{@},%
+tabsize=3}%,%
+%      #1}}{}
+
+% makes @ a nice shortcut for inline Nit code
+%\lstMakeShortInline[basicstyle=\small\ttfamily\color{blue!30!black}]{@}