summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-29 16:03:04 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-29 16:20:31 -0700
commit935ff283e56a59d72c3e4f23224dbbf4af252da9 (patch)
treec34af9016a6ce32e9557ce677925488740f75668 /tasks
parent2d553d048ced11d96b2cfe1067e2c7e46f6f3c01 (diff)
downloadchef-935ff283e56a59d72c3e4f23224dbbf4af252da9.tar.gz
Add a skeleton values for actions / examples
We need to extend the data we present via chef and also change the hugo template for the examples, but for now this makes the diff much easier. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/docs.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 22f70be43a..15ca1c61c8 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -153,6 +153,26 @@ namespace :docs_site do
property["default"].to_s
end
+ #
+ # Build the actions section of the resource yaml
+ #
+ # @return [Hash]
+ #
+ def action_list(actions)
+ list = {}
+ actions.each do |action|
+ # skip it so we can make it the last value later
+ next if action == "nothing"
+
+ list[action.to_sym] = { "markdown" => nil }
+ end
+
+ # add the special case for nothing
+ list[:nothing] = { "shortcode" => "resources_common_actions_nothing.md" }
+
+ list
+ end
+
# TODO:
# - what to do about "lazy default" for default?
def properties_list(properties)
@@ -279,7 +299,9 @@ namespace :docs_site do
r["syntax_full_code_block"] = generate_resource_block(name, properties, data["default_action"])
r["syntax_properties_list"] = nil
r["syntax_full_properties_list"] = friendly_full_property_list(name, properties)
+ r["actions_list"] = action_list(data["actions"])
r["properties_list"] = properties_list(properties)
+ r["examples_list"] = nil
r
end