class Myst::Doc::Generator

Overview

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.

Defined in:

myst/tools/doc.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(doc_yml : String) #

[View source]

Class Method Detail

def self.auto_document(directory, doc_yml) #

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


[View source]

Instance Method Detail

def document(node : Node) #

[View source]
def json #

[View source]
def visit(node : DocComment) #

[View source]
def visit(node : ModuleDef, doc : String | Nil = nil) #

[View source]
def visit(node : TypeDef, doc : String | Nil = nil) #

[View source]
def visit(node : Def, doc : String | Nil = nil) #

[View source]
def 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.


[View source]
def visit(node : Node, doc : String | Nil = nil) #

Automatically recurse through all non-special nodes


[View source]