Help us shape the future of Go! Take the 2026 Go Developer Survey

markdown

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCodeDetails

func FormatCodeDetails(summary, code string) string

FormatCodeDetails formats summary and code text wrapped in a markdown code block within a <details> element.

func FormatDetails

func FormatDetails(summary, content string) string

FormatDetails formats summary and content as a markdown <details> block.

func HeadingPrefix

func HeadingPrefix(level int) string

HeadingPrefix returns the markdown heading prefix for a given level (clamped to 1-6).

func ParseResultFiles

func ParseResultFiles(stdout string) []string

ParseResultFiles parses stdout lines into non-empty file paths.

func WriteHeader

func WriteHeader(w io.Writer, title string, headerLevel int) error

WriteHeader writes a top-level Markdown heading for a command execution. titleLevel is typically headerLevel - 1 (clamped to 1-6).

func WriteList

func WriteList(w io.Writer, results []common.RepoResult, reposRoot string, headerLevel int) error

WriteList writes the complete list output in Markdown format: a top heading, a bullet list of repositories, and a summary section.

func WriteLsFiles

func WriteLsFiles(w io.Writer, r common.Result, headerLevel int) error

WriteLsFiles writes an individual repository's ls-files Result formatted as Markdown.

func WriteLsFilesSummary

func WriteLsFilesSummary(w io.Writer, results []common.Result, headerLevel int) error

WriteLsFilesSummary writes an aggregate summary for multiple ls-files Results.

func WriteRepo

func WriteRepo(w io.Writer, r common.RepoResult, headerLevel int) error

WriteRepo writes RepoResult formatted as a Markdown section.

func WriteResult

func WriteResult(w io.Writer, r common.Result, headerLevel int) error

WriteResult writes Result formatted as a Markdown section. The heading is "<h> <repo>: exit code = <code>" using headerLevel (clamped to 1-6). stdout/stderr are wrapped in collapsible <details> blocks.

func WriteSummary

func WriteSummary(w io.Writer, results []common.Result, headerLevel int) error

WriteSummary writes an aggregate summary for multiple Results.

func WriteWorktreeList added in v0.4.0

func WriteWorktreeList(w io.Writer, results []common.WorktreeResult, worktreeRoot string, headerLevel int) error

WriteWorktreeList writes the complete worktree list output in Markdown format: a top heading, a list of worktrees with branch and main repository paths, and a summary section.

Types

type Details

type Details struct {
	Summary string
	Content string
}

Details represents an HTML <details><summary>...</summary>...</details> collapsible block.

func NewCodeDetails

func NewCodeDetails(summary, code string) Details

NewCodeDetails creates a Details block with code content wrapped in triple backticks.

func (Details) String

func (d Details) String() string

String formats the Details block into a string with a trailing double newline.

func (Details) WriteTo

func (d Details) WriteTo(w io.Writer) (int64, error)

WriteTo writes the formatted <details> block to w with a trailing double newline, implementing io.WriterTo.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL