
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
solidjs-markdoc
Advanced tools
Render Markdoc syntax with SolidJS.
npm install solidjs-markdoc
You can provide simple markdown strings to the renderer to render Markdoc.
import Markdoc from "@markdoc/markdoc";
import render from "solidjs-markdoc";
function App() {
const md = `
# Hello World
We can render markdown.
`;
const ast = Markdoc.parse(md);
const content = Markdoc.transform(ast);
return render(content);
}
Setup a Markdoc schema.
schema/
└── Alert.markdoc.ts
// schema/Alert.markdoc.ts
export default {
render: "Alert",
description: "Display the enclosed content in an alert box",
children: ["paragraph", "tag", "list"],
attributes: {
type: {
type: String,
default: "default",
matches: ["default", "info", "warning", "error", "success"],
},
},
};
Create your Solid component.
function Alert({ type, children }) {
return (
<div class={`alert alert--${type}`}>
{children}
</div>
);
}
Import the renderer and schema into your component.
import Markdoc from "@markdoc/markdoc";
import render from "solidjs-markdoc";
import alert from "./schema/Alert.markdoc";
function Alert({ type, children }) {
return (
<div class={`alert alert--${type}`}>
{children}
</div>
);
}
function App() {
//...
}
Create the config to pass into your Markdoc.transform call.
function App() {
const md = `
# Getting started
You can run SolidJS components in here.
Check this alert:
{% alert type="info" %}
Hey there! Something to look at!
{% /alert %}
`;
const config = {
tags: {
alert,
},
};
const ast = Markdoc.parse(md);
const content = Markdoc.transform(ast, config);
//...
}
Finally, return the result of the render function making sure to supply your custom component to the render function's components object.
function App() {
// ...
return render(content, {
components: {
Alert,
},
});
}
const alert = {
render: "Alert",
description: "Display the enclosed content in an alert box",
children: ["paragraph", "tag", "list"],
attributes: {
type: {
type: String,
default: "default",
matches: ["default", "info", "warning", "error", "success"],
},
},
};
function Alert({ type, children }) {
return (
<div class={`alert alert--${type}`}>
{children}
</div>
);
}
function App() {
const md = `
# Getting started
You can run SolidJS components in here.
Check this alert:
{% alert type="info" %}
Hey there! Something to look at!
{% /alert %}
`;
const config = {
tags: {
alert,
},
};
const ast = Markdoc.parse(md);
const content = Markdoc.transform(ast, config);
return render(content, {
components: {
Alert,
},
});
}
FAQs
SolidJS renderer for Markdoc
The npm package solidjs-markdoc receives a total of 5 weekly downloads. As such, solidjs-markdoc popularity was classified as not popular.
We found that solidjs-markdoc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.