Sha256: cf38679a6d1a39b929ebb3e86596f634153bcb74cac989154d5f350b40c900e5

Contents?: true

Size: 813 Bytes

Versions: 69

Compression:

Stored size: 813 Bytes

Contents

desc "generate document files"
task :doc do
	require 'redcarpet'
	require 'pathname'
	FileList['doc/*.md'].each do |md|
		target = Pathname.new(md)
		header = <<-HEADER
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ja-JP">
<head>
<title>#{target.basename('.md')}</title>
<link href="doc.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
HEADER
		footer = <<-FOOTER
</body>
</html>
FOOTER
		html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :fenced_code_blocks => true).render(File.open(md).read)
		open(target.sub(/\.md\z/, '.html'), 'w') {|f| f.write(header + html + footer)}
	end
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:
# vim: ts=3

Version data entries

69 entries across 58 versions & 1 rubygems

Version Path
tdiary-5.3.0 lib/tdiary/tasks/doc.rake
tdiary-5.2.4 lib/tdiary/tasks/doc.rake
tdiary-5.2.3 lib/tdiary/tasks/doc.rake
tdiary-5.2.2 lib/tdiary/tasks/doc.rake
tdiary-5.2.1 lib/tdiary/tasks/doc.rake
tdiary-5.2.0 lib/tdiary/tasks/doc.rake
tdiary-5.1.7 lib/tdiary/tasks/doc.rake
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/lib/tdiary/tasks/doc.rake
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/lib/tdiary/tasks/doc.rake
tdiary-5.1.6 lib/tdiary/tasks/doc.rake
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-5.1.4/lib/tdiary/tasks/doc.rake
tdiary-5.1.5 lib/tdiary/tasks/doc.rake
tdiary-5.1.4 lib/tdiary/tasks/doc.rake
tdiary-5.1.3 lib/tdiary/tasks/doc.rake
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/lib/tdiary/tasks/doc.rake
tdiary-5.1.2 lib/tdiary/tasks/doc.rake
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/tdiary-5.0.14/lib/tdiary/tasks/doc.rake
tdiary-5.1.1 lib/tdiary/tasks/doc.rake
tdiary-5.1.0 lib/tdiary/tasks/doc.rake
tdiary-5.0.14 lib/tdiary/tasks/doc.rake