Skip to content

Commit d1d637c

Browse files
committed
Add mkdocs spellcheck and doc contribution guide
For kubernetes-sigs#312
1 parent 2577f63 commit d1d637c

File tree

4 files changed

+158
-3
lines changed

4 files changed

+158
-3
lines changed

mkdocs.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,34 @@ plugins:
2626
- macros:
2727
j2_line_comment_prefix: "#$"
2828
- mermaid2
29+
- spellcheck:
30+
backends:
31+
- symspellpy
32+
- codespell:
33+
dictionaries: [clear, rare, en-GB_to_en-US]
34+
# known_words can also be a list of words
35+
known_words: known_words.txt
36+
# ignore words in <code> tags
37+
ignore_code: yes
38+
# minimum length of words to consider
39+
min_length: 2
40+
# maximum number of capital letters in a word
41+
max_capital: 1
42+
# keep unicode characters
43+
allow_unicode: no
44+
# skip all directories except docs and site-src
45+
skip_files:
46+
- api/*
47+
- client-go/*
48+
- cmd/*
49+
- config/*
50+
- hack/*
51+
- internal/*
52+
- pkg/*
53+
- test/*
54+
- tools/*
55+
# whether to only check in strict mode
56+
strict_only: no
2957
markdown_extensions:
3058
- admonition
3159
- meta
@@ -48,9 +76,9 @@ nav:
4876
- Overview:
4977
- Introduction: index.md
5078
- Concepts:
51-
API Overview: concepts/api-overview.md
52-
Conformance: concepts/conformance.md
53-
Roles and Personas: concepts/roles-and-personas.md
79+
- API Overview: concepts/api-overview.md
80+
- Conformance: concepts/conformance.md
81+
- Roles and Personas: concepts/roles-and-personas.md
5482
- Implementations: implementations.md
5583
- FAQ: faq.md
5684
- Guides:
@@ -68,3 +96,4 @@ nav:
6896
- Contributing:
6997
- How to Get Involved: contributing/index.md
7098
- Developer Guide: contributing/devguide.md
99+
- Docs Guide: contributing/docs.md

site-src/.mkdocs-exclude

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
search/search_index.json
55
sitemap.xml.gz
66
sitemap.xml
7+
known_words.txt

site-src/contributing/docs.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing to the docs
2+
3+
## mkdocs
4+
5+
This doc site is built using MkDocs.
6+
7+
Before you begin, make sure that you have a recent version of `python` and `pip`. You also might want to set up a Python virtual environment for the `gateway-api-inference-extension` project.
8+
9+
To install and use `mkdocs`, refer to the [MkDocs User Guide](https://www.mkdocs.org/user-guide/).
10+
11+
### Set up mkdocs
12+
13+
```sh
14+
# Install mkdocs
15+
pip install mkdocs
16+
17+
# Install the Material theme that this project uses
18+
pip install mkdocs-material
19+
20+
# Install the plugins that this project uses
21+
pip install mkdocs-awesome-pages-plugin
22+
pip install mkdocs-macros-plugin
23+
pip install mkdocs-mermaid2-plugin
24+
pip install mkdocs-spellcheck
25+
26+
```
27+
28+
### Preview local changes
29+
30+
1. Make your changes to the docs. If you add a new page, make sure to update the `nav` section in the `mkdocs.yml` file.
31+
32+
2. Serve the docs locally.
33+
34+
`mkdocs serve`
35+
36+
3. Open the local address that the docs are served from in your browser: [http://127.0.0.1:8000/](http://127.0.0.1:8000/)
37+
38+
## Spellcheck
39+
40+
The project uses [MkDocs SpellCheck](https://pawamoy.github.io/mkdocs-spellcheck/).
41+
42+
1. Install the spellcheck with the backends. The ticks are added for shells that otherwise interpret the `[]` as a command.
43+
44+
`pip install 'mkdocs-spellcheck[codespell]' && pip install 'mkdocs-spellcheck[symspellpy]'`
45+
46+
2. Build the docs to trigger the spellcheck.
47+
48+
`mkdocs build`
49+
50+
3. Review the output for `mkdocs_spellcheck` warnings, such as the following example. Notice that the output includes the file name, mispelled word, and suggestions.
51+
52+
`WARNING - mkdocs_spellcheck: (symspellpy) index.md: Misspelled 'dont', did you mean 'done'...?`
53+
54+
4. If the word is correct, you can update the [`site-src/known_words.txt` file](../known_words.txt).
55+
56+
## Publish the docs
57+
58+
The project uses Netlify to host the docs.
59+
60+
You can locally build the files that become the doc site. For example, you might want to check the HTML output of changes that you make to the site.
61+
62+
```sh
63+
make build-docs-netlify
64+
```
65+
66+
The Gateway API Inference Extension team will publish the docs based on the latest changes in the `main` branch.

site-src/known_words.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
AI
2+
alphanumerics
3+
API
4+
APIs
5+
backend
6+
backends
7+
backreference
8+
composable
9+
config
10+
configs
11+
customizable
12+
dev
13+
enum
14+
enums
15+
fixups
16+
fixup
17+
frontend
18+
GitHub
19+
github
20+
golang
21+
html
22+
http
23+
https
24+
HTTPRoute
25+
InferencePool
26+
InferencePools
27+
InferenceModel
28+
InferenceModels
29+
kgateway
30+
kubebuilder
31+
Kubernetes
32+
kubernetes
33+
lifecycle
34+
LLM
35+
LLMs
36+
LoRA
37+
mkdocs
38+
namespace
39+
Netlify
40+
ok
41+
OpenAI
42+
passcode
43+
tradeoff
44+
tradeoffs
45+
Triton
46+
quickstart
47+
repo
48+
rollout
49+
rollouts
50+
sheddable
51+
SIG
52+
SIGs
53+
sigs
54+
subproject
55+
syncer
56+
uncomment
57+
vLLM
58+
WG
59+
www

0 commit comments

Comments
 (0)