You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have a tool that generates human-readable documentation for Cadence programs.
Suggest A Solution
Most pieces to build such a tool are in place:
The AST is well-defined and can be serialized to a well-defined JSON format if needed (i.e. the tool could be potentially written in a language other than Go)
The parser parses documentation comments ("docstrings"; line comments starting with /// and block comments starting with /**) for all declarations
The tool's main task would be to traverse the AST and generate e.g. Markdown, HTML, etc.
To generate the output, the documentation comments need to be written in a specific format/syntax. AFAIK there is no standard for this across programming languages. I think it would be best to adopt something that exists, I don't think it's necessary to reinvent the wheel here.
Inspiration:
Swift: Markdown-based, with certain keywords like "Parameters"
Issue To Be Solved
It would be nice to have a tool that generates human-readable documentation for Cadence programs.
Suggest A Solution
Most pieces to build such a tool are in place:
///
and block comments starting with/**
) for all declarationsThe tool's main task would be to traverse the AST and generate e.g. Markdown, HTML, etc.
To generate the output, the documentation comments need to be written in a specific format/syntax. AFAIK there is no standard for this across programming languages. I think it would be best to adopt something that exists, I don't think it's necessary to reinvent the wheel here.
Inspiration:
@
prefix)@
prefix)Choosing a Markdown-based format has the benefit that it e.g. allows adding sections, example code blocks, etc.
Definition of Done
The text was updated successfully, but these errors were encountered: