kit-doc edge

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.

Class methods 8


Link to this section Class methods 8

Link to this method

.create_rake_task_documentation_all_versions!(config:, task_namespace: 'documentation:all_versions')

View Source

Create various rake tasks to generate documentation and various assets for versions specified in config[:all_versions].

Link to this method

.create_rake_task_documentation_all_versions_docs_config!(config:, task_name: 'documentation:all_versions:generate:docs_config')

View Source

Create a rake task to generate a docs_config.js file with all versions specified in config[:all_versions].

Link to this method

.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 Source

Create a rake task to generate documentation for versions specified in config[:all_versions].

Link to this method

.create_rake_task_documentation_all_versions_index!(config:, task_name: 'documentation:all_versions:generate:index')

View Source

Create a rake task to generate an index.html file redirecting to the first version in config[:all_versions].

Link to this method

.create_rake_task_documentation_generate!(config:, task_name: 'documentation:generate', clean_output_dir: false)

View Source

Create a yard rake task used to generate documentation for the current version of a project, using Kit::Doc::Yard setup.

  • :config - A Kit::Doc config object.

  • :task_name - The name of the rake task. Defaults to 'documentation:generate'.

  • :clean_output_dir - If true, it will run a recursive remove inside :output_dir_current_version/*. Defaults to false as it is potentially dangerous.

Link to this method

.generate_docs_config(config:, semver_regex: Kit::Doc::Services::Config::SEMVER_REGEX)

View Source

Generate 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)
  }
]
Link to this method

.generate_documentation_all_versions(config:, task_name_generate: 'documentation:generate', before_version: nil, after_version: nil)

View Source

Run rake documentation:generate for all config[:all_versions] after checking out the git reference.

Link to this method

.generate_html_redirect_file(dst:, title:, redirect_url:)

View Source

Generate a html redirect file.

  • :dst - Absolute path for the new file.

  • :title - Html title.

  • :redirect_url - The url to redirect to.