class

Myst::Doc::Generator

Inherits Reference / Object

An AST visitor for parsing doc comments from Myst source code and emitting the content in a JSON structure.

Currently only operates on the given source, does not follow requires or other imports.

Constructors

new(doc_yml : String)
Source

Class methods

auto_document(directory, doc_yml)

Automatically scan everything in the current directory to find Myst files that can be documented.

Source

Instance methods

document(node : Node)
Source
json
Source
visit(node : DocComment)
Source
visit(node : ModuleDef, doc : String | Nil = nil)
Source
visit(node : TypeDef, doc : String | Nil = nil)
Source
visit(node : Def, doc : String | Nil = nil)
Source
visit(node : SimpleAssign, doc : String | Nil = nil)

Only constants that are assigned with SimpleAssigns are documentable. The entire SimpleAssign is visited so that the value being assigned can also be captured and added to the documentation.

Source
visit(node : Node, doc : String | Nil = nil)

Automatically recurse through all non-special nodes

Source