Sha256: 33db836db3dd05c021bd786217abbf1f414ff2ce7cd2229c4c19c3ed0c4d4e5b

Contents?: true

Size: 526 Bytes

Versions: 3

Compression:

Stored size: 526 Bytes

Contents

module GhostWriter
  module Format
    module Markdown
      private
      # TODO: outputのフォーマットを選択可能に
      def headword(text, level = 1)
        "#{'#'*level} #{text}"
      end

      def paragraph(text)
        text + "\n"
      end

      def quote(text, quote_format = nil)
        "```#{quote_format}\n#{text}\n```"
      end

      def list(text, level = 1)
        "#{"  " * (level - 1)}- #{text}"
      end

      def link(text, url)
        "[#{text}](#{url})"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ghost_writer-0.2.0 lib/ghost_writer/format/markdown.rb
ghost_writer-0.1.1 lib/ghost_writer/format/markdown.rb
ghost_writer-0.1.0 lib/ghost_writer/format/markdown.rb