docConfig
- typedef
{Object}
Configures the behavior of DocumentJS. The following are values found within a documentjs.json or the grunt configuration.
Object
Properties
-
versions
{Object<String,projectConfig | String>}
OptionalA map of version names to their source or to a projectConfig that specifies where and how to install the release. For example:
{ "versions" : { "1.8.4": "https://github.com/org/project/tree/v1.8.4", "2.0.9": "https://github.com/org/project/tree/v2.0.9" "3.0.0-pre": { "source": "https://github.com/org/project#major", "npmInstall": true } } }
Each versions key is a version name and the value is either a projectConfig or will be made into a projectConfig's source.
Each version will be downloaded to a location depending on
versionDest
,defaultDest
anddefaultVersion
. If the version key equalsdefaultVersion
the project will be installed usingdefaultDest
; otherwise, the project will be installed usingversionDest
. -
defaultVersion
{String}
OptionalThe default version that will be copied into the
defaultDest
location. This is so users can go tohttp://site.com/api
to find the latest docs and nothttp://site.com/2.0.1/api
. -
defaultDest
="./<%=name%>"
{String}
OptionalThe location of where the default docs should be rendered to.
-
versionDest
="./<%=version%>/<%=name%>"
{String}
OptionalThe templated directory name of where each version's download and docs should be created. The default is
"<%= version%>"
. This means that a 2.0.1 version name will be downloaded to a 2.0.1 folder. DocumentJS will then look for that version'sdocumentjs.json
and run that. -
sites
{Object<String,siteConfig>}
A map of site names and options that configure their behavior.
-
siteDefaults
{siteConfig}
Default values for any sites configs.
Use
A
docConfig
is most commonly found indocumentjs.json
. It configures the behavior of DocumentJS. There are two main behaviors thatdocObject
controls:A complex configuration, like the one used for producing CanJS.com, might looks like:
This configuration will download the listed
versions
into "./<%= version %>/canjs" except for 2.1.4, which be downloaded to "./canjs". Then each version'sdocumentjs.json
will be generated. Finally, all markdown files in_pages
will be generated to ".".