Documentation
¶
Overview ¶
Package markdown is the writer of the content of a document as Markdown, which a handler of the markdown namespace writes, and which keeps the part of it in the range set via metadata.WithRange
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is written the content of a document as Markdown, by a handler of the markdown namespace, and keeps the part of it in the range set via metadata.WithRange. Once it has the part, a write returns an error, so the handler can stop, rather than converting the rest of the document. A handler returns the part with Metadata, which also takes the handler's error.
func NewWriter ¶
NewWriter returns a writer which keeps the part of the Markdown in the range set via metadata.WithRange, or the first kilobyte when it wasn't set
func (*Writer) Metadata ¶
Metadata returns the part of the Markdown, and the handler's error, which is nil when it stopped as the writer had the part. The part is markdown:body; markdown:offset is the byte it starts at, when the range has an offset, which is moved forward to the start of a character; and markdown:next is the offset of the next part, when there's more. Returns an error when the offset is beyond the end of the Markdown.