UNPKG

svelte-markdoc-preprocess

Version:

A Svelte preprocessor that allows you to use Markdoc.

190 lines (189 loc) 3.69 kB
export const document = { render: 'article', children: [ 'heading', 'paragraph', 'image', 'table', 'tag', 'fence', 'blockquote', 'comment', 'list', 'hr', ], attributes: { frontmatter: {}, }, }; export const heading = { children: ['inline'], attributes: { level: { type: Number, required: true }, }, }; export const paragraph = { render: 'p', children: ['inline'], }; export const image = { render: 'img', attributes: { src: { type: String, required: true }, alt: { type: String }, title: { type: String }, }, }; export const fence = { render: 'pre', attributes: { content: { type: String, required: true }, language: { type: String }, process: { type: Boolean, default: true }, }, }; export const blockquote = { render: 'blockquote', children: [ 'heading', 'paragraph', 'image', 'table', 'tag', 'fence', 'blockquote', 'list', 'hr', ], }; export const item = { render: 'li', children: [ 'inline', 'heading', 'paragraph', 'image', 'table', 'tag', 'fence', 'blockquote', 'list', 'hr', ], }; export const list = { children: ['item'], attributes: { ordered: { type: Boolean, required: true }, start: { type: Number }, marker: { type: String }, }, }; export const hr = { render: 'hr', }; export const table = { render: 'table', }; export const td = { render: 'td', children: [ 'inline', 'heading', 'paragraph', 'image', 'table', 'tag', 'fence', 'blockquote', 'list', 'hr', ], attributes: { colspan: { type: Number }, rowspan: { type: Number }, align: { type: String }, }, }; export const th = { render: 'th', attributes: { width: { type: Number }, align: { type: String }, }, }; export const tr = { render: 'tr', children: ['th', 'td'], }; export const tbody = { render: 'tbody', children: ['tr', 'tag'], }; export const thead = { render: 'thead', children: ['tr'], }; export const strong = { render: 'strong', children: ['em', 's', 'link', 'code', 'text', 'tag'], attributes: { marker: { type: String }, }, }; export const em = { render: 'em', children: ['strong', 's', 'link', 'code', 'text', 'tag'], attributes: { marker: { type: String }, }, }; export const s = { render: 's', children: ['strong', 'em', 'link', 'code', 'text', 'tag'], }; export const inline = { children: [ 'strong', 'em', 's', 'code', 'text', 'tag', 'link', 'image', 'hardbreak', 'softbreak', 'comment', ], }; export const link = { render: 'a', children: ['strong', 'em', 's', 'code', 'text', 'tag'], attributes: { href: { type: String, required: true }, title: { type: String }, }, }; export const code = { render: 'code', attributes: { content: { type: String, required: true }, }, }; export const text = { attributes: { content: { type: String, required: true }, }, }; export const hardbreak = { render: 'br', }; export const comment = { attributes: { content: { type: String, required: true }, }, }; export const softbreak = {}; export const error = {}; export const node = {};