- Notifications
You must be signed in to change notification settings - Fork 1
Documentation generation #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Thanks for the review @botanical, I'm in agreement on all suggestions and have made changes in a01501c. |
botanical left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few comments, but nothing major
| @botanical Thanks Jennifer. Were you able to build the documentation locally? |
Yes 🎉 It makes me think of one thing - maybe in another PR we can add a troubleshooting page for things like if a user runs into: then we can suggest they remember to run That's the only gotcha I ran into because I am using different node versions for different projects. Just a thought 😄 |

This PR does two things:
Script for Documentation Generation
Moves documentation generation from a
lernacommand that generates document on each package to a single script (scripts/docgen.js) that generates documentation for each package. This script works much like thejsii-docgen, but with a few exceptions:@cdk-seedis ignoredcdk-seed/scripts/docgen.js
Lines 1 to 9 in 0d9927a
Jekyll Site
A Jekyll site has been added in the
sitedirectory. This runs the Just The Docs theme which provides search out of the box. We utilize the front matter generated when we create our documentation markdown to create a sense of hierarchy to the modules (i.e. theREADME.mdof each package renders as a link in the side-navbar, the classes and props of each package render as links under thatREADME.md's documentation).The process to generate documentation is a bit intricate, I attempted to capture the steps here:
cdk-seed/README.md
Lines 49 to 62 in b887955
The act of creating helper commands to watch for new builds and new documentation was a bit wild for the following reasons:
jsiisupports a-wflag for running in watch mode to generate.jsiifiles on changes to the*.tsfiles, however it does not trigger rebuilds on changes toREADME.mdfiles (however, thoseREADME.mdfiles are used to generate.jsiifiles). For this reason, I had to wrap the command in another watch command withnodemon.nodemondoes not do well watching files without filenames (i.e. files that are only extensions, such as.envor.jsii). For this reason, we need to manually discover and add each.jsiifilepath as a-wcommand tonodemon($(for f in packages/*/.jsii; do echo \"-w $f\"; done)). Related issue.cdk-seed/package.json
Lines 16 to 22 in b887955
Ultimately, I don't believe that
jsii-docgenis the best tool for documentation generation. It gets us a lot for not much effort (docgen from both code andREADME.md), but it doesn't seem to display any JSDoc blocktags aside from@deprecated(which only renders with a warning triangle, but no message, issue). After doing some research, I think something like using TypeDoc to generate JSON which is then parsed and rendered by Jekyll would give much greater control about the UI elements but would require much more work (blogpost on topic).cdk-seed/CONTRIBUTING.md
Line 50 in b887955