diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 20a6f653cd..f96f34ebf9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 `
Show CLI output ... output here ...
`. - `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 diff --git a/doc/content/example-template/_index.md b/doc/content/example-template/_index.md index 868d0d3a05..1bdda42557 100644 --- a/doc/content/example-template/_index.md +++ b/doc/content/example-template/_index.md @@ -128,6 +128,29 @@ services: image: 'thethingsnetwork/lorawan-stack:' ``` +### 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: