tree: 5c47f636f6f864be651ce0b992ec5a32b5955d9b [path history] [tgz]
  1. api/
  2. assets/
  3. contributing/
  4. install/
  5. rules/
  6. faq.md
  7. index.md
  8. quick-start.md
  9. readme.md
documentation/release-latest/docs/readme.md

Build & test documentation on local machine

The documentation of ktlint is served with mkdocs-material. For full documentation visit mkdocs.org.

To build and test documentation on your local development machine, follow steps below:

Setup

  1. In IntelliJ IDEA
    • Open Preferences
    • Search for JSON Schema mappings
    • Add new schema for url https://squidfunk.github.io/mkdocs-material/schema.json and add file mkdocs.yml for this url.
  2. Pull docker image
    $ docker pull squidfunk/mkdocs-material
    

Build server

The following steps build and host the documentation locally, updating automatically whenever a local file is changed.

  1. Start mkdocs server from root of project (e.g. from same directory where file mkdocs.yml is located)
    docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
    
  2. Visit page http://0.0.0.0:8000/ in your browser.
  3. Edit the documentation and explicitly save the file. The mkdocs server refreshes its cached and the current page in the browser is automatically refreshed.

Build once

If you do not want to run a local server, or if you want to inspect the built files, you can run the following command from the project's main directory to build the documentation in the site/ directory.

docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material build