Skip to content

Commit

Permalink
Merge pull request #4045 from marlapativ/crd_marker_docs_fix
Browse files Browse the repository at this point in the history
📖  Fix generation of markers based on controller-tools
  • Loading branch information
k8s-ci-robot authored Jul 26, 2024
2 parents f97e873 + ae1bef6 commit dcc031d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions docs/book/utils/markerdocs/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ func (t Tag) WriteHTML(w io.Writer) error {
if t.Attrs != nil {
attrsOut = t.Attrs.ToAttrs()
}
if _, err := fmt.Fprintf((w, "<%s %s>", t.Name, attrsOut)
err != nil{
if _, err := fmt.Fprintf(w, "<%s %s>", t.Name, attrsOut); err != nil {
return err
}

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

if _, err := fmt.Fprintf((w, "</%s>", t.Name)
err != nil{
if _, err := fmt.Fprintf(w, "</%s>", t.Name); err != nil {
return err
}

Expand Down
5 changes: 2 additions & 3 deletions docs/book/utils/markerdocs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (p MarkerDocs) Process(input *plugin.Input) error {
content := new(strings.Builder)

// NB(directxman12): wrap this in a div to prevent the markdown processor from inserting extra paragraphs
_, 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)
_, 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)
if err != nil {
return "", fmt.Errorf("unable to render marker documentation summary: %v", err)
}
Expand All @@ -176,8 +176,7 @@ func (p MarkerDocs) Process(input *plugin.Input) error {
}
}

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

Expand Down

0 comments on commit dcc031d

Please sign in to comment.