Standard library / go/doc/comment

go/doc/comment.Printer.HTML()

Renders parsed documentation as HTML. Expected stdout: '<p>Hello\n'.

Formal Syntax & Structure

go syntaxgo
func (p *Printer) HTML(d *Doc) []byte

Parameters & Attributes

NameTypeDescription
d*DocInput to the operation as described above.

Return Value

[]byte

Renders parsed documentation as HTML.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc/comment")
func main() {  p := comment.Parser{}  pr := comment.Printer{}  fmt.Print(string(pr.HTML(p.Parse("Hello"))))}
Go Reference