|
| 1 | +# Documentation |
| 2 | + |
| 3 | +This site uses MkDocs to build its documentation and GitHub Pages for hosting. |
| 4 | + |
| 5 | +## Format |
| 6 | + |
| 7 | +Documentation within this project follows the following pattern: |
| 8 | + |
| 9 | +- A `README.md` for each component |
| 10 | +- A `/docs` folder for the project |
| 11 | + |
| 12 | +Each `README.md` should contain: |
| 13 | + |
| 14 | +- A description of what the component is/does |
| 15 | +- A list of any prerequisites |
| 16 | +- Setup instructions |
| 17 | +- Execution instructions |
| 18 | +- Deployment instructions |
| 19 | + |
| 20 | +The `/docs` folder should contain: |
| 21 | + |
| 22 | +- A description of what the project is |
| 23 | +- An overview of how the everything fits together in the project |
| 24 | +- An explanation of the tech stack |
| 25 | +- Details of the underlying dataset |
| 26 | + |
| 27 | +A majority of the information should reside within the `/docs` directory over the `README`. The `README`s in this project should be kept for concise instructions on how to use each component. Any detailed explanation should be kept within `/docs`. |
| 28 | + |
| 29 | +## Getting MkDocs Setup |
| 30 | + |
| 31 | +In order to build an MkDocs deployment or serve the documentation locally, we need to install MkDocs and its dependencies. |
| 32 | + |
| 33 | +1. Navigate into the project's root directory. |
| 34 | + |
| 35 | +2. Install MkDocs and its dependencies. |
| 36 | + |
| 37 | + ```bash |
| 38 | + make install-docs |
| 39 | + ``` |
| 40 | + |
| 41 | +3. You can now use MkDocs. To see a list of commands run the following: |
| 42 | + |
| 43 | + ```bash |
| 44 | + mkdocs --help |
| 45 | + ``` |
| 46 | + |
| 47 | +## Updating MkDocs Deployment |
| 48 | + |
| 49 | +### GitHub Action to Deploy Documentation |
| 50 | + |
| 51 | +A GitHub Action is set up to automatically deploy the documentation to GitHub Pages whenever a commit is made to the `main` branch. This action is triggered by a push event to the `main` branch and runs the `mkdocs gh-deploy` command to build and deploy the documentation. |
| 52 | + |
| 53 | +### Manual Deployment |
| 54 | + |
| 55 | +If changes are made within `/docs`, the GitHub Pages deployment will need to be updated. Assuming you have already installed [MkDocs](https://www.mkdocs.org/getting-started/#installation) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/getting-started/#installation), do the following: |
| 56 | + |
| 57 | +1. Navigate to the projects root directory. |
| 58 | + |
| 59 | +2. Deploy the documentation to GitHub Pages. |
| 60 | + |
| 61 | + ```bash |
| 62 | + mkdocs gh-deploy |
| 63 | + ``` |
| 64 | + |
| 65 | +3. This will build the documentation and deploy it to the `gh-pages` branch of your repository. The documentation will be available at `https://ONS-Innovation.github.io/<repository-name>/`. |
| 66 | + |
| 67 | +**Please Note:** The `gh-deploy` command will overwrite the `gh-pages` branch and make the local changes available on GitHub Pages. Make sure that these changes are appropriate and have been reviewed before deployment. |
0 commit comments