summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-11-19 11:34:28 -0800
committerTim Smith <tsmith84@gmail.com>2020-11-19 11:34:28 -0800
commit3763e58a059f14cdc9a2157c7e199c4d13f0cb63 (patch)
treec43b3fb22d3d3b606cb6ec67f77687ce5ee47a38 /tasks
parentf6316a8d798c9a66fd0e87a71ce5e774c5b07158 (diff)
downloadchef-3763e58a059f14cdc9a2157c7e199c4d13f0cb63.tar.gz
Update the docs generation for the new format
The format has been simplified so we can remove some of the logic from our generation scripts. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/docs.rb19
1 files changed, 1 insertions, 18 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 8988b7486f..efb0d5420f 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -114,17 +114,6 @@ namespace :docs_site do
fixed_arr.compact.join(", ")
end
- # build the menu entry for this resource
- def build_menu_item(name)
- {
- "infra" => {
- "title" => name,
- "identifier" => "chef_infra/cookbook_reference/resources/#{name} #{name}",
- "parent" => "chef_infra/cookbook_reference/resources",
- },
- }
- end
-
# print out the human readable form of the default
def friendly_default_value(property)
return "The resource block's name" if property["name_property"]
@@ -274,10 +263,7 @@ namespace :docs_site do
# These properties are set to special values for only a few resources.
r.merge!(special_properties(name))
- r["title"] = "#{name} resource"
r["resource"] = name
- r["aliases"] = ["/resource_#{name}.html"]
- r["menu"] = build_menu_item(name)
r["resource_description_list"] = build_description(name, data["description"])
r["resource_new_in"] = data["introduced"] unless data["introduced"].nil?
r["syntax_full_code_block"] = generate_resource_block(name, properties, data["default_action"])
@@ -310,10 +296,7 @@ namespace :docs_site do
pp resource_data
else
puts "Writing out #{resource}."
- FileUtils.mkdir_p "docs_site/#{resource}"
- # write out the yaml contents of the hash and append a --- since this is actually a yaml
- # block in the middle of a markdown page and the block needs an ending
- File.open("docs_site/#{resource}/_index.md", "w") { |f| f.write(YAML.dump(resource_data) + "---") }
+ File.open("docs_site/#{resource}.yaml", "w") { |f| f.write(YAML.dump(resource_data)) }
end
end
end