docConfig typedef
Configures the behavior of DocumentJS. The following are values found within a documentjs.json or the grunt configuration.
Object
Use
A docConfig
is most commonly found in documentjs.json
. It configures
the behavior of DocumentJS. There are two main behaviors that docObject
controls:
- The retrieval of other projects or versions to be documented.
- The documentation behavior of the current project.
A complex configuration, like the one used for producing CanJS.com, might looks like:
{
versions: {
"1.1.8" : "https://github.com/bitovi/canjs/tree/1.1-legacy",
"2.1.4" : "https://github.com/bitovi/canjs/tree/v2.1.4",
"2.2.0-pre" : "https://github.com/bitovi/canjs/tree/minor",
"3.0.0-pre" : {
"source": "https://github.com/bitovi/canjs/tree/major",
"npmInstall" : true
}
},
versionDest: "<%= version %>",
defaultVersion: "2.1.4",
defaultDest: ".",
siteDefaults: {
"templates" : "theme/templates"
},
sites: {
pages: {
pattern: "_pages/*.md",
dest: "."
}
}
}
This configuration will download the listed versions
into "./<%= version %>/canjs" except for
2.1.4, which be downloaded to "./canjs". Then each version's documentjs.json
will be
generated. Finally, all markdown files in _pages
will be generated to ".".