Skip to content

Commit

Permalink
fixes #4751: fixed warnings and errors when generating JavaScript API…
Browse files Browse the repository at this point in the history
… reference (patch 3/4)

- removed unused commands for syntax highlighting
- literal square brackets no longer confused with optional environment arguments
- suppressed warning about missing author
- ensured correct references by using `hevea -fix <file>`
  • Loading branch information
Forgon2100 committed Feb 22, 2018
1 parent 15fa86d commit 3fb2dc2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Makefile.am
Expand Up @@ -84,14 +84,14 @@ javascript-doc-base:

javascript-doc: javascript-doc-base
if PDFLATEX
(cd doc ; pdflatex javascript.tex)
(cd doc; pdflatex javascript.tex)
else
echo "You need pdflatex installed!"
endif

javascript-doc-html: javascript-doc-base
if HEVEA
(cd doc; hevea javascript.tex; hevea javascript.tex)
(cd doc; hevea -fix javascript.tex)
if HACHA
(cd doc; hacha -o javascript-index.html javascript.html)
endif
Expand Down
17 changes: 8 additions & 9 deletions doc/javascript.tex
@@ -1,16 +1,16 @@
\documentclass[12pt]{article}
\usepackage{listings}
\lstset{frame=trBL, aboveskip=15pt, belowskip=15pt, xleftmargin=20pt, xrightmargin=20pt}
\usepackage[utf8]{inputenc}
\usepackage{underscore}
\lstloadlanguages{C++}
\lstset{language=C++, frame=trBL, aboveskip=15pt, belowskip=15pt, xleftmargin=20pt, xrightmargin=20pt}
\title{Warzone2100 JavaScript Scripting API}
\date{}
\title{Warzone 2100 JavaScript Scripting API}
\author{}
\begin{document}
\maketitle

\section{Introduction}

Warzone2100 contains a scripting language for implementing AIs, campaigns and some of the game
Warzone 2100 contains a scripting language for implementing AIs, campaigns and some of the game
rules. It uses JavaScript, so you should become familiar with this language before proceeding
with this document. A number of very good guides to JavaScript exist on the Internet.

Expand All @@ -24,7 +24,7 @@ \section{Introduction}
For ordinary AI scripts, these are controlled using '.ai' files that are present in the 'multiplayer/skirmish'
directory. Here is an example of an '.ai' file that defines an AI implemented using this API:

\begin{lstlisting}
\begin{lstlisting}[]
[AI]
name = "Semperfi JS"
js = semperfi.js
Expand Down Expand Up @@ -71,7 +71,7 @@ \subsection{Challenges}
this case, you must implement your own rules for winning and losing, among other things. Here is an example
of such a scripts section:

\begin{lstlisting}
\begin{lstlisting}[]
[scripts]
rules = towerdefense.js
\end{lstlisting}
Expand All @@ -82,7 +82,7 @@ \subsection{Challenges}
this player to be controlled from one of your challenge scripts), then you can give it the special value "null".
Here is an example if a challenge player definition with its AI specified:

\begin{lstlisting}
\begin{lstlisting}[]
[player_2]
name = "Enemy"
team = 1
Expand Down Expand Up @@ -156,4 +156,3 @@ \subsection{Cyborg construction}
\input{campaign}

\end{document}

0 comments on commit 3fb2dc2

Please sign in to comment.