You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-17Lines changed: 38 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@
4
4
5
5
# Welcome to the Viam Documentation
6
6
7
-
> **Note**
7
+
> [!NOTE]
8
8
> Looking to contribute? Check out the [Contributor Guide](https://docs.viam.com/appendix/contributing/).
9
-
> For help knowing what and how to write, check out our templates: our [tutorial template](docs/tutorials/template/) and [component page template](docs/components/component/) are accessible on the site when building the docs in Draft mode, or accessible here on GitHub.
9
+
> For help knowing what and how to write, check out [tutorial template](docs/tutorials/template.md) and our [component pages](docs/operate/reference/components).
10
10
11
11
## Build the docs locally
12
12
@@ -19,37 +19,44 @@ To be able to build the docs locally, you need to install the following:
19
19
20
20
You can build the docs for local development using the following command:
21
21
22
-
```sh
23
-
make serve-dev-draft
22
+
```console
23
+
make serve-dev
24
24
```
25
25
26
-
If you would like to see the production view (without drafts and with minified CSS), run:
26
+
To see the production view (without drafts and with minified CSS), run:
27
27
28
-
```sh
28
+
```console
29
29
make serve-prod
30
30
```
31
31
32
-
You can also run `hugo serve` after installing Hugo to show the production view.
32
+
> [!TIP]
33
+
> You can also run `hugo serve` after installing Hugo to show the production view.
33
34
34
35
### Generate HTML docs
35
36
36
-
To generate the full HTML version of the docs run:
37
+
To generate the full HTML version of the docs, run:
37
38
38
-
```sh
39
+
```console
39
40
make build-prod
40
41
```
41
42
42
43
You can serve the resulting docs with:
43
44
44
-
```sh
45
+
```console
45
46
python3 -m http.server 9000 --directory public
46
47
```
47
48
48
49
## Test the docs locally
49
50
50
51
### Python snippets
51
52
52
-
To ensure all python snippets are properly formatted before creating a commit, install [flake8-markdown](https://github.com/johnfraney/flake8-markdown) and add the following lines to the `.git/hooks/pre-commit` file in your local repository:
53
+
To ensure all Python snippets are properly formatted before creating a commit, install [flake8-markdown](https://github.com/johnfraney/flake8-markdown):
54
+
55
+
```console
56
+
brew install flake8
57
+
```
58
+
59
+
Then, add the following lines to the `.git/hooks/pre-commit` file in your local repository:
53
60
54
61
```sh
55
62
if [ "git diff --diff-filter=d --name-only HEAD | grep '\.md$' | wc -l" ];
@@ -63,17 +70,31 @@ fi
63
70
```
64
71
65
72
If you don't already have a `.git/hooks/pre-commit` file in your `docs` git repo directory, you can copy the existing `pre-commit.sample` file in that directory as `pre-commit` to use the sample template, or create a new `pre-commit` file in that directory with the above content.
66
-
If you create a new file, you must also make it executable with: `chmod 755 /path/to/my/.git/hooks/pre-commit`.
73
+
If you create a new file, you must also make it executable with: `chmod +x /path/to/my/.git/hooks/pre-commit`.
67
74
68
-
To ensure your markdown is properly formatted, run `make markdowntest`.
75
+
### Check markdown formatting
76
+
77
+
To ensure your markdown is properly formatted, run:
78
+
79
+
```console
80
+
make markdowntest docs/**/*`
81
+
```
82
+
83
+
### Check for broken links
84
+
85
+
To check locally for broken links, install [`htmltest`](https://github.com/wjdp/htmltest):
86
+
87
+
```console
88
+
brew install htmltest
89
+
```
69
90
70
-
To check locally for broken links, install [`htmltest`](https://github.com/wjdp/htmltest) and run `make htmltest`.
91
+
Then, and run `make htmltest`.
71
92
72
93
### Lint JS and Markdown files with Prettier on save
73
94
74
95
1. Install the [Prettier VS Code Extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).
75
-
2. Run `npm install` in the docs folder where you have the docs checked out.
76
-
3. Inside VS code, open the _user_`settings.json` file by pressing `CMD+SHIFT+P` and typing 'settings', and add the following settings to the end of the file:
96
+
1. Run `npm install` in the docs folder where you have the docs checked out.
97
+
1. Inside VS code, open the _user_`settings.json` file: Press `CMD+SHIFT+P`, type 'settings', select **Open User Settings (JSON)**, and append the following settings to the end of the file:
77
98
78
99
```json
79
100
"[markdown]": {
@@ -90,4 +111,4 @@ To check locally for broken links, install [`htmltest`](https://github.com/wjdp/
90
111
91
112
## Publishing
92
113
93
-
The docs are automatically published when a PR merges.
114
+
A GitHub workflow automatically publishes the docs to [https://docs.viam.com/](https://docs.viam.com/)when new commits appear in the `main` branch.
0 commit comments