File: reverse_markdown

package info (click to toggle)
ruby-reverse-markdown 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: ruby: 1,452; makefile: 4
file content (15 lines) | stat: -rwxr-xr-x 600 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env ruby
# Usage: reverse_markdown [FILE]...
# Usage: cat FILE | reverse_markdown
require 'reverse_markdown'
require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: reverse_markdown [options] <file>"

  opts.on('-u', '--unknown_tags [pass_through, drop, bypass, raise]', 'Unknown tag handling (default: pass_through)') { |v| ReverseMarkdown.config.unknown_tags = v }
  opts.on('-g', '--github_flavored bool', 'use github flavored markdown (default: false)') { |v| ReverseMarkdown.config.github_flavored = v }
end.parse!

puts ReverseMarkdown.convert(ARGF.read)