Template plugin
July 5, 2026 ยท View on GitHub
๐ฆ This package has moved. It now lives in the markdown-magic-plugins monorepo at
packages/template. This repository is archived; issues and contributions go to the monorepo.
Template plugin
Add Lodash template support to markdown files via markdown-magic
Install
npm i markdown-magic markdown-magic-template --save-dev
Adding the plugin
See example.js for usage.
import path from 'path';
import { markdownMagic } from 'markdown-magic';
import TEMPLATE from './index.js';
const config = {
matchWord: 'AUTO-GENERATED-CONTENT',
transforms: {
TEMPLATE: TEMPLATE({ name: 'world' }),
},
};
const markdownPath = path.join(import.meta.dirname, 'README.md');
await markdownMagic(markdownPath, config);
Usage in markdown
hello world!
Options
- src (required) - path to template, relative to the Markdown file