Autodocs
Table of Contents
- Methods
-
Properties
- DOCUMENT_ASSETS
- DOCUMENT_BRANCH
- DOCUMENT_GENERATED_FOLDER
- DOCUMENT_JOB_INDEX
- DOCUMENT_PUBLISH_FOLDER
- DOCUMENT_PUBLISH_FOLDER_ROOT
- DOCUMENT_PUBLISH_SUBFOLDER
- FLAG_CLEAN_DOCUMENT
- FLAG_COPY_ASSETS
- FLAG_LATEST_PAGE
- FLAG_PUBLISH_ON_RELEASE
- FLAG_SKIP_PUSH
- FLAG_STRIP_TOKEN_OUTPUT
- GIT_EMAIL
- GIT_USER
- MAJOR_VERSION
- MINOR_VERSION
- PATCH_VERSION
- PROJECT_DIR
- SELECT_CI
- SELECT_PUBLISH
Methods
init
()
Initialisation step for Autodocs
Used to check/ set any Autodocs environment variables
run
()
Will determine which continuous integration environment and publishing environment to use, and then run those appropriately.
Currently, the supported ones are:
- Continuous Integration (
SELECT_CI
):travis
- Publishing Environment (
SELECT_PUBLISH
):github-pages
Runs various environment variables checks and sets defaults where appropriate. Then tests whether this particular build should trigger publishing the documentation, and if so fires the publish script
Properties
DOCUMENT_ASSETS
String (Environment Variable)
Default: ''
DOCUMENT_BRANCH
String (Environment Variable)
Default: 'master'
DOCUMENT_GENERATED_FOLDER
String (Environment Variable)
Default: 'documentation'
DOCUMENT_JOB_INDEX
String (Environment Variable)
Default: '1'
DOCUMENT_PUBLISH_FOLDER
String (Environment Variable)
Joins DOCUMENT_PUBLISH_FOLDER_ROOT
with DOCUMENT_PUBLISH_SUBFOLDER
to get a concrete path to publish the documentation.
Default: '{{DOCUMENT_PUBLISH_FOLDER_ROOT}}/{{DOCUMENT_PUBLISH_SUBFOLDER}}'
DOCUMENT_PUBLISH_FOLDER_ROOT
String (Environment Variable)
All documentation will be published under this root directory
This can be used for non-version-specific documentation
Default: 'api'
DOCUMENT_PUBLISH_SUBFOLDER
String (Environment Variable)
The documentation will be published in this subdirectory of the root directory.
This can be used for version-specific documentation
Default: '{{MAJOR_VERSION}}.{{MINOR_VERSION}}'
FLAG_CLEAN_DOCUMENT
String (Environment Variable)
Default: 'false'
FLAG_COPY_ASSETS
String (Environment Variable)
Default: 'false'
FLAG_LATEST_PAGE
String (Environment Variable)
By default, this will publish a latest pages, whose purpose is simply to redirect to the most recently publish API version
Assuming default values for other configurations,
if the version of the project is currently 1.2.3
,
http://USER.github.io/REPO/api/latest/
- This URL will be published with an
index.html
file that redirects to: http://USER.github.io/REPO/api/1.2/
Set to false
to disable this behaviour.
Default: 'true'
FLAG_PUBLISH_ON_RELEASE
String (Environment Variable)
Default: 'false'
FLAG_SKIP_PUSH
String (Environment Variable)
Set to false to do all of the steps in publishing, except for the final step of pushing the changes to the git remote.
This is useful for testing and debugging purposes. Leaving this on in a CI environment would defeat the purpose of autodocs
Default: 'false'
FLAG_STRIP_TOKEN_OUTPUT
String (Environment Variable)
Default: 'true'
GIT_EMAIL
String (Environment Variable)
Default: 'autodocs-git-user@bguiz.com'
GIT_USER
String (Environment Variable)
Default: 'autodocs Git User'
MAJOR_VERSION
String (Environment Variable)
Default: The major version read in from package.json
MINOR_VERSION
String (Environment Variable)
Default: The minor version read in from package.json
PATCH_VERSION
String (Environment Variable)
Default: The patch version read in from package.json
PROJECT_DIR
String (Environment Variable)
Default: The current working directory
SELECT_CI
String (Environment Variable)
Default: 'travis'
SELECT_PUBLISH
String (Environment Variable)
Default: 'github-pages'