Sha256: 6d6480b6837d35512973e64d56b1ef8ed894c793a0def6332615478f14742321

Contents?: true

Size: 414 Bytes

Versions: 5

Compression:

Stored size: 414 Bytes

Contents

# frozen_string_literal: true

require "github/markup"

module MDV
  # Markdown document class
  class Document
    def initialize(file)
      @file = file
    end

    def base_uri
      @base_uri ||= "file://#{fullpath}"
    end

    def html
      GitHub::Markup.render(fullpath, File.read(fullpath))
    end

    private

    def fullpath
      @fullpath ||= File.expand_path(@file, Dir.pwd)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mdv-0.8.0 lib/mdv/document.rb
mdv-0.7.0 lib/mdv/document.rb
mdv-0.6.0 lib/mdv/document.rb
mdv-0.5.1 lib/mdv/document.rb
mdv-0.5.0 lib/mdv/document.rb