kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/web/site/doc_header.rb (about) 1 #!/usr/bin/ruby 2 require 'asciidoctor' 3 4 input = Asciidoctor.load_file(ARGV[0]) 5 File.open(ARGV[1], "w") { |out| 6 out.puts "---" 7 out.puts "layout: page" 8 out.puts ["title: ", input.doctitle].join 9 out.puts ["priority: ", input.attributes["priority"]].join 10 out.puts ["toclevels: ", input.attributes["toclevels"]].join 11 if input.attributes["toc"] != nil || input.attributes["toc2"] != nil 12 out.puts "toc: true" 13 end 14 out.puts "---" 15 }