markdown

package
v0.0.0-...-18492a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// EnableShortcodes context key for indicates if shortcodes enabled
	EnableShortcodes = parser.NewContextKey()
	// UsedShortcodesKey store list of used shortcodes on page
	UsedShortcodesKey = parser.NewContextKey()
)
View Source
var ShortCodeNodeKinds = map[string]gast.NodeKind{
	// contains filtered or unexported fields
}

ShortCodeNodeKinds mapping `keyword -> NodeKind`

View Source
var TableOfContentsShortcode = &tocExtender{}

TableOfContentsShortcode allows to insert Table Of Contents with {{ toc }} shortcode

Functions

This section is empty.

Types

type Converter

type Converter struct {
	// contains filtered or unexported fields
}

Render renders markdown to html

func NewConverter

func NewConverter() *Converter

NewRender create new renderer

func (*Converter) Convert

func (r *Converter) Convert(data []byte) (*Document, error)

Converter markdown to html

type Document

type Document struct {
	Title   string
	Preview string
	Body    string
}

type PagePreviewText

type PagePreviewText struct {
	Title   string
	Preview string
}

PagePreviewText contains title of document and beginning of content

type ShortCodeNode

type ShortCodeNode struct {
	gast.BaseInline
	// contains filtered or unexported fields
}

A ShortCodeNode struct represents a tweet ast node

func (*ShortCodeNode) Dump

func (n *ShortCodeNode) Dump(source []byte, level int)

Dump for ShortCodeNode

func (*ShortCodeNode) Kind

func (n *ShortCodeNode) Kind() gast.NodeKind

Kind implements Node.Kind.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL