# File lib/puppet/util/reference.rb, line 66
66:     def self.markdown(name, text)
67:         puts "Creating markdown for #{name} reference."
68:         dir = "/tmp/" + Puppet::PUPPETVERSION
69:         FileUtils.mkdir(dir) unless File.directory?(dir) 
70:         File.open(dir + "/" + "#{name}.rst", "w") do |f|
71:             f.puts text
72:         end
73:         pandoc = %x{which pandoc}
74:         if $? != 0 or pandoc =~ /no /
75:             pandoc = %x{which pandoc}
76:         end
77:         if $? != 0 or pandoc =~ /no /
78:             raise "Could not find pandoc"
79:         end
80:         pandoc.chomp!
81:         cmd = %{#{pandoc} -s -r rst -w markdown #{dir}/#{name}.rst -o #{dir}/#{name}.mdwn}
82:         output = %x{#{cmd}}
83:         unless $? == 0
84:             $stderr.puts "Pandoc failed to create #{name} reference."
85:             $stderr.puts output
86:             exit(1)
87:         end
88:  
89:         File.unlink(dir + "/" + "#{name}.rst")
90:     end