|
| 1 | +# Emerald - Documentation |
| 2 | + |
| 3 | +To install to view locally: |
| 4 | + |
| 5 | +```bash |
| 6 | +python3 -m venv ~/mkdocs-env |
| 7 | +source ~/mkdocs-env/bin/activate |
| 8 | +pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin mkdocs-github-admonitions-plugin |
| 9 | +mkdocs --version # To verify the installation |
| 10 | +``` |
| 11 | + |
| 12 | +To view the documentation locally: |
| 13 | + |
| 14 | +```bash |
| 15 | +mkdocs serve |
| 16 | +``` |
| 17 | + |
| 18 | +When you are done, deactivate the virtual environment: |
| 19 | + |
| 20 | +```bash |
| 21 | +deactivate |
| 22 | +``` |
| 23 | + |
| 24 | +### How to Add Documentation |
| 25 | + |
| 26 | +`mkdocs awesome-pages` plugin is used to auto generate the navigation for nested directories in `docs/`. |
| 27 | + |
| 28 | +To add a new page, create a new markdown file in the `docs/{topic}/` directory. The file should have a `.md` extension. |
| 29 | + |
| 30 | +Each directory 1 level into `docs/` should have an `index.md` file. This file should contain the title `Overview` and a brief description of the contents of the directory. |
| 31 | + |
| 32 | +All nested directories only need to contain the documentation files for the topics they cover. |
| 33 | +Example `docs/infra/ovh/provision-server.md` will be automatically added to the navigation. |
| 34 | + |
| 35 | +### How to Style Documentation |
| 36 | + |
| 37 | +`mkdocs-github-admonitions-plugin` is used to support GitHub-style admonitions in markdown files. These are rendered consistently in both GitHub and in our MkDocs documentation. |
| 38 | + |
| 39 | +For detailed information on formatting, including: |
| 40 | +- Using admonitions (notes, warnings, tips, etc.) |
| 41 | +- Code block formatting |
| 42 | +- Links and references |
| 43 | +- Other styling guidelines |
| 44 | + |
| 45 | +Please refer to the [MkDocs Styling Guide](docs/mkdocs-styling-guide.md) for comprehensive styling guidelines and examples. |
| 46 | + |
| 47 | +## Using Docker Compose |
| 48 | + |
| 49 | +Setup your environment to have the same user inside the container. |
| 50 | + |
| 51 | +```bash |
| 52 | +echo "UID=$(id -u)" > .env |
| 53 | +echo "GID=$(id -g)" >> .env |
| 54 | +echo "USERNAME=$(id -un)" >> .env |
| 55 | +``` |
| 56 | + |
| 57 | +Start the container, which also builds the image. |
| 58 | + |
| 59 | +```bash |
| 60 | +docker compose up -d |
| 61 | +``` |
| 62 | + |
0 commit comments