Snapdragon plugin that adds an
isInside
method to the compiler instance for checking if a node is currently inside a given node type.
Install with npm:
$ npm install --save snapdragon-is-inside
The main export if a function that should be passed to snapdragon.use()
to register the plugin.
Example
var Snapdragon = require('snapdragon');
var isInside = require('snapdragon-is-inside');
// register the plugin
var snapdragon = new Snapdragon();
snapdragon.use(isInside());
// or register directly on the compiler instance
var compiler = new Snapdragon.Compiler();
compiler.use(isInside());
Returns true if node
is currently inside the given node type(s).
Params
node
{Object}types
{String|Array|Regex}: Pass one or more types to check for, or a regex to use for matching types.returns
{Boolean}: Returns true if the plugin
Example
snapdragon.use(isInside());
snapdragon.compiler
.set('foo', function(node) {
if (this.isInside(node, 'some-other-node-type')) {
// do stuff
}
});
- snapdragon-capture: Snapdragon plugin that adds a capture method to the parser instance. | homepage
- snapdragon-node: Snapdragon utility for creating a new AST node in custom code, such as plugins. | homepage
- snapdragon-position: Snapdragon util and plugin for patching the position on an AST node. | homepage
- snapdragon-util: Utilities for the snapdragon parser/compiler. | homepage
- snapdragon: Fast, pluggable and easy-to-use parser-renderer factory. | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.4.1, on January 21, 2017.