Skip to content

Commit dcc031d

Browse files
authored
Merge pull request #4045 from marlapativ/crd_marker_docs_fix
📖 Fix generation of markers based on controller-tools
2 parents f97e873 + ae1bef6 commit dcc031d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

docs/book/utils/markerdocs/html.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ func (t Tag) WriteHTML(w io.Writer) error {
7777
if t.Attrs != nil {
7878
attrsOut = t.Attrs.ToAttrs()
7979
}
80-
if _, err := fmt.Fprintf((w, "<%s %s>", t.Name, attrsOut)
81-
err != nil{
80+
if _, err := fmt.Fprintf(w, "<%s %s>", t.Name, attrsOut); err != nil {
8281
return err
8382
}
8483

@@ -88,8 +87,7 @@ func (t Tag) WriteHTML(w io.Writer) error {
8887
}
8988
}
9089

91-
if _, err := fmt.Fprintf((w, "</%s>", t.Name)
92-
err != nil{
90+
if _, err := fmt.Fprintf(w, "</%s>", t.Name); err != nil {
9391
return err
9492
}
9593

docs/book/utils/markerdocs/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (p MarkerDocs) Process(input *plugin.Input) error {
164164
content := new(strings.Builder)
165165

166166
// NB(directxman12): wrap this in a div to prevent the markdown processor from inserting extra paragraphs
167-
_, err := fmt.Fprintf((content, "<div><input checked type=\"checkbox\" class=\"markers-summarize\" id=\"markers-summarize-%[1]s\"></input><label class=\"markers-summarize\" for=\"markers-summarize-%[1]s\">Show Detailed Argument Help</label><dl class=\"markers\">", categoryAlias)
167+
_, err := fmt.Fprintf(content, "<div><input checked type=\"checkbox\" class=\"markers-summarize\" id=\"markers-summarize-%[1]s\"></input><label class=\"markers-summarize\" for=\"markers-summarize-%[1]s\">Show Detailed Argument Help</label><dl class=\"markers\">", categoryAlias)
168168
if err != nil {
169169
return "", fmt.Errorf("unable to render marker documentation summary: %v", err)
170170
}
@@ -176,8 +176,7 @@ func (p MarkerDocs) Process(input *plugin.Input) error {
176176
}
177177
}
178178

179-
if _, err = _, _ = fmt.Fprintf(content, "</dl></div>")
180-
err != nil{
179+
if _, err = fmt.Fprintf(content, "</dl></div>"); err != nil {
181180
return "", fmt.Errorf("unable to render marker documentation: %v", err)
182181
}
183182

0 commit comments

Comments
 (0)