Skip to content

Commit

Permalink
Merge pull request #34 from TheThingsIndustries/util/line-breaks
Browse files Browse the repository at this point in the history
util: Add line break style guidelines
  • Loading branch information
benolayinka committed Oct 14, 2020
2 parents bae9509 + 04cd74b commit 68a06ec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -96,6 +96,10 @@ Please respect the following guidelines for content in our documentation site. A
- `bash` for CLI examples. Prefix commands with `$ `. Wrap strings with double quotes `""` (except when working with JSON, which already uses double quotes).
- Wrap large CLI output with `<details><summary>Show CLI output</summary> ... output here ... </details>`.
- `yaml` (not `yml`) for YAML. Wrap strings with single quotes `''` (because of frequent Go templates that use double quotes).
- In long command line examples or other code snippets, use the following guidelines:
- If a line is longer than 80 columns, try to find a "natural" break
- If a line is longer than 120 columns, insert a line break
- In very special cases, longer lines are tolerated

## Legal

Expand Down
23 changes: 23 additions & 0 deletions doc/content/example-template/_index.md
Expand Up @@ -128,6 +128,29 @@ services:
image: 'thethingsnetwork/lorawan-stack:<the tag>'
```

### Line Breaks

In long command line examples or other code snippets, use the following guidelines:

- If a line is longer than 80 columns, try to find a "natural" break
- If a line is longer than 120 columns, insert a line break
- In very special cases, longer lines are tolerated

For example:

```bash
$ curl --location --header 'Authorization: Bearer NNSXS.XXXXXXXXX' --header 'Accept: application/json' \
--header 'Content-Type: application/json' --request POST 'https://thethings.example.com/api/v3/events' \
--data-raw '{
"identifiers":[{
"device_ids":{
"device_id":"dev1",
"application_ids":{"application_id":"app1"}
}
}]
}'
```

### Referencing Files

It is also possible to host source code (or any text file) and display it using shortcodes. For example:
Expand Down

0 comments on commit 68a06ec

Please sign in to comment.