package main import ( "bytes" "fmt" "os" "go.alanpearce.eu/searchix/internal/nixdocs/command" "github.com/yuin/goldmark" ) func main() { // Create a new markdown parser with the command extension md := goldmark.New( goldmark.WithExtensions( command.New(), ), ) // Example markdown text with command references markdown := "Use {command}`git clone git@github.com:example/repo.git` to clone the repository." // Convert markdown to HTML var buf bytes.Buffer if err := md.Convert([]byte(markdown), &buf); err != nil { fmt.Fprintf(os.Stderr, "Error converting markdown: %v\n", err) os.Exit(1) } // Print the resulting HTML fmt.Println("HTML Output:") fmt.Println("===========") fmt.Println(buf.String()) }