GenDocs 3.0-alpha004
GenDocs is a utility for easily creating documentation for AutoHotkey libraries. It supports the following structures:
- Functions
- Pages
- Classes
- Constructors
- Methods
- Properties
- Inner classes
GenDocs works via specially-crafted comment blocks. For more information, look at the example below.
GenDocs-flavored Markdown
GenDocs uses a stripped down version of Markdown, which supports:
- Paragraphs: blocks of text delimited by blank lines. Equivalent to HTML
<p>...</p>
. - In-paragraph line breaks: end a line with two spaces. Equivalent to HTML
<br/>
. - Headings: start a line with up to three hash (
#
) characters, followed by space. Equivalent to HTML<hN>...</hN>
. - Emphasis marks:
*...*
. Equivalent to HTML<em>...</em>
. - Strong emphasis marks:
**...**
. Equivalent to HTML<strong>...</strong>
. - Inline code marks:
`...`
. Equivalent to HTML<code>...</code>
. - Code sections: unlike standard Markdown, they use the blockquote syntax: blocks of text whose lines start with
>
followed by a space. - Unordered lists: lines that start with
*
. Equivalent to HTML<ul>...<li>...</li>...</ul>
. - Ordered lists: lines that start with a number, dot and space (e.g.
1.
); or letter, dot and space (e.g.a.
). Equivalent to HTML<ol>...</ol>
and<ol style="list-style-type: lower-alpha">...</ol>
respectively. - Escape sequences: the sequences
\*
,\`
,\[
,\]
,\!
and\\
are recognized, and yield literal characters. - Links:
[Link text](Link URL)
. Equivalent to HTML<a href="...">...</a>
. - Images:
![Image ALT text](Image file name)
. Equivalent to HTML<img src="..." alt="..."/>
.
Running GenDocs
Open the script you want to generate the documentation for, then click on its icon in the toolbar
() then on the Generate button.
![](gendocs.png)
Documentation is always saved on the folder %SelectedScriptDir%\%SelectedScriptName%-doc.
Example
/*! Library: Test library, version 1.0 This library does something or maybe not! In-paragraph line breaks work Author: fincs License: WTFPL */ /*! Page: Test Page Filename: TestPage Contents: @file:TestPage.md */ /*! Function: something(a, b [, c]) something() does something :) Parameters: a - Something > MsgBox Yay, this works?! ; comment! b - Something else c - (Optional) Even more stuff Remarks: Meow. Returns: Dinner, really :) Extra: ### It looks like everybody's been taken to Tykogi Tower! Oh, my! Throws: Stuff if stuff */ something(a, b, c="") { } /*! Class: MyClass Provides an interface to *dinner* Inherits: OtherClass Example: @file:TestExample.ahk */ class MyClass extends OtherClass { /*! Constructor: (a) Creates a MyClass object. Parameters: a - Something */ __New(a) { } /*! Method: Hello() Displays hello world message. */ Hello() { } __Get(m, p*) { return this["get_" m](p*) } __Set(m, ByRef v, p*) { return this["set_" m](v, p*) } /*! Property: Something [get/set] It's the something of a something Value: The something to set Remarks: Automagically dinner */ get_Something() { } set_Something(ByRef v) { } /*! Class: Meow What do you want me to do?!?! @UseShortForm Example: > MsgBox Meow example ; Testing */ class Meow { /*! Method: Hello([msg]) Displays a greeting message. Parameters: msg - (Optional) The message to display. Defaults to "Hello, world!". Returns: Absolutely nothing :) Throws: Again, nothing :) */ Hello(msg="Hello, world!") { MsgBox, % msg } /*! Class: MoreNesting Nesting is so much fun! Example: > MsgBox MoreNesting example ; Testing */ class MoreNesting { /*! Property: HasDinner [get] Does this object have dinner? */ __Get(m) { if m = HasDinner return true } } /*! End of class */ } /*! End of class */ /*! Class: InnerCls This time it's dinnerish! @UseShortForm */ class InnerCls { /*! Constructor: (params...) Parameters: params - The parameters to use to create the object. Throws: I have no clue! */ __New(prm*) { } } /*! End of class */ } /*! End of class */