Skip to content

Commit e911c77

Browse files
committed
Rename @section to @raw
1 parent ef73e2e commit e911c77

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

example-charts/custom-value-notation-type/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ file, you can see that we modified the column `Key` to also be hyperlinked with
103103
If you view this README.md files in GitHub and click the value's key, you will be directed to the
104104
key location in the `values.yaml` file.
105105

106-
You can also render a raw string into the comments using `@section` annotations.
106+
You can also render a raw string into the comments using `@raw` annotations.
107107
You can jump to [sampleYaml](#sampleYaml) key and check it's description where it
108108
uses HTML `<summary>` tag to collapse some part of the comments.
109109

@@ -996,7 +996,7 @@ dict
996996
Sometimes you need a very long description
997997
for your values.
998998

999-
Any comment section for a given key with **@section** attribute
999+
Any comment section for a given key with **@raw** attribute
10001000
will be treated as raw string and stored as is.
10011001
Since it generates in Markdown format, you can do something like this:
10021002

example-charts/custom-value-notation-type/README.md.gotmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ file, you can see that we modified the column `Key` to also be hyperlinked with
9797
If you view this README.md files in GitHub and click the value's key, you will be directed to the
9898
key location in the `values.yaml` file.
9999

100-
You can also render a raw string into the comments using `@section` annotations.
100+
You can also render a raw string into the comments using `@raw` annotations.
101101
You can jump to [sampleYaml](#sampleYaml) key and check it's description where it
102102
uses HTML `<summary>` tag to collapse some part of the comments.
103103

example-charts/custom-value-notation-type/values.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ persistence:
201201

202202

203203
# -- (dict) Values with long description
204-
# @section
204+
# @raw
205205
# Sometimes you need a very long description
206206
# for your values.
207207
#
208-
# Any comment section for a given key with **@section** attribute
208+
# Any comment section for a given key with **@raw** attribute
209209
# will be treated as raw string and stored as is.
210210
# Since it generates in Markdown format, you can do something like this:
211211
#

pkg/document/values_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1440,11 +1440,11 @@ foo:
14401440
assert.Equal(t, "Bar!", valuesRows[0].AutoDescription)
14411441
}
14421442

1443-
func TestMultilineDescriptionSection(t *testing.T) {
1443+
func TestMultilineRawDescription(t *testing.T) {
14441444
helmValues := parseYamlValues(`
14451445
animals:
14461446
# -- (list) I mean, dogs are quite nice too...
1447-
# @section
1447+
# @raw
14481448
#
14491449
# List of default dogs:
14501450
# - Umbra

pkg/helm/chart_info.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
var valuesDescriptionRegex = regexp.MustCompile("^\\s*#\\s*(.*)\\s+--\\s*(.*)$")
19-
var sectionDescriptionRegex = regexp.MustCompile("^\\s*#\\s+@section")
19+
var rawDescriptionRegex = regexp.MustCompile("^\\s*#\\s+@raw")
2020
var commentContinuationRegex = regexp.MustCompile("^\\s*#(\\s?)(.*)$")
2121
var defaultValueRegex = regexp.MustCompile("^\\s*# @default -- (.*)$")
2222
var valueTypeRegex = regexp.MustCompile("^\\((.*?)\\)\\s*(.*)$")

pkg/helm/comment.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ func ParseComment(commentLines []string) (string, ChartValueDescription) {
4040
c.Description = valueTypeMatch[2]
4141
}
4242

43-
var isSection = false
43+
var isRaw = false
4444

4545
for _, line := range commentLines[docStartIdx+1:] {
46-
sectionFlagMatch := sectionDescriptionRegex.FindStringSubmatch(line)
46+
rawFlagMatch := rawDescriptionRegex.FindStringSubmatch(line)
4747
defaultCommentMatch := defaultValueRegex.FindStringSubmatch(line)
4848
notationTypeCommentMatch := valueNotationTypeRegex.FindStringSubmatch(line)
4949

50-
if !isSection && len(sectionFlagMatch) == 1 {
51-
isSection = true
50+
if !isRaw && len(rawFlagMatch) == 1 {
51+
isRaw = true
5252
continue
5353
}
5454

@@ -64,7 +64,7 @@ func ParseComment(commentLines []string) (string, ChartValueDescription) {
6464

6565
commentContinuationMatch := commentContinuationRegex.FindStringSubmatch(line)
6666

67-
if isSection {
67+
if isRaw {
6868

6969
if len(commentContinuationMatch) > 1 {
7070
c.Description += "\n" + commentContinuationMatch[2]

0 commit comments

Comments
 (0)