1.2.1 ā¢ Published 4 months ago
markdown-it-fff v1.2.1
Markdown It FFF
š markdown-it plugin for auto-conversion other frontmatter variable formats to FFF Flavored Frontmatter.
Install
pnpm add markdown-it-fff # pnpm
# yarn add markdown-it-fff # yarn
# npm i markdown-it-fff # npm
Usage
import MarkdownIt from 'markdown-it'
import { frontmatterPlugin } from '@mdit-vue/plugin-frontmatter'
import { fffPlugin } from 'markdown-it-fff'
const md = MarkdownIt()
.use(frontmatterPlugin, {
grayMatterOptions: {
excerpt: true,
},
})
.use(fffPlugin, {
presets: [{
created: 'date',
flags: ({ draft }) => (draft ? ['draft'] : []),
summary: 'excerpt',
}],
})
Options
Configuration (optional).
options.presets
default: []
Specifies a preset for how remark-fff will be converted.
You can create your own presets, or import some from fff-transform-presets
.
import MarkdownIt from 'markdown-it'
import { fffPlugin } from 'markdown-it-fff'
import { hugo, mditVue } from 'fff-transform-presets'
const md = MarkdownIt()
.use(fffPlugin, {
presets: [
hugo,
mditVue,
{
created: 'date',
flags: ({ draft }) => (draft ? ['draft'] : []),
summary: 'excerpt',
},
],
})
options.strict
default: undefined
Forced conversion to a single type, currently limited to media variables.
import MarkdownIt from 'markdown-it'
import { fffPlugin } from 'markdown-it-fff'
const md = MarkdownIt()
.use(fffPlugin, {
strict: {
media: {
type: 'string',
array: false,
},
},
})
1.2.1
4 months ago
1.2.0
4 months ago
1.2.0-alpha.1
4 months ago
1.2.0-alpha.0
5 months ago
1.1.0
8 months ago
1.0.1
11 months ago
1.0.0
11 months ago
1.1.0-alpha.0
9 months ago
1.0.0-alpha.1
12 months ago
1.0.0-alpha.0
12 months ago
0.5.3
1 year ago
0.5.2
1 year ago
0.5.1
1 year ago
0.5.0
1 year ago