noddity-linter
Check your Noddity posts and make sure that they won't cause render errors
Last updated 2 years ago by tehshrike .
WTFPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install noddity-linter 
SYNC missed versions from official npm registry.

Lint a directory full of Noddity posts to verify that they will render.

CLI

noddity-linter "./content/" ""

noddity-linter [--useIndex=true] noddityRootPath [glob pattern]

If any files have errors, logs hopefully-useful things to stdout and returns a non-zero exit code.

Programmatic

const lintPromise = noddityLinter({
	noddityRoot,
	pattern = `**/*.m?(m)d`,
	data = {},
	template,
	useIndex = true
})
  • noddityRoot - the path to the root Noddity directory
  • pattern - a string to be passed to glob to match posts to be tested. Defaults to **/*.m?(m)d
  • data - to be passed to validate-noddity-post to render the posts with. Defaults to {}
  • template - I actually can't think of a reason why you'd need to override this for linting purposes, but here we are
  • useIndex: if false, will infer an index of all posts instead of looking for an index.json file in the directory. Defaults to true

Returns a promise that resolves to an array with one object element per post checked. The object has a filePath property describing the path of the file checked, and an optional error property if there were any issues found while trying to render the file.

License

WTFPL

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

3 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 2
Dependencies (9)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |