Standard library / go/doc/comment
go/doc/comment.Printer.Markdown()
Renders parsed documentation as Markdown. Expected stdout: 'Hello\n'.
Formal Syntax & Structure
go syntaxgo
func (p *Printer) Markdown(d *Doc) []byteParameters & Attributes
| Name | Type | Description |
|---|---|---|
| d | *Doc | Input to the operation as described above. |
Return Value
[]byte
Renders parsed documentation as Markdown.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/doc/comment")
func main() { p := comment.Parser{} pr := comment.Printer{} fmt.Print(string(pr.Markdown(p.Parse("Hello"))))}