Documentation
¶
Overview ¶
Package markdown converts between Markdown and Confluence "storage" format (an XHTML-based representation).
Markdown -> storage uses goldmark to render XHTML, which the storage format accepts directly. storage -> Markdown walks the XHTML with x/net/html and emits Markdown, degrading gracefully (recursing into unknown/macro elements so their text survives).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromStorage ¶
FromStorage converts Confluence storage-format XHTML to Markdown. It handles the standard block and inline HTML elements; elements it doesn't recognize (e.g. Confluence macros) are descended into so their text content survives.
An optional Options qualifies internal Confluence links (see Options.SpaceKey).
Types ¶
type Options ¶
type Options struct {
// SpaceKey is the key of the space containing the page being converted. It
// qualifies internal links that omit an explicit space (Confluence stores a
// space key only for cross-space links, so same-space links rely on this).
SpaceKey string
// ResolvePageURL, if set, maps an internal page link (space key + title) to
// an absolute, browser-clickable URL. Returning ok=false (or leaving this
// nil) falls back to the lossless confluence:// descriptor.
ResolvePageURL func(spaceKey, title string) (url string, ok bool)
}
Options configure storage→markdown conversion.