-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
106 lines (101 loc) · 5.16 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* @module
Select, load and parse source files for `doczar` format documentation comments. Write json or
rendered html output to a configured disk location.
The normal workflow for document generation with syntax parsing enabled is:
* instantiate a [ComponentCache](doczar.ComponentCache) to contain your context.
* Tokenize the target entry files and pass them to the [Analyzer](doczar.Analyzer).
* Tokenize and analyze each additional file requested by the Analyzer.
* [Pre-process](doczar.Analyzer.preprocessSyntaxTree) the model.
* [Generate Components](doczar.Generator) for the model in the current context.
* [Finalize](doczar.ComponentCache#finalize) and [render](doczar.ComponentCache#writeFiles) the
documentation.
When syntax parsing is not desired, files can be fed directly into the [Parser](doczar.Parser)
at which point the context is ready to be finalized and rendered.
@spare `README.md`
This is the rendered output of the `doczar` source documentation.
*View the [source](https://github.com/shenanigans/node-doczar) on GitHub!*
@load
./README.md
*/
/* @submodule Options
Configuration options available to both module importers and command line users.
@member:Boolean dev
Include Components that have been marked with the `@development` modifier in the generated
documentation.
@member:Boolean api
Include **only** Components that have been marked with the `@api` modifier (and their parent
Components) in the generated documentation.
@member:Boolean json
Write an un-rendered `index.json` in each Component directory rather than the rendered
`index.html`. The written json file contains all the information that is passed to the template
engine during normal rendering.
@member:Boolean raw
Output simple bunyan-format logs to `stdout` instead of pretty-printing.
@member:Boolean noImply
Do not load standard libraries unless explicitly configured. This disables features such as
loading remote links to the Node.js standard library when using `--parse node`.
@member:Boolean noDeps
Do not document syntax files from external dependencies.
@member:Boolean node
Attempt to load a `package.json` in the current working directory and automatically configure
`doczar` to document the module it describes.
@member:Boolean jTrap
@default true
Force all manually-configured Component paths recovered from a javadoc-flavored syntax to be
children of either the path configured with `--root` or for code found in an external dependency
the root path of the parent module.
@member:String verbose
@default `"info"`
Configure the minimum level of importance for messages logged to `stdout`. One of: `"trace"`,
`"debug"`, `"info"`, `"warn"`, `"error"`, or `"fatal"`.
@member:String jsmod
Load a CommonJS module by any valid search path. Does **not** automatically configure `--root`.
@member:String in
Load any number of syntax files with one or more [glob]
(https://en.wikipedia.org/wiki/Glob_(programming%29) selectors.
@member:String out
@default `"docs"`
Configure the documentation output directory. The root index file is written into this
directory.
@member:String with
Load one of the provided standard libraries. The currently available libraries are: `"es5"`,
`"es6"`, `"browser"`, and `"node"`.
@member:String code
@default `"github"`
Syntax highlighting color template.
@member:String date
Manually configure a generation date/time stamp which will be applied to each page of the
generated documentation. Any String compatible with the [native Date constructor]
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse)
is acceptable.
@member:String parse
Process the selected files as syntax files. The currently available parsing modes are `"js"` and
`"node"`.
@member:String locals
The documentation mode for Components automatically mounted on local names when using `--parse`.
One of:
* `"all"` every local name found by the parser is documented
* `"comments"` include only local names with at least one attached documentation comment
* `"none"` do not document local names generated by `--parse`.
@member:String root
The default root path of all Components. Can be overridden by the `@module` tag.
@member:String fileRoot
The root search location for ES6 `import` statements.
@member:Number maxDepth
@default 4
The maximum stack depth used by `--parse` when tracing a series of function calls.
@member:Number maxRefDepth
@default 8
The maximum stack depth used by `--parse` when preprocessing values that passed through multiple
names or contexts between being declared and being used.
*/
module.exports = {
ComponentCache: require ('./src/ComponentCache'),
Component: require ('./src/Component'),
Parser: require ('./src/Parser'),
Patterns: require ('./src/Parser/Patterns'),
Analyzer: require ('./src/Analyzer'),
Generator: require ('./src/Generator'),
Templates: require ('./src/Templates'),
languages: require ('./src/langs')
};