Tasks
module
Kit::Doc::Services::Tasks
View Source
Methods to add documentation Rake tasks to projects.
Link to this section Summary ⚠️ Private APIs are currently hidden.
Link to this section Class methods 8
.create_rake_task_documentation_all_versions!(config:, task_namespace: 'documentation:all_versions')
View SourceCreate various rake tasks to generate documentation and various assets for versions specified in config[:all_versions].
.create_rake_task_documentation_all_versions_docs_config!(config:, task_name: 'documentation:all_versions:generate:docs_config')
View SourceCreate a rake task to generate a docs_config.js file with all versions specified in config[:all_versions].
.create_rake_task_documentation_all_versions_generate!(config:, task_name: 'documentation:all_versions:generate', task_name_generate: 'documentation:generate', task_name_docs_config: 'documentation:all_versions:generate:docs_config', task_name_index: 'documentation:all_versions:generate:index')
View SourceCreate a rake task to generate documentation for versions specified in config[:all_versions].
.create_rake_task_documentation_all_versions_index!(config:, task_name: 'documentation:all_versions:generate:index')
View SourceCreate a rake task to generate an index.html file redirecting to the first version in config[:all_versions].
.create_rake_task_documentation_generate!(config:, task_name: 'documentation:generate', clean_output_dir: false)
View SourceCreate a yard rake task used to generate documentation for the current version of a project, using Kit::Doc::Yard setup.
:config- AKit::Docconfig object.:task_name- The name of the rake task. Defaults to 'documentation:generate'.:clean_output_dir- Iftrue, it will run a recursive remove inside:output_dir_current_version/*. Defaults tofalseas it is potentially dangerous.
.generate_docs_config(config:, semver_regex: Kit::Doc::Services::Config::SEMVER_REGEX)
View SourceGenerate a docs_config.js file for all versions in config[:all_versions].
docs_config.js
This file is used as cheap way to provide the documentation js logic the list of all known documentation versions.
A default one is added when generating documentation for a given version, and can then be overwriten by the version generated here.
versionNodes
This global JavaScript variable should be providing an array of objects that define all versions of this project which should appear in the project versions dropdown in the documentation sidebar. The versions dropdown allows # for switching between package versions' documentation.
Example:
var versionNodes = [
{
version: "v0.1.0", // version number or name (required)
url: "https://docs.rubykit.org/kit-doc/0.1.0/" // documentation URL (required)
}
]
.generate_documentation_all_versions(config:, task_name_generate: 'documentation:generate', before_version: nil, after_version: nil)
View SourceRun rake documentation:generate for all config[:all_versions] after checking out the git reference.
Generate a html redirect file.
:dst- Absolute path for the new file.:title- Html title.:redirect_url- The url to redirect to.