You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: code-description.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,17 @@ The purpose of this extension is to identify the versioning that applies at the
5
5
6
6
The code is written in TypeScript. This file describes how the code works.
7
7
8
+
## Contents
9
+
10
+
-[Terminology](#terminology)
11
+
-[]()
12
+
-[]()
13
+
-[]()
14
+
-[]()
15
+
-[]()
16
+
-[]()
17
+
-[]()
18
+
8
19
## Terminology
9
20
10
21
The following key terms are used to explain how the extension was coded.
@@ -24,7 +35,9 @@ A tag set:
24
35
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:
25
36
26
37
```
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.
28
41
```
29
42
30
43
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
100
113
For example, let's say we have the following at the beginning of a Markdown file:
101
114
102
115
```
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 %}.
104
119
```
105
120
106
121
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
261
276
```
262
277
{% ifversion ghec or ghes > 3.8 %}
263
278
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
0 commit comments