documon () documon/src/documon.js 26
xpath documon.documon
file documon/src/documon.js

The main entry point and processor for Documon, which allows you to run Documon directly from Node.

Example
    var myDocumon = require("path/to/documon/src/documon.js");
    myDocumon.run({
      files : "path/to/src"
    });
Properties
dumpData
documon/src/documon.js120
boolean false

Whether or not to write intermediary files used during processing to the output data folder.

extensions
documon/src/documon.js86
array

The list of extensions to search for source code.

ignoreList
documon/src/documon.js97
array

A list of strings representing regex patterns for files/folders to ignore. By default the following patterns are already included:

    '\/\.'
    '\.git'
    'node_modules'

Configuration will concat this list with the user provied list.
indexRedirectName
documon/src/documon.js125
string

The filename for the shortcut to the index.html file. Use a name that will push the name to the top of the folder for quicker access to the index.hrml file.

mainConf
documon/src/documon.js81
Object

NOTE: // sourceRootFolder and dataFolder are injected into the "mainConf" by documon.

Example link other class to root.documon.dirutils.makedir
Example link other class to documon.dirutils.makedir
Example link other class to documon.dirutils
Example link local to #run

mainConf properties
projectName
string

The title of the project (displayed in the title of the docs).

files
string | array

The location of the source file or folder to process.

outputFolder
string optional

Where the docs will be written to. Defaults to be parallel to source folder.

ignoreList
array optional

A list of source files or folders to ignore.

templateFolder
string optional

The path to the template folder (defaults to the main documon/template folder)

projectVersion
string optional

Your product's version

docBegin
string optional /**

Delimiter used to signify the START of a source-code comment.

docEnd
string optional */

Delimiter used to signify the END of a source-code comment.

launchWhenDone
boolean optional false

Launch the documentation in the browser when done?

sourceExt
string | array optional js

The extension of your source code files to parse. For multiple kinds, use a space delimited string (e.g. "js jsx py php").

dumpData
boolean optional false

Whether or not to save intermediary data objects.

docsDirName
String optional docs

The folder name used to house the docs.

sourceRootFolder
String optional

(derived by documon) The actual location that a given source file resides within.

dataFolder
String optional

(derived by documon) The path used to place data files.

more
String optional

The path to a folder containing addition markdown (.md) files to include.

indexShortcutName
String optional __LAUNCH.html

The name of the index shortcut file to push it to the top of the folder so you don't have to scroll and hunt andpeck for hte "index.html" file to launch the docs.

moreQuirkDelimiter
String optional .

More quirk delimiter. The character(s) use to seperate the "more" page numbering system from page titles.

quiet
documon/src/documon.js115
boolean false

Supress stdout messages.

Methods
filterFileTypes (fpath) private documon/src/documon.js 152

Determines if the file has the proper extension based on the acceptable extensions defined in this modules static "extensions" array.

Parameters
fpath
string

The path or full file name.

Returns boolean

Whether or not it's an OK extension.

init (conf) private documon/src/documon.js 188

Initializes Documan based on the configuration settings

  • Parses configuration
  • Finds source files
  • Creates output folder
  • Copies template assets to output folder
  • Initializes main templates
Parameters
conf
object

See (run)[run], as this configuration object is simply passed through.

Returns boolean

False when there's an error or misconfiguration. True when everything seems cool.

run (conf) documon/src/documon.js 623

The main processing loop that executes and manages the main flow control of parsing, evaluating and
construction of the documentation.

After init configures things based on the settings, and generates a list of files to process
this method process and sends each file to the seeder of evaluation and processing.

  • Generates HTML pages
  • Generates _menuData.js
Parameters
conf
object

The configuration object. See mainConf

seeder (file) private documon/src/documon.js 517

Extracts, parses and tags comments from one source file and stuffs the result into organizer.

  • Generates data files (if dumpData enabled)
Parameters
file
string

The path to the file.

Returns object

The file's search data as computed by tag.js

shouldIgnore (item) private documon/src/documon.js 475

Extracts, parses and tags comments from one source file and stuffs the result into organizer.

  • Generates data files (if dumpData enabled)
Parameters
item
string

The path to the file.

Returns boolean

true = ignore this file, false = don't ignore.

writeData (fpath, data, json) private documon/src/documon.js 141

Simplify file write for text or json.

Parameters
fpath
string

The path to save to.

data
string

The string to save

json
boolean

Whether the data should be serialized to JSON or not.