This package has been deprecated

Author message:

the Stratic header is not expressive enough; use YAML frontmatter instead

stratic-extract-header

1.0.1 • Public • Published

stratic-extract-header

remark plugin to extract values from a standard Stratic header

Installation

npm install stratic-extract-header

Usage

var remark = require('remark');
var extractHeader = require('stratic-extract-header');

var fileData = {}
var processor = remark().use(extractHeader, {data: fileData});

processor.process([
    '# Post information',
    '"Title", "0 UTC-0","Jane Doe", "some, categories"',
	'# Post text',
	'Some arbitrary Markdown content'
].join('\n'));

console.log(fileData);

Outputs:

{ title: 'Title',
  time: { epoch: '0', utcoffset: 'UTC-0' },
  author: 'Jane Doe',
  categories: [ 'some', 'categories' ] }

You must pass an options object to remark.use(). This object should contain one key, data, whose value is a reference to the object that stratic-extract-header will populate with metadata information.

License

LGPL 3.0+

Author

Alex Jordan alex@strugee.net

Readme

Keywords

Package Sidebar

Install

npm i stratic-extract-header

Weekly Downloads

1

Version

1.0.1

License

LGPL-3.0+

Last publish

Collaborators

  • strugee