Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add how to preview documentation modification #203

Merged
35 changes: 35 additions & 0 deletions docs/contributing/documentation-guidelines/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Documentation guidelines

## Contribution guidelines on Autoware Documentation
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

Contributions to Autoware's documentation are welcome, and the same principles [described in the contribution guidelines](../index.md#pull-requests) should be followed. Small, limited changes can be made by forking this repository and submitting a pull request, but larger changes should be discussed with the community and Autoware maintainers via GitHub Discussion first.

Examples of small changes include:
Expand All @@ -19,3 +21,36 @@ In terms of style, you should refer to the [Google developer documentation style
- [Use sentence case](https://developers.google.com/style/capitalization) for document titles and section headings.
- [Use descriptive link text](https://developers.google.com/style/link-text).
- [Write short sentences](https://developers.google.com/style/translation#write-short,-clear,-and-precise-sentences) that are easy to understand and translate.

## How to preview your modification on Autoware Documentation
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

There are two ways to preview your modification on Autoware Documentation.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

### 1. Use Github Actions workflow in `autowarefoundation/autoware-documentation` repository
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

You can use Github Actions in `autowarefoundation/autoware-documentation` repository to deploy your branch.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

1. Create a PR of your branch to the repository.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved
2. Add a `documentation` label from the sidebar.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved
3. Wait for a couple of minutes, and the `github-actions` will notify the URL for your branch's preview.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

### 2. Run mkdocs in your local environment
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

Instead of creating a PR, you can use `mkdocs` to build the Autoware Documentation website on your local computer.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved
Assuming that you are using Ubuntu OS, run the following to install the required libraries.

```
sudo apt install -y mkdocs
git clone git@github.com:autowarefoundation/autoware-github-actions.git /tmp/autoware-github-actions
cd /tmp/autoware-github-actions/deploy-docs
pip install -U -r mkdocs-requirements.txt
```
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

Then, run `mkdocs serve` on your Autoware Documentation directory.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved

```
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved
cd /PATH/TO/autoware-documentation
mkdocs serve
```

It will launch mkdocs server. Access [http://127.0.0.1:8000/autoware-documentation/](http://127.0.0.1:8000/autoware-documentation/) to see the preview of Autoware Documentation.
kenji-miyake marked this conversation as resolved.
Show resolved Hide resolved