1
0

Update lib.go

This commit is contained in:
arpio 2025-11-03 00:00:03 +01:00
parent 9c9c1a6160
commit 31e11a0ab1

8
lib.go
View File

@ -258,6 +258,8 @@ func Syntax(items ...SyntaxItem) Entry {
return Entry{typ: syntax, syntax: Sequence(items...)} return Entry{typ: syntax, syntax: Sequence(items...)}
} }
// Wrap can be used to wrap text into multiple similar length lines of maximum width. It may behave different
// for different entries and different output types.
func Wrap(e Entry, width int) Entry { func Wrap(e Entry, width int) Entry {
e.wrapWidth = width e.wrapWidth = width
return e return e
@ -265,7 +267,7 @@ func Wrap(e Entry, width int) Entry {
// Indent can be used to control indentation. Indentation may behave different depending on the output format. // Indent can be used to control indentation. Indentation may behave different depending on the output format.
// The indent parameter sets the indentation in spaces for a section. The indentFirst parameter sets the // The indent parameter sets the indentation in spaces for a section. The indentFirst parameter sets the
// indentation for the first line in the section and it is relative to indent parameter. // indentation for the first line in the section and it is relative to the indent parameter.
func Indent(e Entry, indent, indentFirst int) Entry { func Indent(e Entry, indent, indentFirst int) Entry {
e.indent, e.indentFirst = indent, indentFirst e.indent, e.indentFirst = indent, indentFirst
return e return e
@ -299,8 +301,8 @@ func HTMLFragment(out io.Writer, doc Document) error {
return renderHTMLFragment(out, doc) return renderHTMLFragment(out, doc)
} }
// HTMLFragment renders the input document as a HTML document. If the lang attribute is empty, it will be // HTML renders the input document as an HTML document. If the lang attribute is empty, it will be omitted from
// omitted from the html element. // the html element.
func HTML(out io.Writer, doc Document, lang string) error { func HTML(out io.Writer, doc Document, lang string) error {
return renderHTML(out, doc, lang) return renderHTML(out, doc, lang)
} }