diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-05-01 21:33:06 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-05-01 21:33:06 -0700 |
commit | 5457f106474d6a669f0a4a64232bfdd6b7ae4de5 (patch) | |
tree | 6b16c817384ee4afe7496d303cc3db5be7247e51 /tasks | |
parent | d5f983d514c4581c6f12fab6dec0307e9f4f2ae9 (diff) | |
download | chef-5457f106474d6a669f0a4a64232bfdd6b7ae4de5.tar.gz |
Don't put very long descriptions in the block example
They'll wrap
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-x | tasks/docs.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tasks/docs.rb b/tasks/docs.rb index 5fddc10c79..79c77025d1 100755 --- a/tasks/docs.rb +++ b/tasks/docs.rb @@ -33,10 +33,12 @@ namespace :docs_site do text = "" text << "#{resource_name} 'name' do\n" properties.each do |p| + pretty_default = pretty_default(p["default"]) + text << " #{p["name"].ljust(padding_size)}" text << friendly_types_list(p["is"]) text << " # default value: 'name' unless specified" if p["name_property"] - text << " # default value: #{pretty_default(p["default"])}" unless pretty_default(p["default"]).nil? + text << " # default value: #{pretty_default}" unless pretty_default.nil? || (pretty_default.is_a?(String) && pretty_default.length > 40) # 40 chars is too long for these example blocks text << "\n" end text << " #{"action".ljust(padding_size)}Symbol # defaults to :#{default_action.first} if not specified\n" |