LuaAutoDoc class

This class builds a single-page html webpage from the documentation of all the global variables in a provided runtime implementation. See generateDocs.

Constructors

LuaAutoDoc(String title, {String? version, String? dateTimeFormat, bool showSidebarIndex = false, String js = prism.js, String css = prism.css})
Construct an autodoc instance with title and version subtext. By default showDateTime is false. If set to true, a datetime stamp stub will appear near the title of the ToC. By default both js and css use prism.js and prism.css contents respectively. You can replace these and they will populate the output HTML and tags with their corresponding contents.

Properties

css String
The custom css script contents. Each lua entry will have a
final
dateTimeFormat String?
Optional date time of document generation. If this is set, datetime will appear in the html output formatted using the intl package DateFormat specification: https://pub.dev/documentation/intl/latest/intl/DateFormat-class.html
final
hashCode int
The hash code for this object.
no setterinherited
js String
The custom js script contents.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showSidebarIndex bool
Optional flag to move the index into a sidebar on the page that sticks to the reader's screen while they scroll. This will also remove the floating carrot button that normally takes the user to the top of the page where the index was.
final
title String
The title which will appear on the webpage.
final
version String?
The optional version text will appear next to the title.
final

Methods

generateDocs(BaseRuntime runtime, {required String outDir}) → void
Given a runtime implementation and an outDir, collects the global variables and extracts their LuaDoc information while traversing lua objects and their properties. The html will contain js and css markup to prettify the document.
luaObj2Html(String title, LuaObject luaObj, {LuaObject? parent}) String
If the object's storage is a primitive value, then it tries to visit LuaDoc.keyValueHtml. If it is not excluded via LuaDoc.exclude, then it will render out to html. If the object's storage is that of a function or a table, then fields will also be visited and pushPath update the new anchor tag. After visiting, popPath is called to restore the previous depth information. The end result is a String of decorated html for the autodoc.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popPath() String
Removes the last id from the anchor path stack. Returns the anchor tag string value of the updated path.
pushPath(String label) String
Deeply nested tables will have their paths preserved to construct anchor tags. This will also return the current anchor tag string value.
renderIndex() String
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited