diff options
author | James Turnbull <james@lovedthanlost.net> | 2010-08-12 08:36:28 +1000 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-08-11 22:14:40 -0700 |
commit | fef8800acaddd54659602b65bd9fdc728d187c67 (patch) | |
tree | 9da2ca2df36de60678b6d7e0cc37163aa0aebe3c /lib/puppet/util/docs.rb | |
parent | 79e0a2e5c9e2f654c0f7ed37e1bf3342a54e4525 (diff) | |
download | puppet-fef8800acaddd54659602b65bd9fdc728d187c67.tar.gz puppet-fef8800acaddd54659602b65bd9fdc728d187c67.tar.xz puppet-fef8800acaddd54659602b65bd9fdc728d187c67.zip |
Updated reference output to generate valid Markdown
Diffstat (limited to 'lib/puppet/util/docs.rb')
-rw-r--r-- | lib/puppet/util/docs.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb index efd054d85..1746ef3fc 100644 --- a/lib/puppet/util/docs.rb +++ b/lib/puppet/util/docs.rb @@ -47,25 +47,19 @@ module Puppet::Util::Docs lengths[i] = value.to_s.length if value.to_s.length > lengths[i] end - # Add the top header row - str += lengths.collect { |num| "=" * num }.join(" ") + "\n" + # Add the header names + str += headers.zip(lengths).collect { |value, num| pad(value, num) }.join(" | ") + " |" + "\n" - # And the header names - str += headers.zip(lengths).collect { |value, num| pad(value, num) }.join(" ") + "\n" - - # And the second header row - str += lengths.collect { |num| "=" * num }.join(" ") + "\n" + # And the header row + str += lengths.collect { |num| "-" * num }.join(" | ") + " |" + "\n" # Now each data row data.sort { |a, b| a[0].to_s <=> b[0].to_s }.each do |name, rows| str += [name, rows].flatten.zip(lengths).collect do |value, length| pad(value, length) - end.join(" ") + "\n" + end.join(" | ") + " |" + "\n" end - # And the bottom line row - str += lengths.collect { |num| "=" * num }.join(" ") + "\n" - str + "\n" end |