Documentation
¶
Index ¶
- func Convert(markdown string) ([]byte, error)
- type CodeBlockAttrs
- type Document
- type HeadingAttrs
- type LinkAttrs
- type Mark
- type MediaAttrs
- type MediaSingleAttrs
- type Node
- func BlockquoteNode(content ...Node) Node
- func BulletListNode(items ...Node) Node
- func CodeBlockNode(language string, content ...Node) Node
- func HardBreakNode() Node
- func HeadingNode(level int, content ...Node) Node
- func ListItemNode(content ...Node) Node
- func OrderedListNode(items ...Node) Node
- func ParagraphNode(content ...Node) Node
- func RuleNode() Node
- func TableCellNode(content ...Node) Node
- func TableHeaderNode(content ...Node) Node
- func TableNode(rows ...Node) Node
- func TableRowNode(cells ...Node) Node
- func TextNode(text string, marks ...Mark) Node
- type OrderedListAttrs
- type TableAttrs
- type TableCellAttrs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodeBlockAttrs ¶
type CodeBlockAttrs struct {
Language string `json:"language,omitempty"`
}
CodeBlockAttrs holds attributes for code block nodes
type Document ¶
type Document struct {
Version int `json:"version"`
Type string `json:"type"`
Content []Node `json:"content"`
}
Document represents the root ADF document
func ConvertToDoc ¶
ConvertToDoc transforms markdown to an ADF Document struct
func NewDocument ¶
func NewDocument() *Document
NewDocument creates a new ADF document with version 1
type HeadingAttrs ¶
type HeadingAttrs struct {
Level int `json:"level"`
}
HeadingAttrs holds attributes for heading nodes
type Mark ¶
type Mark struct {
Type string `json:"type"`
Attrs json.RawMessage `json:"attrs,omitempty"`
}
Mark represents text formatting (bold, italic, code, link, etc.)
type MediaAttrs ¶
type MediaAttrs struct {
Type string `json:"type"`
ID string `json:"id,omitempty"`
Collection string `json:"collection,omitempty"`
URL string `json:"url,omitempty"`
Alt string `json:"alt,omitempty"`
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
}
MediaAttrs holds attributes for media nodes
type MediaSingleAttrs ¶
type MediaSingleAttrs struct {
Layout string `json:"layout,omitempty"`
}
MediaSingleAttrs holds attributes for mediaSingle nodes
type Node ¶
type Node struct {
Type string `json:"type"`
Text string `json:"text,omitempty"`
Content []Node `json:"content,omitempty"`
Marks []Mark `json:"marks,omitempty"`
Attrs json.RawMessage `json:"attrs,omitempty"`
}
Node represents any ADF node (block or inline)
func BlockquoteNode ¶
BlockquoteNode creates a blockquote node
func BulletListNode ¶
BulletListNode creates a bullet list node
func CodeBlockNode ¶
CodeBlockNode creates a code block node
func HeadingNode ¶
HeadingNode creates a heading node with the specified level
func OrderedListNode ¶
OrderedListNode creates an ordered list node
func ParagraphNode ¶
ParagraphNode creates a paragraph node with content
func TableCellNode ¶
TableCellNode creates a table cell node
func TableHeaderNode ¶
TableHeaderNode creates a table header cell node
type OrderedListAttrs ¶
type OrderedListAttrs struct {
Order int `json:"order,omitempty"`
}
OrderedListAttrs holds attributes for ordered list nodes
type TableAttrs ¶
type TableAttrs struct {
IsNumberColumnEnabled bool `json:"isNumberColumnEnabled,omitempty"`
Layout string `json:"layout,omitempty"`
}
TableAttrs holds attributes for table nodes
type TableCellAttrs ¶
type TableCellAttrs struct {
ColSpan int `json:"colspan,omitempty"`
RowSpan int `json:"rowspan,omitempty"`
}
TableCellAttrs holds attributes for table cell/header nodes