Tag typedef
Tags add information to the new DocObject created by bit-docs-process-tags/process-tags when processing a TagBlock.
Object
About Tags
Tags are objects with callback functions, properties, and state that the bit-docs-process-tags processor is specially designed to handle.
The bit-docs-process-tags/process-tags processor allows Tags in a TagCollection to manipulate a ProcessTagsStack using ProcessTagsCommands.
Register a Tag
To register a Tag, you need to add to register
on the tags
hook (in your plugin bit-docs.js
) an object naming your
Tag and setting it to an object containing at
least a Tag.add and an optional
Tag.addMore method:
var tags = {
"mytag": {
addMore: function (line, last) { ... },
add: function (line) { ... }
}
};
for(var name in tags) {
tags[name].name = name;
}
bitDocs.register("tags", tags);