summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2020-03-07 12:31:35 +0100
committerJakub Jirutka <jakub@jirutka.cz>2020-03-07 12:41:32 +0100
commitb367c63186bad5fd96400ddeedc34bc7a2537710 (patch)
tree18c9b46fc0de81f2f5344624f676304883759dfe /Rakefile
parent74c9bbec2cc159c022e6b561e718cb89fc885716 (diff)
Add task for converting Readme to Markdown before publishing on npm
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 46dd4bd..46842bf 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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