47 lines
1 KiB
TypeScript
47 lines
1 KiB
TypeScript
import { component, defineMarkdocConfig } from '@astrojs/markdoc/config';
|
|
|
|
function mdocComponent(name: string) {
|
|
return component(`./src/components/mdoc/${name}.astro`);
|
|
}
|
|
|
|
export default defineMarkdocConfig({
|
|
nodes: {
|
|
paragraph: {
|
|
render: mdocComponent('Paragraph'),
|
|
},
|
|
heading: {
|
|
render: mdocComponent('Heading'),
|
|
attributes: { level: { type: Number } },
|
|
},
|
|
list: {
|
|
render: mdocComponent('List'),
|
|
attributes: {
|
|
ordered: { type: Boolean },
|
|
marker: {
|
|
type: String,
|
|
},
|
|
},
|
|
},
|
|
link: {
|
|
render: mdocComponent('InlineLink'),
|
|
attributes: { href: { type: String } },
|
|
},
|
|
item: {
|
|
render: mdocComponent('BulletListItem'),
|
|
attributes: {},
|
|
},
|
|
hr: {
|
|
render: mdocComponent('HorizontalBreak'),
|
|
},
|
|
},
|
|
tags: {
|
|
ShowableFigure: {
|
|
render: mdocComponent('ShowableFigure'),
|
|
attributes: {
|
|
image: { type: String, required: true },
|
|
altText: { type: String, required: true },
|
|
},
|
|
},
|
|
},
|
|
});
|