Skip to content

Commit f6c60b5

Browse files
committed
Clean up the markdown in considerations
Fix spelling, markdown spacing, consistent bullets, code block language hints, and move links to the end. Signed-off-by: Brandon Mitchell <[email protected]>
1 parent b5ec432 commit f6c60b5

File tree

1 file changed

+34
-31
lines changed

1 file changed

+34
-31
lines changed

considerations.md

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
11
# Extensibility
22

33
Implementations storing or copying content MUST NOT modify or alter the content in a way that would change the digest of the content. Examples of these implementations include:
4-
* A [registry implementing the distribution specification](https://github.com/opencontainers/distribution-spec/blob/main/spec.md#definitions), including local registries, caching proxies
5-
* An application which copies content to disk or between registries
4+
5+
- A [registry implementing the distribution specification][distribution-spec], including local registries, caching proxies
6+
- An application which copies content to disk or between registries
67

78
Implementations processing content SHOULD NOT generate an error if they encounter an unknown property in a known media type. Examples of these implementations include:
8-
* A [runtime implementing the runtime specification](https://github.com/opencontainers/runtime-spec/blob/main/spec.md)
9-
* An implementation using OCI to retrieve and utilize artifacts, e.g.: a WASM runtime
9+
10+
- A [runtime implementing the runtime specification][runtime-spec]
11+
- An implementation using OCI to retrieve and utilize artifacts, e.g.: a WASM runtime
1012

1113
# Canonicalization
1214

13-
* OCI Images are [content-addressable](https://en.wikipedia.org/wiki/Content-addressable_storage). See [descriptors](descriptor.md) for more.
14-
* One benefit of content-addressable storage is easy deduplication.
15-
* Many images might depend on a particular [layer](layer.md), but there will only be one blob in the [store](image-layout.md).
16-
* With a different serialization, that same semantic layer would have a different hash, and if both versions of the layer are referenced there will be two blobs with the same semantic content.
17-
* To allow efficient storage, implementations serializing content for blobs SHOULD use a canonical serialization.
18-
* This increases the chance that different implementations can push the same semantic content to the store without creating redundant blobs.
15+
- OCI Images are [content-addressable](https://en.wikipedia.org/wiki/Content-addressable_storage). See [descriptors](descriptor.md) for more.
16+
- One benefit of content-addressable storage is easy deduplication.
17+
- Many images might depend on a particular [layer](layer.md), but there will only be one blob in the [store](image-layout.md).
18+
- With a different serialization, that same semantic layer would have a different hash, and if both versions of the layer are referenced there will be two blobs with the same semantic content.
19+
- To allow efficient storage, implementations serializing content for blobs SHOULD use a canonical serialization.
20+
- This increases the chance that different implementations can push the same semantic content to the store without creating redundant blobs.
1921

2022
## JSON
2123

22-
[JSON][] content SHOULD be serialized as [canonical JSON][canonical-json].
24+
[JSON][JSON] content SHOULD be serialized as [canonical JSON][canonical-json].
2325
Of the [OCI Image Format Specification media types](media-types.md), all the types ending in `+json` contain JSON content.
2426
Implementations:
2527

26-
* [Go][]: [github.com/docker/go][], which claims to implement [canonical JSON][canonical-json] except for Unicode normalization.
27-
28-
[canonical-json]: https://wiki.laptop.org/go/Canonical_JSON
29-
[github.com/docker/go]: https://github.com/docker/go/
30-
[Go]: https://golang.org/
31-
[JSON]: https://json.org/
28+
- [Go][Go]: [github.com/docker/go][docker-go], which claims to implement [canonical JSON][canonical-json] except for Unicode normalization.
3229

3330
# EBNF
3431

3532
For field formats described in this specification, we use a limited subset of [Extended Backus-Naur Form][ebnf], similar to that used by the [XML specification][xmlebnf].
3633
Grammars present in the OCI specification are regular and can be converted to a single regular expressions.
37-
However, regular expressions are avoided to limit abiguity between regular expression syntax.
34+
However, regular expressions are avoided to limit ambiguity between regular expression syntax.
3835
By defining a subset of EBNF used here, the possibility of variation, misunderstanding or ambiguities from linking to a larger specification can be avoided.
3936

4037
Grammars are made up of rules in the following form:
4138

42-
```
39+
```ebnf
4340
symbol ::= expression
4441
```
4542

@@ -50,14 +47,14 @@ Whitespace is completely ignored in rule definitions.
5047

5148
The simplest expression is the literal, surrounded by quotes:
5249

53-
```
50+
```ebnf
5451
literal ::= "matchthis"
5552
```
5653

5754
The above expression defines a symbol, "literal", that matches the exact input of "matchthis".
5855
Character classes are delineated by brackets (`[]`), describing either a set, range or multiple range of characters:
5956

60-
```
57+
```ebnf
6158
set := [abc]
6259
range := [A-Z]
6360
```
@@ -67,7 +64,7 @@ The symbol "range" would match any character, "A" to "Z", inclusive.
6764
Currently, only matching for 7-bit ascii literals and character classes is defined, as that is all that is required by this specification.
6865
Multiple character ranges and explicit characters can be specified in a single character classes, as follows:
6966

70-
```
67+
```ebnf
7168
multipleranges := [a-zA-Z=-]
7269
```
7370

@@ -77,31 +74,31 @@ Expressions can be made up of one or more expressions, such that one must be fol
7774
This is known as an implicit concatenation operator.
7875
For example, to satisfy the following rule, both `A` and `B` must be matched to satisfy the rule:
7976

80-
```
77+
```ebnf
8178
symbol ::= A B
8279
```
8380

8481
Each expression must be matched once and only once, `A` followed by `B`.
8582
To support the description of repetition and optional match criteria, the postfix operators `*` and `+` are defined.
86-
`*` indicates that the preceeding expression can be matched zero or more times.
87-
`+` indicates that the preceeding expression must be matched one or more times.
83+
`*` indicates that the preceding expression can be matched zero or more times.
84+
`+` indicates that the preceding expression must be matched one or more times.
8885
These appear in the following form:
8986

90-
```
87+
```ebnf
9188
zeroormore ::= expression*
9289
oneormore ::= expression+
9390
```
9491

9592
Parentheses are used to group expressions into a larger expression:
9693

97-
```
94+
```ebnf
9895
group ::= (A B)
9996
```
10097

10198
Like simpler expressions above, operators can be applied to groups, as well.
10299
To allow for alternates, we also define the infix operator `|`.
103100

104-
```
101+
```ebnf
105102
oneof ::= A | B
106103
```
107104

@@ -118,14 +115,14 @@ The operator precedence is in the following order:
118115
- Alternates `|`
119116

120117
The precedence can be better described using grouping to show equivalents.
121-
Concatenation has higher precedence than alernates, such `A B | C D` is equivalent to `(A B) | (C D)`.
118+
Concatenation has higher precedence than alternates, such `A B | C D` is equivalent to `(A B) | (C D)`.
122119
Unary operators have higher precedence than alternates and concatenation, such that `A+ | B+` is equivalent to `(A+) | (B+)`.
123120

124121
## Examples
125122

126123
The following combines the previous definitions to match a simple, relative path name, describing the individual components:
127124

128-
```
125+
```ebnf
129126
path ::= component ("/" component)*
130127
component ::= [a-z]+
131128
```
@@ -134,9 +131,15 @@ The production "component" is one or more lowercase letters.
134131
A "path" is then at least one component, possibly followed by zero or more slash-component pairs.
135132
The above can be converted into the following regular expression:
136133

137-
```
134+
```regex
138135
[a-z]+(?:/[a-z]+)*
139136
```
140137

138+
[canonical-json]: https://wiki.laptop.org/go/Canonical_JSON
139+
[distribution-spec]: https://github.com/opencontainers/distribution-spec/blob/main/spec.md
140+
[docker-go]: https://github.com/docker/go/
141141
[ebnf]: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
142+
[Go]: https://golang.org/
143+
[JSON]: https://json.org/
144+
[runtime-spec]: https://github.com/opencontainers/runtime-spec/blob/main/spec.md
142145
[xmlebnf]: https://www.w3.org/TR/REC-xml/#sec-notation

0 commit comments

Comments
 (0)