Module: Marko

Defined in:
lib/marko.rb,
lib/marko/cli.rb,
lib/marko/config.rb,
lib/marko/loader.rb,
lib/marko/markup.rb,
lib/marko/parser.rb,
lib/marko/storage.rb,
lib/marko/version.rb,
lib/marko/artifact.rb,
lib/marko/compiler.rb,
lib/marko/assembler.rb,
lib/marko/tree_node.rb,
lib/marko/validator.rb,
lib/marko/markup/macro.rb,
lib/marko/markup/parser.rb,
lib/marko/gadgets/sentry.rb,
lib/marko/markup/storage.rb,
lib/marko/gadgets/service.rb,
lib/marko/markup/compiler.rb,
lib/marko/markup/decorator.rb,
lib/marko/markup/validator.rb,
lib/marko/services/compile.rb,
lib/marko/gadgets/pluggable.rb,
lib/marko/services/assemble.rb

Defined Under Namespace

Modules: CLI, Markup, Pluggable, Sentry, Services Classes: Artifact, Assembler, Compiler, Loader, Parser, Service, Storage, TreeNode, Validator

Constant Summary collapse

ParserPlug =

default abstract starters that must be replugged later

Parser.plug
StoragePlug =
Storage.plug
CompilerPlug =
Compiler.plug
ValidatorPlug =
Validator.plug
MacroProcPlug =
TODO:

let Decorator know

ParserPlug = Markup::Parser.plug StoragePlug = Markup::Storage.plug

Markup::MacroProcessor.plug
VERSION =
"0.3.0"
NULLFACT =
Artifact.new("Artifact",
"tt/default.md.tt", "bin/artifact.md") .freeze
MustbeString =
Sentry.new(:key, "must be String"
) {|v| v.is_a? String}
MustbeTreeNode =
Sentry.new(:key, "must be TreeNode"
) {|v| v.is_a? TreeNode}

Class Method Summary collapse

Class Method Details

.artifactObject



15
16
17
18
# File 'lib/marko/config.rb', line 15

def self.artifact
  storage = StoragePlug.plugged
  storage.artifact
end

.assemble(&block) ⇒ Object

helper method for assemblage



34
35
36
# File 'lib/marko.rb', line 34

def assemble(&block)
  Services::Assemble.(&block)
end

.compile(tree: nil, template: '', filename: '', &block) ⇒ Object

helper method for compilation



40
41
42
43
# File 'lib/marko.rb', line 40

def compile(tree: nil, template: '', filename: '', &block)
  Services::Compile.(
    tree: tree, template: template, filename: filename, &block)
end

.demoObject



24
25
26
# File 'lib/marko.rb', line 24

def demo
  File.join(root, 'lib', 'assets', 'demo')
end

.rootObject



20
21
22
# File 'lib/marko.rb', line 20

def root
  File.dirname __dir__
end

.samplesObject



28
29
30
# File 'lib/marko.rb', line 28

def samples
  File.join(root, 'lib', 'assets', 'samples')
end