Skip to content

Commit c333d61

Browse files
authored
Update code-description.md
1 parent f93f8ce commit c333d61

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

code-description.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ The purpose of this extension is to identify the versioning that applies at the
55

66
The code is written in TypeScript. This file describes how the code works.
77

8+
## Contents
9+
10+
- [Terminology](#terminology)
11+
- []()
12+
- []()
13+
- []()
14+
- []()
15+
- []()
16+
- []()
17+
- []()
18+
819
## Terminology
920

1021
The following key terms are used to explain how the extension was coded.
@@ -24,7 +35,9 @@ A tag set:
2435
A tag span is the text to which a tag applies. In an un-nested tag set, a tag span begins after the `}` of a version tag and ends with the `}` of the next tag. The `endif` tag has no tag span. For example:
2536

2637
```
27-
This text does not belong to a tag span, {% ifversion some-version-name %}this is the ifversion tag span, {% elsif alternative-version %}this is the tag span for an elsif clause, {% else %}this is the tag span for an else clause, {% endif %}and this does not belong to a tag span.
38+
This text does not belong to a tag span, {% ifversion some-version-name %}this is the ifversion tag span,
39+
{% elsif alternative-version %}this is the tag span for an elsif clause, {% else %}this is the tag span for
40+
an else clause, {% endif %}and this does not belong to a tag span.
2841
```
2942

3043
If a tag span contains within it a nested tag set, then the tag span will be interrupted by the nested tag set and will continue after the end of the nested tag set.
@@ -100,7 +113,9 @@ When we finish parsing the file, we can work backwards through the `currentTagSp
100113
For example, let's say we have the following at the beginning of a Markdown file:
101114

102115
```
103-
This text is unversioned, {% ifversion ghes %}this is versioned for ghes{% endif %} and this is unversioned. My favorite version is {% ifversion ghec %}GHEC{% elsif fpt %}Free/Pro/Team{% else %}NOT GHES and NOT Free/Pro/Team{% endif %}.
116+
This text is unversioned, {% ifversion ghes %}this is versioned for ghes{% endif %} and this is unversioned.
117+
My favorite version is {% ifversion ghec %}GHEC{% elsif fpt %}Free/Pro/Team{% else %}NOT GHES and NOT
118+
Free/Pro/Team{% endif %}.
104119
```
105120

106121
At the beginning of this text, at the start of the file, the `tagSetID`, `versionDescription` and `currentTagSpan` arrays are all empty: we haven't found any versioning yet. We then process the first tag: `ifversion`. We:
@@ -261,7 +276,8 @@ In the following Markdown, let's say the cursor is within the text "GitHub Code
261276
```
262277
{% ifversion ghec or ghes > 3.8 %}
263278
264-
... within the product called {%ifversion ghes = 3.9 %}CodingStars{% elsif ghes = 3.10 %}LGTM{% else %}GitHub Code Scanning{% endif %} there is ...
279+
... within the product called {%ifversion ghes = 3.9 %}CodingStars{% elsif ghes = 3.10 %}LGTM{% else %}GitHub Code
280+
Scanning{% endif %} there is ...
265281
266282
{% endif %}
267283
```

0 commit comments

Comments
 (0)