remark-enhance-frontmatter
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

remark-enhance-frontmatter

Remark plugin to enhance frontmatter in markdown files with common frontmatter files per directory and a few other derived attributes.

Content

What is this?

This package is a remark plugin.

When should I use this?

If you want to add some coomon frontmatter to all markdown files in a directory.

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:

npm install remark-enhance-frontmatter

Use

import remarkEnhanceFrontmatter from 'remark-enhance-frontmatter';
import remarkParse from 'remark-parse';
import { unified } from 'unified';

const processor = unified()
  .use(remarkParse)
  .use(remarkDirective)
  .use(remarkEnhanceFrontmatter, { title: true });

Options

file?: string

Name of the file that defines the pre-defined exports, default: _components.ts

resolvePaths?: boolean

Resolve relative paths from the merged frontmatter file with respect to that file.

title?: boolean

Add a title field to the frontmatter. The title is the first top-level heading in the markdown file # Title.

transform?: Transform[]

List of functions to transform the frontmatter.

Package Sidebar

Install

npm i remark-enhance-frontmatter

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

12.8 kB

Total Files

4

Last publish

Collaborators

  • shackhacker-christian