Json.docs is a project mainly written in JavaScript, it's free.
documentation system for the monkey programming language
This is the modules documentation system provided with the monkey programming language. It uses JavaScript and JSON data to build the page.
Benefits of this approach are: speed, flexibility, smaller data size, the ability to bookmark specific pages, and also to search through the data locally.
The system is also extensible, in that if you write your own module you can also add your it's documentation to the system. This is shown in the json-demo.js
file. You'll probably want to write some sort of converter to take a text file and spit out JSON.
To add your own docs to the system, we do the following:
<script type="text/javascript" charset="utf-8" src="json-demo.js"></script>
...and that's it!
Note it might be easier if you auto generate your JSON data!
Search data consists of an array of id/text pairs.
id
is the link that is followed for search results
text
is the text that will appear in the search list
Content data is an array of content entries. For each content entry there must be at least one .main and one .contents entry:
.main
contains the breadcrumb trail and the definition of the modulebreadcrumbs
is an array of name/link pairsdefinition
consists of arbritrary fields, usually a heading/introductory pair.contents
is an array of sub nav items, each containing name/link pairs. It can contain as many sections as you wish in this example demo.module
has three: globals
, functions
and classes
- but they can be named whatever you wish.Each sub nav item also needs a content entry, consisting of the main page content. Again, definition can contain arbritrarily named fields but there are special names:
heading
becomes the page headingsyntax
presented as a prominent highlightparameters
presented as a second level highlightexample
presented in a way that allows <pre> formatted source code.Module data is an array of top level module names as name/link pairs.
name
is the display namelink
is the url slugBoth are currently the same, but may become different in future.
json-docs is made available under a Creative Commons Attribution-Share Alike 3.0 Unported License.
You can talk about the documentation system on the official monkey forum.
Please report any problems in the documentation itself in the documentation problems thread
1.0 (2011-03-01)
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1