diff options
Diffstat (limited to 'lib/tasks/gitlab/banzai.rake')
-rw-r--r-- | lib/tasks/gitlab/banzai.rake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/banzai.rake b/lib/tasks/gitlab/banzai.rake new file mode 100644 index 00000000000..b1c7e4ea519 --- /dev/null +++ b/lib/tasks/gitlab/banzai.rake @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +namespace :gitlab do + namespace :banzai do + desc 'GitLab | Banzai | Render markdown using our FullPipeline (input will be requested)' + task render: :environment do |_t| + markdown = [] + + puts "\nEnter markdown below, Ctrl-D to end (if you need blank lines, paste in the full text):" + while buf = Readline.readline('', true) + markdown << buf + end + + puts "Rendering using Gitlab's FullPipeline...\n\n" + + html = MarkupHelper.markdown(markdown.join("\n"), { pipeline: :full, project: nil }) + puts html.gsub('
', "\n") + end + end +end |