diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2020-03-07 12:31:35 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2020-03-07 12:41:32 +0100 |
commit | b367c63186bad5fd96400ddeedc34bc7a2537710 (patch) | |
tree | 18c9b46fc0de81f2f5344624f676304883759dfe /Rakefile | |
parent | 74c9bbec2cc159c022e6b561e718cb89fc885716 (diff) |
Add task for converting Readme to Markdown before publishing on npm
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -23,6 +23,19 @@ rescue LoadError => e warn "#{e.path} is not available" end +task :readme2md do + require 'asciidoctor' + require 'pandoc-ruby' + + docbook = Asciidoctor + .load_file('README.adoc', header_footer: true, backend: 'docbook') + .convert + markdown = PandocRuby + .convert(docbook, from: :docbook, to: :markdown_github) + + File.write('README.md', markdown) +end + namespace :build do desc 'Transcompile to JavaScript using Opal' task :js do |