Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 1e48f1a

Browse files
authored
Merge pull request #345 from Vyrastas/master
Documentation Style Guide update and improved Copybara support
2 parents 91b4fe2 + a8128ec commit 1e48f1a

File tree

8 files changed

+214
-85
lines changed

8 files changed

+214
-85
lines changed

doc/STYLE_GUIDE.md

Lines changed: 83 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,29 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md) for general information on contributin
1111

1212
## Location
1313

14-
Place all documentation contributions in the appropriate location in the [`/doc`](./) directory. If you are unsure of the best location for your contribution, let us know in your pull request.
14+
Place all documentation contributions in the appropriate location in the [`/doc`](./) directory. Most contributions should go into the `/doc/guides` subdirectory, which covers conceptual and usage content, to align it with the structure of the openweave.io documentation site.
15+
16+
Current documentation structure:
17+
18+
Directory | Description
19+
----|----
20+
`/doc/guides` | Conceptual or usage content that doesn't fit within a subdirectory, and high-level tutorials
21+
`/doc/guides/images` | All images included in guide content
22+
`/doc/guides/profiles` | Content describing or illustrating use of OpenWeave profiles
23+
`/doc/guides/test` | Content related to testing Weave with Happy
24+
`/doc/guides/tools` | Content describing or illustrating use of OpenWeave tools
25+
`/doc/guides/weave-primer` | Weave Primer content
26+
`/doc/images` | Top-level OpenWeave images, such as logos
27+
`/doc/presentations` | PDF presentations on Weave features
28+
`/doc/specs` | PDFs of Weave specifications
29+
30+
If you are unsure of the best location for your contribution, create an Issue and ask, or let us know in your Pull Request.
31+
32+
### Updating the site menus
33+
34+
When adding a new document, or moving one, also update the `_toc.yaml` file(s) in the related folders. For example, the `/doc/guides/tools/_toc.yaml` file is the menu for the [Tools section on openweave.io](https://openweave.io/guides/tools).
35+
36+
New documents should be added to the site menu TOCs where appropriate. If you are unsure of where to place a document within the menu, let us know in your Pull Request.
1537

1638
## Style
1739

@@ -31,6 +53,12 @@ Use standard Markdown when authoring OpenWeave documentation. While HTML may be
3153

3254
> Note: Edit this file to see the Markdown behind the examples.
3355
56+
### Headers
57+
58+
The document title should be an h1 header (#) and in title case (all words are capitalized). All section headers should be h2 (##) or lower and in sentence case (only the first word and proper nouns are capitalized).
59+
60+
The best practice for document clarity is to not go lower than h3, but h4 is fine on occasion. Try to avoid using h4 often, or going lower than h4. If this happens, the document should be reorganized or broken up to ensure it stays at h3 with the occasional h4.
61+
3462
### Command line examples
3563

3664
Feel free to use either `$` or `%` to preface command line examples, but be consistent within the same doc or set of docs:
@@ -68,29 +96,46 @@ weave-device-mgr (18B4300000000004 @ fd00:0:fab1:6:1ab4:3000:0:4) > ping
6896

6997
### Commands and output
7098

71-
All example commands and output should be in code blocks with backticks or indented:
99+
All example commands and output should be in code blocks with backticks:
72100

73101
```
74102
code in backticks
75103
```
76104

105+
...unless the code is within a step list. In a step list, indent the code blocks:
106+
77107
code indented
78108

79109
### Code blocks in step lists
80110

81111
When writing procedures that feature code blocks, indent the content for the code blocks:
82112

83-
1. Step one.
113+
1. Step one:
84114

85115
$ git clone https://github.com/openweave/openweave-core.git
86116
$ cd openweave-core
87117

88-
More about step one.
118+
1. Step two, do something else:
119+
120+
$ ./configure
121+
122+
For clarity in instructions, avoid putting additional step commands after a code sample
123+
within a step item. Instead rewrite the instruction so this is not necessary.
124+
125+
For example, avoid this:
89126

90-
1. Step two, do something else.
127+
1. Step three, do this now:
91128

92129
$ ./configure
93130

131+
And then you will see that thing.
132+
133+
Instead, do this:
134+
135+
1. Step three, do this now, and you will see that thing:
136+
137+
$ ./configure
138+
94139
### Inline code
95140

96141
Use backticks for `inline code`. This includes file paths and file or binary names.
@@ -131,3 +176,36 @@ For example:
131176
Or:
132177

133178
> Caution: The user should be careful running the next command.
179+
180+
### Material icons
181+
182+
The openweave.io documentation site uses various Material icons inline with the text or in
183+
diagrams to represent elements of the Weave system. These icons are used to aid in your
184+
understanding of Weave by highlighting common elements and are not official Weave-branded
185+
icons.
186+
187+
> You are not required to use these icons, but we may ask to insert them during the review
188+
process, in order to visually tie concepts together across the documentation site.
189+
190+
Example: https://openweave.io/guides/tools#weave-heartbeat
191+
192+
To use these icons in your content, so that they render on the openweave.io documentation site,
193+
surround one of the supported keywords with an underscore+asterisk combo.
194+
195+
For example:
196+
197+
<div>_*Echo*_</div>
198+
<div>_*heartbeat*_</div>
199+
200+
The keyword can be upper or lowercase. Use of this format with unsupported keywords merely
201+
renders the text in italics.
202+
203+
See the **OpenWeave Tools** page for an example of this:
204+
205+
* [GitHub version](./guides/tools/index.md)
206+
* [openweave.io version](https://openweave.io/guides/tools)
207+
208+
Supported keywords:
209+
210+
* Echo
211+
* Heartbeat

doc/guides/_toc.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
toc:
2+
- title: Get Started
3+
path: /guides/
4+
- heading: Weave Primer
5+
- title: What is Weave?
6+
path: /guides/weave-primer/
7+
step_group: weave_primer
8+
- title: Overview
9+
path: /guides/weave-primer/overview
10+
step_group: weave_primer
11+
- title: Fabric
12+
path: /guides/weave-primer/fabric
13+
step_group: weave_primer
14+
- title: Messaging
15+
path: /guides/weave-primer/messaging
16+
step_group: weave_primer
17+
- title: Profiles
18+
path: /guides/weave-primer/profiles
19+
step_group: weave_primer
20+
- title: Schema
21+
path: /guides/weave-primer/schema
22+
step_group: weave_primer
23+
- title: Data Management
24+
path: /guides/weave-primer/data-management
25+
step_group: weave_primer
26+
- heading: Reference
27+
- title: Glossary
28+
path: /guides/glossary
29+
- heading: Codelabs and Tutorials
30+
- title: Getting Started with Happy
31+
status: external
32+
path: https://codelabs.developers.google.com/codelabs/happy-weave-getting-started/#0
33+
- title: Cross Network Multicast Inet Layer HOWTO
34+
path: /guides/cross-network-inet-multicast-howto

doc/guides/test/_toc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
toc:
2+
- title: Test Cases
3+
path: /guides/test/

doc/guides/test/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ OpenWeave test cases run against the sample Happy topologies found in
3131
[`/src/test-apps/happy/topologies/standalone`](https://github.com/openweave/openweave-core/tree/master/src/test-apps/happy/topologies/standalone).
3232
To use your own custom Happy topology in a test case:
3333

34-
1. After constructing your custom topology, save it in JSON format:
34+
1. After constructing your custom topology, save it in JSON format. This saves
35+
the topology state file in the `$HOME` directory:
3536

3637
$ happy-state -s my_topology.json
3738

38-
This saves the topology state file in the `$HOME` directory.
3939
1. In the test case script, locate the topology file being used. Topologies in
4040
test cases are typically assigned to the `self.topology_file` variable. For
4141
example,

doc/guides/tools/_toc.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
toc:
2+
- title: Overview
3+
path: /guides/tools/
4+
- title: Device Manager
5+
path: /guides/tools/device-manager
6+
- title: Factory Provisioning Tool
7+
path: /guides/tools/factory-provisioning-tool

doc/guides/tools/device-manager.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $ happy-shell node01
8383

8484
In `node01`, bring up a mock device using that node's Weave IPv6 address and a
8585
valid Weave pairing code. A pairing code is required to establish a secure
86-
[PASE](../glossary.md#pase) session between the mock device and Device
86+
[PASE](/guides/glossary.md#pase) session between the mock device and Device
8787
Manager:
8888

8989
```
@@ -187,8 +187,6 @@ weave-device-mgr (18B4300000000004 @ fd00:0:fab1:6:1ab4:3000:0:4) >
187187
The output on the mock device (`node01`), confirms a successful connection:
188188

189189
```
190-
### node01 - mock device
191-
192190
WEAVE:EM: Msg rcvd 0000000E:1 16 0000000000000001 0000 986B 0 MsgId:23C64568
193191
WEAVE:EM: ec id: 1, AppState: 0x3aadf480
194192
IdentifyRequest received from node 1 (fd00:0:fab1:6:1ab4:3000:0:5)
@@ -230,8 +228,6 @@ Ping complete
230228
Output on the mock device (`node01`) confirms the successful Echo:
231229

232230
```
233-
### node01 - mock device
234-
235231
WEAVE:EM: Msg rcvd 00000001:1 0 0000000000000001 3960 986F 0 MsgId:00000000
236232
WEAVE:EM: ec id: 1, AppState: 0x3aadfbb0
237233
WEAVE:SM: Reserve session key: Id=2CFF Peer=0000000000000001 Reserve=1

0 commit comments

Comments
 (0)