Skip to content
This repository has been archived by the owner on Jan 1, 2018. It is now read-only.

[deprecated] remark plugin to extract values from a standard Stratic header

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

straticjs/stratic-extract-header

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stratic-extract-header

remark plugin to extract values from a standard Stratic header

DEPRECATED

This module is deprecated. It turns out that the Stratic header just isn't expressive enough and is t here for no good reason, really.

You should use gulp-grey-matter to parse YAML frontmatter instead. Accordingly, this package is unmaintained.

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

About

[deprecated] remark plugin to extract values from a standard Stratic header

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published