Skip to content

Commit 70a6692

Browse files
committed
README: add info about styling preferences
* Use the .editorconf file * How to install VS Code EditorConfig extension * Pre-install extensions in GitPod * Flesh out how to use GitPod section Signed-off-by: Mike Szczys <[email protected]>
1 parent d48d032 commit 70a6692

File tree

2 files changed

+59
-8
lines changed

2 files changed

+59
-8
lines changed

.gitpod.yml

+5
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ github:
2020
addComment: true
2121
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
2222
addBadge: false
23+
24+
vscode:
25+
extensions:
26+
- EditorConfig.EditorConfig
27+
- stkb.rewrap

README.md

+54-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,46 @@
22

33
The Golioth documentation website is built using [Docusaurus 2](https://v2.docusaurus.io/).
44

5+
## Contributor Information
56

6-
Click the Gitpod badge to open a contributor workspace instance
7+
Please use the `.editorconfig` file when editing/adding documentation. This will
8+
instruct your code editor to follow some simple formatting guidelines such as:
9+
10+
* Max column width of 80 characters (where possible)
11+
* UTF-8 character set
12+
* Use linefeed as the end-of-line treatment
13+
14+
### VS Code
15+
16+
Formatting can be enabled automatically in VS Code by enabling the following
17+
Plugins:
18+
19+
* [EditorConfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig)
20+
for VS Code: Automatically uses the `.editorconfig` file
21+
* [Rewrap](https://marketplace.visualstudio.com/items?itemName=stkb.rewrap):
22+
Enable the `Rewrap>Auto Wrap` setting to hard wrap at the 80 character max
23+
line width.
24+
25+
### Gitpod
26+
27+
A pre-configured VS Code instance is available by clicking the Gitpod badge to
28+
open a contributor workspace instance:
729

830
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
931

32+
Automatic hard wrapping in this Gitpod instance can be turned on by pressing
33+
`CTRL comma` to open settings, then search for `rewrap auto wrap`.
34+
35+
### Neovim (Vim)
36+
37+
EditorConfig is [supported natively in
38+
Neovim](http://neovim.io/doc/user/editorconfig.html). Support can be added to
39+
Vim using the [editorconfig-vim
40+
plugin](https://github.com/editorconfig/editorconfig-vim).
41+
42+
Hard breaks will be added to lines automatically and you can manually reflow
43+
paragraphs using `qgap` and sentences using `gqas`.
44+
1045
## Installation
1146

1247
```console
@@ -19,27 +54,34 @@ npm install
1954
npm start
2055
```
2156

22-
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
57+
This command starts a local development server and open up a browser window.
58+
Most changes are reflected live without having to restart the server.
2359

2460
## Build
2561

2662
```console
2763
npm run build:dev (or :prod)
2864
```
2965

30-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
66+
This command generates static content into the `build` directory and can be
67+
served using any static contents hosting service.
3168

3269
## Device Catalog
3370

34-
The device catalog is automatically generated. To update it, run this command from the project root directory:
71+
The device catalog is automatically generated. To update it, run this command
72+
from the project root directory:
3573

3674
```console
3775
npm run build-device-catalog
3876
```
3977

40-
Quickstart guides can be added in the `docs/hardware/6-catalog/quickstart` directory and enabled by adding a node in the `scripts/device-catalog/support.json` file.
78+
Quickstart guides can be added in the `docs/hardware/6-catalog/quickstart`
79+
directory and enabled by adding a node in the
80+
`scripts/device-catalog/support.json` file.
4181

42-
Documentation on automatic generation and adding customized pages for supported boards can be found in [the device catalog README](scripts/device-catalog/README.md).
82+
Documentation on automatic generation and adding customized pages for supported
83+
boards can be found in [the device catalog
84+
README](scripts/device-catalog/README.md).
4385

4486
## Deployment to Firebase Hosting
4587

@@ -55,9 +97,13 @@ Deploy to [Golioth Docs Prod Site](https://docs.golioth.io)
5597
npm run fb-deploy-prod
5698
```
5799

58-
Maintainers of the Golioth docs merging into the `main` branch will also automatically deploy to production (based on the CI system setup)
100+
Maintainers of the Golioth docs merging into the `main` branch will also
101+
automatically deploy to production (based on the CI system setup)
102+
59103
## Versioning
60104

61-
In Ubuntu, the default npm install will not be up to date with the required npm packages. Consider using nvm to choose an LTS solution that will work better with Docusaurus V2.
105+
In Ubuntu, the default npm install will not be up to date with the required npm
106+
packages. Consider using nvm to choose an LTS solution that will work better
107+
with Docusaurus V2.
62108

63109
* [nvm install for Ubuntu 20.04 (option 3)](https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-20-04)

0 commit comments

Comments
 (0)