Sha256: e4afa4cdc05a9ef962c62e1e60e722a154c6c8e7f6c866ba31e8942d034fec31
Contents?: true
Size: 977 Bytes
Versions: 2
Compression:
Stored size: 977 Bytes
Contents
module GhostWriter module Format module Rst private def extname "rst" end def headword(text, level = 1) char = case level when 1 "*" when 2 "=" when 3 "-" when 4 "^" end text + "\n" + char * text.length * 2 end def paragraph(text) text + "\n" end def separator(length) "" end def quote(text, quote_format = nil) if quote_format marker = ".. code-block:: #{quote_format}" + "\n" else marker = "::" + "\n" end marker + "#{text.each_line.map{|line| line.chomp.empty? ? line : " " + line}.join}" end def list(text, level = 1) "#{" " * (level - 1)}* #{text}" end def link(text, url) "`#{text} #{url}`_" end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ghost_writer-0.4.1 | lib/ghost_writer/format/rst.rb |
ghost_writer-0.4.0 | lib/ghost_writer/format/rst.rb |