diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-08-10 14:25:01 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-08-13 11:43:46 -0700 |
commit | 7e206fdfa368594f07d00657bd0cd24765d4e3ad (patch) | |
tree | 0ab134fcd62f0e9cc6da35fb1c62d497e84645a7 /tasks | |
parent | 9009cd9a98c9791616a4eee0ae7d9e7b6ab0f9f1 (diff) | |
download | chef-7e206fdfa368594f07d00657bd0cd24765d4e3ad.tar.gz |
Improve docs generation + update property / action descriptions
Simplify how we remove the sensitive properties so we don't have to do
it multiple times.
Add missing action descriptions
Improve formatting on some property descriptions
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-x | tasks/docs.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb index d12d88130c..2fd92cc40e 100755 --- a/tasks/docs.rb +++ b/tasks/docs.rb @@ -35,8 +35,6 @@ namespace :docs_site do text = "" text << "#{resource_name} 'name' do\n" properties.each do |p| - next if p["name"] == "sensitive" # we don't need to document sensitive twice - pretty_default = pretty_default(p["default"]) text << " #{p["name"].ljust(padding_size)}" @@ -80,6 +78,7 @@ namespace :docs_site do def friendly_property_list(arr) return nil if arr.empty? # resources w/o properties + # create an array of backticked property names for use in markdown. props = arr.map { |x| "`#{x["name"]}`" } # build the text string containing all properties bolded w/ punctuation @@ -142,8 +141,6 @@ namespace :docs_site do # @todo what to do about "lazy default" for default? def properties_list(properties) properties.filter_map do |property| - next if property["name"] == "sensitive" # we don't need to document sensitive twice - default_val = friendly_default_value(property) values = {} @@ -261,7 +258,7 @@ namespace :docs_site do # the main method that builds what will become the yaml file def build_resource_data(name, data) - properties = data["properties"].reject { |v| v["name"] == "name" || v["deprecated"] }.sort_by! { |v| v["name"] } + properties = data["properties"].reject { |v| %w{name sensitive}.include?(v["name"]) || v["deprecated"] }.sort_by! { |v| v["name"] } r = {} |