Skip to content

Commit

Permalink
add metadata to markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
arlimus committed Sep 20, 2016
1 parent 59673f5 commit 19358d0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions tasks/docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def p(msg)
def suffix
'.md'
end

def meta(opts)
o = opts.map { |k, v| "#{k}: #{v}" }.join("\n")
"---\n#{o}\n---\n\n"
end
end
end

Expand Down Expand Up @@ -91,16 +96,21 @@ def p(msg)
def suffix
'.rst'
end

def meta(o)
'' # ignore for now
end
end
end

namespace :docs do
desc 'Create cli docs'
task :cli do
f = RST
res = f.h1('InSpec CLI') +
f.p('Use the InSpec CLI to run tests and audits against targets '\
'using local, SSH, WinRM, or Docker connections.')
res = f.meta(title: 'About the InSpec CLI')
res << f.h1('InSpec CLI') +
f.p('Use the InSpec CLI to run tests and audits against targets '\
'using local, SSH, WinRM, or Docker connections.')

require 'inspec/cli'
cmds = Inspec::InspecCLI.all_commands
Expand Down

0 comments on commit 19358d0

Please sign in to comment.