mdx

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJsCode

func GetJsCode(pc parser.Context) string

func GetJsxCode

func GetJsxCode(pc parser.Context) *text.Segments

func NewJsCodeParser

func NewJsCodeParser() parser.BlockParser

NewJsCodeParser 解析在最开始的 js 代码,支持 import、function、const、let 开头的代码,已空行结束

func NewJsxParser

func NewJsxParser() parser.BlockParser

func NewMdJsx

func NewMdJsx(format MdFormat) goldmark.Extender

Types

type JsxNode

type JsxNode struct {
	ast.BaseBlock
	// contains filtered or unexported fields
}

func (*JsxNode) Dump

func (j *JsxNode) Dump(source []byte, level int)

func (*JsxNode) HasBlankPreviousLines

func (j *JsxNode) HasBlankPreviousLines() bool

func (*JsxNode) IsRaw

func (j *JsxNode) IsRaw() bool

IsRaw return true 不解析 block 中的内容

func (*JsxNode) Kind

func (j *JsxNode) Kind() ast.NodeKind

func (*JsxNode) SetBlankPreviousLines

func (j *JsxNode) SetBlankPreviousLines(v bool)

type JsxRender

type JsxRender struct {
}

func (*JsxRender) RegisterFuncs

func (j *JsxRender) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)

type MdFormat

type MdFormat string
const (
	Mdx MdFormat = "mdx"
	Md  MdFormat = "md"
)

type WrapParser

type WrapParser struct {
	parser.Parser
	// contains filtered or unexported fields
}

func (*WrapParser) GetContext

func (p *WrapParser) GetContext() parser.Context

func (*WrapParser) Parse

func (p *WrapParser) Parse(reader text.Reader, opts ...parser.ParseOption) ast.Node

type WrapRender

type WrapRender struct {
	renderer.Renderer
	// contains filtered or unexported fields
}

func (WrapRender) Render

func (r WrapRender) Render(w io.Writer, source []byte, n ast.Node) error

Jump to

Keyboard shortcuts

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