Skip to content

Commit 22237ac

Browse files
author
Juha Mustonen
committed
1 parent 99c2753 commit 22237ac

40 files changed

+4177
-0
lines changed

Diff for: build.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Directory where the jsdoc-toolkit is installed
2+
jsdoc-toolkit.dir=/opt/jsdoc-toolkit
3+
4+
# Directory where to find rst templates
5+
tmpl.dir=templates/rst
6+
7+
# Directory where to find javascript sources
8+
js.src.dir=src/js
9+
10+
# Directory where to generate rst files
11+
js.rst.dir=dist/rst

Diff for: build.xml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<project name="jsdoc-toolkit-rst-template" default="build" basedir=".">
2+
<description>Project provides the ReStructuredText -compliant template for JsDoc-Toolkit</description>
3+
4+
<property file="local.properties" />
5+
<property file="build.properties" />
6+
7+
<!-- set global properties for this build -->
8+
<property name="templates" location="${basedir}/templates"/>
9+
<property name="doc" location="doc"/>
10+
<property name="build" location="build"/>
11+
<property name="dist" value="${basedir}/dist"/>
12+
<property name="test" location="test"/>
13+
<property name="tmpl" location="templates"/>
14+
<property name="version" value="1.0"/>
15+
16+
<macrodef name="jsdoc">
17+
<attribute name="tmpldir" default="${jsdoc-toolkit.dir}/templates/jsdoc"/>
18+
<attribute name="outdir" default="${doc}/api"/>
19+
<attribute name="srcdir" default="${jsdoc-toolkit.dir}/app/"/>
20+
<attribute name="rlevel" default="5"/>
21+
22+
<sequential>
23+
<echo>Generating api documentation from @{srcdir} (template dir: @{tmpldir})</echo>
24+
<mkdir dir="@{outdir}" />
25+
<java
26+
dir="${basedir}"
27+
jar="${jsdoc-toolkit.dir}/jsrun.jar"
28+
fork="true"
29+
failonerror="true"
30+
maxmemory="128m"
31+
>
32+
<jvmarg value="-Djsdoc.dir=${jsdoc-toolkit.dir}"/>
33+
<jvmarg value="-Djsdoc.template.dir=${tmpldir}"/>
34+
<arg value="${jsdoc-toolkit.dir}/app/run.js"/>
35+
<arg value="--recurse=@{rlevel}"/>
36+
<arg value="--template=@{tmpldir}"/>
37+
<arg value="--directory=@{outdir}"/>
38+
<arg value="--verbose"/>
39+
<arg value="@{srcdir}"/>
40+
</java>
41+
<echo>generation finished. output dir: @{outdir}</echo>
42+
</sequential>
43+
</macrodef>
44+
45+
<macrodef name="sphinxb">
46+
<attribute name="builder" default="html"/>
47+
<attribute name="source" default="${basedir}/doc"/>
48+
<attribute name="target" default="${dist}/doc/@{builder}"/>
49+
<sequential>
50+
<mkdir dir="@{target}" />
51+
<exec executable="sphinx-build">
52+
<arg line="-E -b @{builder} @{source} @{target}"/>
53+
</exec>
54+
</sequential>
55+
</macrodef>
56+
57+
<target name="init">
58+
<tstamp/>
59+
<!-- Create the build directory structure used by compile -->
60+
<mkdir dir="${build}"/>
61+
<mkdir dir="${build}/api"/>
62+
</target>
63+
64+
<target name="build" depends="init" description="Generate RST files from JS sources">
65+
<jsdoc tmpldir="${tmpl.dir}" srcdir="${js.src.dir}" outdir="${js.rst.dir}"/>
66+
</target>
67+
68+
<target name="test" description="Test template with jsdoc-tookit itself">
69+
<jsdoc tmpldir="${tmpl.dir}" srcdir="${jsdoc-toolkit.dir}/app" outdir="${doc}/api/jsdoc-toolkit/" />
70+
<jsdoc tmpldir="${jsdoc-toolkit.dir}/templates/jsdoc" srcdir="${jsdoc-toolkit.dir}/app" outdir="${dist}/jsdoc-toolkit.html/"/>
71+
</target>
72+
73+
<target name="doc" description="Build the documentation">
74+
<jsdoc tmpldir="${tmpl.dir}" srcdir="${tmpl}/rst/" outdir="${doc}/api/template/" />
75+
<sphinxb source="${doc}" builder="html"/>
76+
</target>
77+
78+
<target name="dist" depends="clean,build,doc" description="Make distribution">
79+
<echo file="${build}/sources-here.txt">
80+
Put/link your javascript source files in this directory
81+
or define another directory in build.properties with:
82+
83+
js.src.dir=path/to/sources
84+
</echo>
85+
<zip destfile="${dist}/${ant.project.name}-${version}.zip">
86+
<zipfileset dir="${templates}/rst" prefix="templates/rst"/>
87+
<zipfileset dir="${dist}/doc/html" prefix="doc"/>
88+
<zipfileset dir="${build}" includes="sources-here.txt" fullpath="src/sources-here.txt"/>
89+
<zipfileset dir="." includes="build.xml" fullpath="build.xml"/>
90+
<zipfileset dir="." includes="release.properties" fullpath="build.properties"/>
91+
</zip>
92+
</target>
93+
94+
<target name="clean" description="Clean up">
95+
<!-- Delete the ${build} and ${dist} directory trees -->
96+
<delete dir="${build}"/>
97+
<delete dir="${dist}"/>
98+
<delete dir="${basedir}/doc/api"/>
99+
</target>
100+
101+
</project>

Diff for: doc/_static/logo.png

6.31 KB
Loading

Diff for: doc/_static/sphinx.png

22.9 KB
Loading

Diff for: doc/_templates/layout.html

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{#
2+
sphinxdoc/layout.html
3+
~~~~~~~~~~~~~~~~~~~~~
4+
5+
Sphinx layout template for the sphinxdoc theme.
6+
7+
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see LICENSE for details.
9+
#}
10+
{% extends "basic/layout.html" %}
11+
12+
{% block header %}
13+
<style>
14+
p.logo { text-align: center; }
15+
</style>
16+
{% endblock %}
17+
18+
{%- block rootrellink %}
19+
<li><a href="{{ pathto(master_doc) }}">Document home</a>{{ reldelim1 }}</li>
20+
{%- endblock %}
21+
22+
{# put the sidebar before the body #}
23+
{% block sidebar1 %}{{ sidebar() }}{% endblock %}
24+
{% block sidebar2 %}{% endblock %}

Diff for: doc/api/myapp/files.rst

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
API: File index
2+
================
3+
:generator: JsDoc Toolkit
4+
5+
.. contents::
6+
:local:
7+
8+
9+
10+
* test/myapp/myapp.js
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
.. container:: footer
24+
25+
Documentation generated by jsdoc-toolkit_ 2.4.0 using jsdoc-toolkit-rst-template_
26+
27+
.. _jsdoc-toolkit: http://code.google.com/p/jsdoc-toolkit/
28+
.. _jsdoc-toolkit-rst-template: http://code.google.com/p/jsdoc-toolkit-rst-template/
29+
.. _sphinx: http://sphinx.pocoo.org/
30+
31+

Diff for: doc/api/myapp/index.rst

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
=============
2+
API Reference
3+
=============
4+
:generator: JsDoc Toolkit
5+
6+
.. toctree::
7+
:glob:
8+
9+
symbols/*
10+
11+
.. container:: footer
12+
13+
Documentation generated by jsdoc-toolkit_ 2.4.0 using jsdoc-toolkit-rst-template_
14+
15+
.. _jsdoc-toolkit: http://code.google.com/p/jsdoc-toolkit/
16+
.. _jsdoc-toolkit-rst-template: http://code.google.com/p/jsdoc-toolkit-rst-template/
17+
.. _sphinx: http://sphinx.pocoo.org/
18+
19+
20+
21+
.. vim: set ft=rst :

Diff for: doc/api/myapp/symbols/Android.rst

+169
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
2+
3+
===============================================
4+
Android (class)
5+
===============================================
6+
7+
8+
.. contents::
9+
:local:
10+
11+
.. js:class:: Android ()
12+
13+
14+
15+
.. ============================== constructor details ====================
16+
17+
18+
19+
20+
21+
22+
23+
24+
Android is a subclass of Bot
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
.. ============================== properties summary =====================
51+
52+
53+
54+
.. ============================== events summary ========================
55+
56+
57+
58+
59+
60+
.. ============================== field details ==========================
61+
62+
63+
64+
.. ============================== method details =========================
65+
66+
67+
68+
69+
70+
71+
.. js:function:: Android.talk()
72+
73+
74+
75+
76+
77+
Makes the Android talk
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
:returns:
91+
what Android said,
92+
in format: "Android said: <message>"
93+
94+
:rtype: String
95+
96+
97+
98+
99+
100+
101+
:see:
102+
103+
<a href="../symbols/Bot.rst#talk">Bot#talk</a>
104+
105+
#talk
106+
107+
108+
109+
110+
111+
112+
.. js:function:: Android.walk(direction)
113+
114+
115+
116+
117+
118+
:param Direction direction:
119+
120+
X and Y coordiates
121+
122+
123+
124+
125+
126+
This function really does the thing.
127+
128+
129+
130+
131+
.. code-block:: javascript
132+
133+
var bot = new Bot('bot');
134+
bot.walk({x:123, y:2});
135+
136+
137+
138+
139+
140+
141+
142+
143+
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+
.. ============================== event details =========================
155+
156+
157+
158+
.. container:: footer
159+
160+
Documentation generated by jsdoc-toolkit_ 2.4.0 using jsdoc-toolkit-rst-template_
161+
162+
.. _jsdoc-toolkit: http://code.google.com/p/jsdoc-toolkit/
163+
.. _jsdoc-toolkit-rst-template: http://code.google.com/p/jsdoc-toolkit-rst-template/
164+
.. _sphinx: http://sphinx.pocoo.org/
165+
166+
167+
168+
169+
.. vim: set ft=rst :

0 commit comments

Comments
 (0)