Contributing to the docs is pretty easy.
If it's just a single typo fix or similar in just one file, you can just do it straight from the web interface or the GitHub app:
- Find the page you're looking for. Example: https://mithril.js.org/animation.html
- Go to the same-named path in the
docs/
directory here. Example: https://github.com/MithrilJS/docs/blob/main/docs/animation.md - Click the pencil icon to edit.
- Make the changes you want.
- Click "Commit changes" and fill out that mini form. Description is optional, but helpful if you need more explanation than the title can afford.
- Click "Propose changes" and go through the form to create a pull request. Make sure the checkbox to allow maintainer edits is checked, so we can more easily merge it if it can't be merged cleanly.
If it's something bigger, you can roughly follow these instructions here. For the docs, there really isn't anything to test, so you can skip that step for those. Elsewhere, testing is all manual.
There's a few commands you can use to help hash out larger changes. The last command is the one you'll likely be using the most.
Note that you'll need to run
npm install
to run any of these (and obviously, you'll need to have Node installed). Also, you'll need Node v20.12.2 or later.
npm run lint:docs
: Lint just the docs.npm run lint
: Lint the docs and scripts.npm run build
: Build the docs.npm run watch
: Build the docs on change, lint the docs on change, and start a local server to view the generated docs athttp://localhost:8080/
.