Class: Wikisys::Controller
- Inherits:
-
Object
- Object
- Wikisys::Controller
- Defined in:
- lib/wikisys.rb
Instance Method Summary collapse
- #import_mw(obj) ⇒ Object
-
#initialize(filepath: '.') ⇒ Controller
constructor
A new instance of Controller.
Constructor Details
#initialize(filepath: '.') ⇒ Controller
Returns a new instance of Controller.
553 554 555 556 557 558 |
# File 'lib/wikisys.rb', line 553 def initialize(filepath: '.') @filepath = filepath @pages = Pages.new filepath end |
Instance Method Details
#import_mw(obj) ⇒ Object
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 |
# File 'lib/wikisys.rb', line 560 def import_mw(obj) s, _ = RXFReader.read(obj) @mw = MindWords.new(s) FileX.write 'outline.txt', @mw.to_outline FileX.mkdir_p 'md' FileX.mkdir_p 'html' @mw.to_words.each do |title, attributes| , = attributes.values s = "# %s\n\n\n" % title.capitalize2 s += '+ ' + if .strip.length > 0 file = File.join(@filepath, 'md', title.capitalize2.gsub(/ +/,'-') \ + '.md') if not File.exists?(file) then pg.new_md(file, s) end end #gen_html_files() gen_sidenav() end |