Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bolt/config/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ module Options
description: "A list of module dependencies for the project. Each dependency is a map of data specifying " \
"the module to install. To install the project's module dependencies, run the `bolt module " \
"install` command. For more information about specifying modules, see [the " \
"documentation](https://docs.openvoxproject.org/openbolt/latest/bolt_installing_modules.html#manually-specify-modules-in-a-bolt-project).",
"documentation](bolt_installing_modules.md#manually-specify-modules-in-a-bolt-project).",
type: Array,
items: {
type: [Hash, String],
Expand Down
2 changes: 1 addition & 1 deletion lib/bolt/inventory/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module Options
"plugin_hooks" => {
description: "Configuration for the Puppet library plugin used to install the " \
"Puppet agent on the target. For more information, see " \
"https://docs.openvoxproject.org/openbolt/latest/writing_plugins.html",
"[plugin hooks](writing_plugins.md#plugin-hooks).",
type: Hash,
properties: {
"puppet_library" => {
Expand Down
14 changes: 12 additions & 2 deletions rakelib/docs.rake
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ begin
$stdout.puts "Generated packaged modules at:\n\t#{filepath}"
end

# CLI help text carries full docs URLs, because it is printed to a terminal
# where a relative link has nothing to resolve against. Inside the docs
# collection the same text must use relative links, so that a locally served
# build works offline and a page in an older collection does not silently
# follow '/latest/' across a version boundary.
docs_url = %r{https://docs\.openvoxproject\.org/openbolt/latest/(\S+?\.html(?:\#[\w-]+)?)}
relative_docs_links = lambda do |text|
text.gsub(docs_url) { "[#{Regexp.last_match(1)}](#{Regexp.last_match(1)})" }
end

desc "Generate markdown docs for Bolt shell commands"
task :command_reference do
require 'bolt/bolt_option_parser'
Expand All @@ -172,11 +182,11 @@ begin
short: switch.short.first,
long: switch.long.first,
arg: switch.arg,
desc: switch.desc.map { |d| d.gsub("<", "&lt;") }.join("<p>")
desc: relative_docs_links.call(switch.desc.map { |d| d.gsub("<", "&lt;") }.join("<p>"))
}
end

desc = matches[:desc].split("\n").map(&:strip).join("\n")
desc = relative_docs_links.call(matches[:desc].split("\n").map(&:strip).join("\n"))
usage = matches[:usage].strip

@commands[command] = {
Expand Down
2 changes: 1 addition & 1 deletion schemas/bolt-inventory.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1854,7 +1854,7 @@
]
},
"plugin_hooks": {
"description": "Configuration for the Puppet library plugin used to install the Puppet agent on the target. For more information, see https://docs.openvoxproject.org/openbolt/latest/writing_plugins.html",
"description": "Configuration for the Puppet library plugin used to install the Puppet agent on the target. For more information, see [plugin hooks](writing_plugins.md#plugin-hooks).",
"oneOf": [
{
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion schemas/bolt-project.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
}
},
"modules": {
"description": "A list of module dependencies for the project. Each dependency is a map of data specifying the module to install. To install the project's module dependencies, run the `bolt module install` command. For more information about specifying modules, see [the documentation](https://docs.openvoxproject.org/openbolt/latest/bolt_installing_modules.html#manually-specify-modules-in-a-bolt-project).",
"description": "A list of module dependencies for the project. Each dependency is a map of data specifying the module to install. To install the project's module dependencies, run the `bolt module install` command. For more information about specifying modules, see [the documentation](bolt_installing_modules.md#manually-specify-modules-in-a-bolt-project).",
"type": "array",
"items": {
"type": [
Expand Down
Loading