schema

package
v0.0.0-...-32d4dcf Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultSpec = p.SchemaSpec{
		Nodes:   DefaultNodes,
		TopNode: "doc",
		Marks:   DefaultMarks,
	}

	DefaultMarks = map[p.MarkTypeName]p.MarkSpec{
		"link":   {},
		"em":     {},
		"strong": {},
		"code":   {},
	}

	DefaultNodes = map[p.NodeTypeName]p.NodeSpec{
		"doc": {
			Content: "block+",
		},
		"paragraph": {
			Content: "inline*",
			Group:   "block",
		},
		"blockquote": {
			Content: "block+",
			Group:   "block",
		},
		"horizontal_rule": {
			Group: "block",
		},
		"heading": {
			Content: "inline*",
			Group:   "block",
			Attrs: map[string]p.Attribute{
				"level": {
					Default: 1,
				},
			},
		},
		"code_block": {
			Content: "text*",
			Group:   "block",
			Marks:   opt(""),
			Attrs: map[string]p.Attribute{
				"language": {
					Default: nil,
				},
			},
		},
		"text": {
			Group: "inline",
		},
		"image": {
			Inline: true,
			Attrs: map[string]p.Attribute{
				"src":   {},
				"alt":   {},
				"title": {},
			},
			Group: "inline",
		},
		"hard_break": {
			Inline: true,
			Group:  "inline",
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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