Sha256: fde4a50ada17f8eb80658f5106a3a4d1708211cd52a07d879b18ba99d06db708

Contents?: true

Size: 416 Bytes

Versions: 6

Compression:

Stored size: 416 Bytes

Contents

#!/usr/bin/env ruby

require 'utils/markdown'
include Utils::Markdown
require 'utils/pager'

rendered      = markdown(ARGF.read)
default_pager = ENV['PAGER'].full?
if fallback_pager = `which less`.chomp.full? || `which more`.chomp.full?
  fallback_pager << ' -r'
end
my_pager = default_pager || fallback_pager

Utils::Pager.pager(lines: rendered.count(?\n), command: my_pager) do |output|
  output.puts rendered
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
utils-0.59.2 bin/md
utils-0.59.1 bin/md
utils-0.59.0 bin/md
utils-0.58.0 bin/md
utils-0.57.1 bin/md
utils-0.57.0 bin/md