0.0.2 • Published 11 months ago

remark-enhance-frontmatter v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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.

0.0.2

11 months ago

0.0.1

11 months ago