bit-docs/lib/process/file module
Processes a file's source using any registered processors.
processFile(filename, source, docMap, siteConfig)
Passes the file source (and other data) to any registered processors like:
Also passes a ProcessorCallback that processors can use to add DocObjects to the DocMap.
Parameters
- filename
{String}
:The filename.
- source
{FileSource}
:The file's source.
- docMap
{DocMap}
:DocMap being added to.
- siteConfig
{Object}
:Global site config.
Use
var processFile = require('bit-docs/lib/process/file');
var docMap = {};
var siteConfig = {};
processFile(
"myproject.js",
"import $ from 'jquery' ... ",
docMap,
siteConfig
);
Falls back to default processor bit-docs-process-tags if no processor was able to process.
For .js
code files, each block will be processed individually by
bit-docs-js/process/codeAndComment.
For other files like .md
, processors will process the file source as one
big block.