-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
CLIENT-SPECIFICATION: fix typo, add a way to escape the placeholder syntax #10730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
aa10306
1c031e0
24ac759
6db1d0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -116,7 +116,12 @@ The structure inside these translation folders is identical to that of the main | |||||||||||||
|
||||||||||||||
## Page structure | ||||||||||||||
|
||||||||||||||
Although this specification is about the interface that clients must provide, it is also worth noting that pages are written in standard [CommonMark](https://commonmark.org/), which the exception of the non-standard `{{` and `}}` syntax, which surrounds values in an example that users may edit. Clients MUST NOT break if the page format is changed within the _CommonMark_ specification. | ||||||||||||||
Although this specification is about the interface that clients must provide, it is also worth noting that pages are written in standard [CommonMark](https://commonmark.org/), with the exception of the non-standard `{{` and `}}` placeholder syntax, which surrounds values in an example that users may edit. Clients MAY highlight the placeholders and MUST remove the surrounding curly braces. Clients MUST display the `{{` and `}}` if escaped using `\` (i.e. `\{\{` and `\}\}`). Clients MUST NOT break if the page format is changed within the _CommonMark_ specification. | ||||||||||||||
|
||||||||||||||
### Examples | ||||||||||||||
|
||||||||||||||
- `ping {{example.com}}` MUST be rendered as "ping example.com" | ||||||||||||||
- `docker inspect --format '\{\{range.NetworkSettings.Networks\}\}\{\{.IPAddress\}\}\{\{end\}\}' {{container}}` MUST be rendered as "docker inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container" | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would personally lighten the syntax to only one backslash: This is maybe easier to parse than what I had proposed, but still not too heavy for reading source pages (even though this isn't done often). The drawback could if we needed to render something like But since I've seen only 3 occurrences of this problem, maybe this change is not needed. 🤷🏻 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I favor a backslash for each curly brace. I think it's much more intuitive to treat things per character, rather than by our special definition attributed to combinations of characters. In Markdown, This will be simpler than giving If a client finds For nested curly braces inside the placeholder syntax:
The main difference, here, is that having a single escape sequence affect multiple characters would require special handling from clients, while doing one escape sequence per character is already supported/expected by clients and CommonMark parsers. The benefits assume the client is using a CommonMark library to parse the page.
kbdharun marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
|
||||||||||||||
|
||||||||||||||
## Page resolution | ||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.