@xmark/transform-shower
v0.24.0
Published
hast transform plugin to convert markdown to shower presentation documentation
Downloads
22
Readme
@xmark/transform-shower
xmark plugin to add certain elements for hast to use with shower, must be used together with @xmark/transform-wrap-headings
Usage
yarn add @xmark/core @xmark/transform-wrap-headings @xmark/theme-shower-ribbon @xmark/transform-shower
const XMark = require('@xmark/core');
const wrap = require('@xmark/transform-wrap-headings');
const shower = require('@xmark/transform-shower');
const theme = require('@xmark/theme-shower-ribbon');
const xmark = XMark();
// We just need to wrap h2 headings for shower to work
xmark.useTransform(wrap, {
parseAttributes: true,
parseStyleAttributes: true,
wrapperTag: 'section',
enabledHeadings: ['h2'],
wrapperClasses: {
wrapper: 'slide',
modifier: x => `slide--level${x}`,
},
});
xmark.useTransform(shower, {
caption: false,
progress: false,
wrapper: false,
});
xmark.useTheme(theme);
const markdown = `
// SEE slide.md for documentation
`;
const hast = xmark.toHAST(markdown);
console.log(hast);