summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIanMadd <imaddaus@chef.io>2020-05-12 10:44:35 -0700
committerIanMadd <imaddaus@chef.io>2020-05-12 11:05:18 -0700
commit3a9fdb7a09db09d173ff76dafbe295abb63c1d0d (patch)
tree7aef318b556c75434154f61b1611581034cede9c
parentb35e79ae6f78fd70d4fcaeb6bbf0e9a56496c15b (diff)
downloadchef-im/warning_note.tar.gz
Add note about origins of resource yaml/md filesim/warning_note
Signed-off-by: IanMadd <imaddaus@chef.io>
-rwxr-xr-xtasks/docs.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb
index f0aff0e32a..7020c3db4e 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -256,6 +256,11 @@ namespace :docs_site do
r = {}
+ # Add a comment at the top stating that the resource yaml/md files are generated from chef/chef
+ r["generate_comment_1"] = "This file is generated from code in https://github.com/chef/chef/"
+ r["generate_comment_2"] = "To recommend changes to this file, make a pull request against"
+ r["generate_comment_3"] = "https://github.com/chef/chef/blob/master/lib/chef/resource/#{name}.rb"
+
# We want all our resources to show up in the main resource reference page
r["resource_reference"] = true
@@ -306,7 +311,7 @@ namespace :docs_site do
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(resource_data.to_yaml + "---") }
+ File.open("docs_site/#{resource}/_index.md", "w") { |f| f.write((resource_data.to_yaml + "---").gsub(/generate_comment_\d:/, '#')) }
end
end
end