Module: MdTransformer

Defined in:
lib/md_transformer.rb,
lib/md_transformer/version.rb,
lib/md_transformer/markdown.rb,
lib/md_transformer/markdown/section.rb

Overview

Module containing classes relating to parsing and using Markdown content similarly to a hash

Defined Under Namespace

Classes: Error, HeaderTooDeep, InvalidMarkdownPath, Markdown

Constant Summary collapse

VERSION =

Current MdTransformer version

'0.1.0'.freeze

Class Method Summary collapse

Class Method Details

.markdown(content) ⇒ MdTransformer::Markdown Also known as: md

Creates a new Markdown object from given content

Parameters:

  • content (String)

    the markdown content

Returns:


19
20
21
# File 'lib/md_transformer.rb', line 19

def markdown(content)
  Markdown.new(content)
end

.markdown_file(path) ⇒ MdTransformer::Markdown Also known as: md_file

Creates a new Markdown object from a file

Parameters:

  • path (String)

    path to the markdown file to open

Returns:


26
27
28
# File 'lib/md_transformer.rb', line 26

def markdown_file(path)
  Markdown.new(path, file: true)
end