Writing 🌈 Documentation¶
If you're contributing a new feature to chromatic, please consider also contributing some documentation to explain how your feature works. Here's the very short version of how to add to the documentation:
- Install in development mode (see Installation), so you have access to mkdocsand the various extensions needed to render the documentation.
- Decide whether your explanation would fit well within an existing page or whether you need a new one. In the docs/directory, find the appropraite.ipynbnotebook file or create a new one. If you create a new one, add it to thenav:section of themkdocs.ymlfile in the main repository directory so thatmkdocswill know to include it.
- Write your example and explanation in a .ipynbfile. Your audience should be smart people who want to use the code but don't have much experience with it yet. Be friendly and encouraging!
- From the Terminal, run mkdocs serve. This will convert all of the source notebooks into a live website, and give you a little address that you can copy and paste into a browser window. While thatmkdocs servecommand is still running, small changes you make to existing.ipynbsource files will appear (sometimes after a few minutes) on the live locally-hosted webserver.
- Once you're happy with your new documentation, before committing it to the repository, please run "Kernal > Restart & Clear Output" or something similar to remove all outputs from the source notebook file. The chromaticrepository will hang onto all changes that you commit to it, so it would very quickly get annoyingly large unless we leave the outputs out of committed notebook files. Double check the outputs are all gone, save your notebook, and then commit it to thegitrepository (see Contributing 🌈 Code with GitHub).
Periodically, after reviewing and copy-editing the documentation, we'll deploy the newest version up to the web at zkbt.github.io/chromatic/ for all to enjoy.