Class: BayeuxFilter

Inherits:
Nanoc3::Filter
  • Object
show all
Defined in:
lib/filters/bayeux.rb

Instance Method Summary collapse

Instance Method Details

#run(content, params = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/filters/bayeux.rb', line 11

def run(content, params={})
  syntax_tree = Bayeux.new
  syntax_tree.parse(content)
  
  # Update the master reference list
  # using the data in the 'new' AST
  $reference.update(syntax_tree)
  
  #puts syntax_tree.to_s
  #text_gen = BayeuxTextGen.new(syntax_tree)
  #puts "---"
  #puts syntax_tree.to_s
  #puts "---"
  
  puts "---"
  puts JSON.pretty_generate(syntax_tree)
  puts "---"
  
  
  #latex_gen = BayeuxLatexGen.new(syntax_tree)
  #puts "---"
  #puts latex_gen.generate
  #puts "---"
  
  
  html_gen = BayeuxHTMLGen.new(syntax_tree)
  
  # Get the document ToC from the AST (as HTML)
  @item[:toc] = html_gen.doc_toc
  
  # Return the AST rendered in HTML 
  return html_gen.generate
end