
Research
/Security News
737 Chrome VPN Extensions Linked to Brand Impersonation and Browser Traffic Redirection
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.
@rendermark/core
Advanced tools
> Markdown rendering engine — convert Markdown to beautiful HTML documents, PDFs, DOCX, slides, and more.
Markdown rendering engine — convert Markdown to beautiful HTML documents, PDFs, DOCX, slides, and more.
npm install @rendermark/core
import { renderMarkdownToHtml } from "@rendermark/core";
const html = await renderMarkdownToHtml({
title: "My Document",
markdown: "# Hello World\n\nThis is **RenderMark**.",
theme: "default",
showToc: true,
});
// html is a complete, styled HTML document ready to serve or save
renderMarkdownToHtml(options: RenderOptions): Promise<string>Render markdown to a full, styled HTML document with CSS, fonts, branding, and table of contents.
const html = await renderMarkdownToHtml({
title: "Report",
markdown: content,
showToc: true,
theme: "serif",
template: "report",
github: { owner: "user", repo: "repo", branch: "main", path: "docs/file.md" },
sanitize: true, // Strip XSS for public-facing pages
});
markdownToHtmlFragment(markdown: string): Promise<string>Render markdown to an HTML fragment (no document wrapper). Useful for inline rendering or blog posts.
generateGoogleDocsHtml(title: string, markdown: string): Promise<string>Generate simplified HTML optimized for Google Docs import, with inline styles and GDocs-compatible formatting.
markdownToDocx(options): Promise<Buffer>Convert markdown to a DOCX (Word) file buffer.
import { markdownToDocx } from "@rendermark/core";
const buf = await markdownToDocx({
markdown: content,
title: "My Document",
github: { owner: "user", repo: "repo", path: "doc.md" },
});
renderToImage(options: RenderToImageOptions): Promise<void>Render markdown to a PNG or JPEG screenshot via a callback. Requires a Puppeteer-compatible environment.
renderDiff(options: DiffOptions): stringGenerate a visual diff between two markdown versions as a standalone HTML document.
import { renderDiff } from "@rendermark/core";
const html = renderDiff({
before: oldMarkdown,
after: newMarkdown,
mode: "inline", // or "side-by-side"
title: "Document Changes",
});
markdownToSlides(options: SlideOptions): Promise<string>Convert markdown into a presentation slide deck. Slides split on --- (horizontal rules) or ## headings.
import { markdownToSlides } from "@rendermark/core";
const html = await markdownToSlides({
markdown: content,
title: "My Presentation",
theme: "dark",
splitOn: "hr", // or "h2"
});
parseFrontmatter(markdown: string): { data: FrontmatterData; content: string }Parse YAML frontmatter from a markdown string. Returns the parsed data and the content without frontmatter.
getTheme(name: string): stringGet the CSS override for a named theme. Returns an empty string for unknown themes.
listThemes(): string[]List all available built-in theme names.
isBuiltinTheme(name: string): booleanCheck if a theme name is a built-in theme.
applyTemplate(name: string, options): stringApply a named template to markdown content. Templates wrap the markdown with structural elements.
listTemplates(): string[]List all available built-in template names.
getTemplateDefaultTheme(name: string): string | undefinedGet the default theme associated with a template.
resolveGitHubRelativePaths(markdown: string, context?: GitHubContext): stringResolve relative image/link paths in markdown to absolute GitHub raw URLs.
extractHeadings(markdown: string): TocItem[]Extract headings (h1–h3) from raw markdown for table of contents generation.
generateTocHtml(headings: TocItem[]): stringGenerate an HTML table of contents from extracted headings.
generateSlug(text: string): stringGenerate a URL-safe slug from heading text, matching GitHub/rehype-slug conventions.
escapeHtml(str: string): stringHTML-escape a string (&, <, >, ", ').
createProcessor()Create the full unified processor with all remark/rehype plugins (GFM, math, syntax highlighting, mermaid, callouts, etc.).
createBasicProcessor()Create a basic processor without syntax highlighting or advanced plugins. Used for Google Docs output.
createSanitizedProcessor()Create a sanitized processor that strips XSS vectors while preserving classes/ids for styling.
These remark/rehype plugins are used internally and exported for advanced usage:
remarkMermaid — Transform mermaid code blocks into client-side rendered diagramsremarkCallouts — Obsidian-style > [!note] callout boxesremarkWikiLinks — [[slug]] and [[slug|text]] wiki-style linksremarkComments — Strip %%hidden%% Obsidian-style commentsrehypeSourceLines — Add data-source-line attributes for scroll syncinterface RenderOptions {
title: string;
markdown: string;
showToc?: boolean; // Include table of contents (default: true)
github?: GitHubContext; // GitHub context for resolving relative paths
docId?: string; // Document ID for branding links
theme?: string; // Theme name
template?: string; // Template name
sanitize?: boolean; // Use sanitized processor for public pages
}
| Theme | Description |
|---|---|
default | Clean, modern with Geist font |
dark | Dark background, light text |
serif | Traditional serif typography |
minimal | Stripped-down, distraction-free |
Themes can be set via the theme option or theme frontmatter field.
| Template | Description | Default Theme |
|---|---|---|
report | Formal report with cover page | — |
meeting-notes | Meeting notes with attendees | — |
memo | Internal memo format | — |
letter | Formal letter layout | serif |
slides | Presentation slide deck | — |
changelog | Version changelog format | — |
Templates can be set via the template option or template frontmatter field.
RenderMark supports YAML frontmatter at the top of markdown files:
---
title: My Document
theme: serif
template: report
toc: true
author: Jane Doe
date: 2025-01-15
custom_field: any value
---
| Field | Type | Description |
|---|---|---|
title | string | Document title |
theme | string | Theme name (default, dark, serif, minimal) |
template | string | Template name |
toc | boolean | Show table of contents |
author | string | Author name (used by templates) |
date | string | Date (used by templates) |
Additional custom fields are passed through and available to templates.
MIT
FAQs
> Markdown rendering engine — convert Markdown to beautiful HTML documents, PDFs, DOCX, slides, and more.
The npm package @rendermark/core receives a total of 24 weekly downloads. As such, @rendermark/core popularity was classified as not popular.
We found that @rendermark/core demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.