add gendocs command for generating help page markdown from jsdoc #164
+268
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #127
this pr adds a new
gendocscommand for generating help documentation pages for an extension based on the jsdoc in the APIs. it works by fetching the symbol info for the project from the language service, which helpfully includes the jsdoc and the filepath that defines each symbol (so we can detect which APIs are from this extension). for the signature of each API at the top of the page, i use the snippets we generate for the monaco editor completions.the command has three flags:
--out-dir(optional): defines the output directory for the markdown pages--repo-name(required): the github repo for the extension. this is used for thepackageannotation at the bottom of the docs pages--annotate(optional): if specified, the command will also attempt to insert the//% helpannotations for you in your typescript filesone caveat to note: the makecode language service requires that there be at least two blank lines between the description of an API in JSDoc and the start of the
@paramannotations! i did not know this, but discovered while testing.also adds a hidden
api-infocommand that dumps the api info for a project in a JSON file. this is mostly for testing