Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation Script for OC Path and RPC Coverage in READMEs #2865

Merged
merged 19 commits into from
Apr 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make YAMLRenderer unexported
  • Loading branch information
wenovus committed Apr 2, 2024
commit 93bc9bd2853020e1f85b433c2a70f7b47addfed8
12 changes: 6 additions & 6 deletions tools/internal/mdocspec/md.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ var MDOCSpecs = &mdOCSpecs{}

func (e *mdOCSpecs) Extend(m goldmark.Markdown) {
extension.GFM.Extend(m)
m.SetRenderer(&YAMLRenderer{})
m.SetRenderer(&yamlRenderer{})
}

type YAMLRenderer struct{}
type yamlRenderer struct{}

func (r *YAMLRenderer) Render(w io.Writer, source []byte, n ast.Node) error {
func (r *yamlRenderer) Render(w io.Writer, source []byte, n ast.Node) error {
return ast.Walk(n, func(n ast.Node, entering bool) (ast.WalkStatus, error) {
return yamlRenderer(w, source, n, entering)
return renderYAML(w, source, n, entering)
})
}

func (r *YAMLRenderer) AddOptions(...renderer.Option) {}
func (r *yamlRenderer) AddOptions(...renderer.Option) {}

func yamlCodeBlock(source []byte, n ast.Node) *ast.FencedCodeBlock {
if s, ok := n.(*ast.FencedCodeBlock); ok && s.Info != nil {
Expand All @@ -50,7 +50,7 @@ func yamlCodeBlock(source []byte, n ast.Node) *ast.FencedCodeBlock {
return nil
}

func yamlRenderer(w io.Writer, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) {
func renderYAML(w io.Writer, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error) {
if !entering {
return ast.WalkContinue, nil
}
Expand Down
Loading