diff --git a/ebook-builder.rb b/ebook-builder.rb index fab4ecd..073ef3c 100644 --- a/ebook-builder.rb +++ b/ebook-builder.rb @@ -19,10 +19,11 @@ cfg = {} stack do para "Pick the directory with your document .md files" - para "Save will create and populate and .ebook folder there", - "that you should save at each phase You also need to point", - "to the top level github menu document like Home.md or README.md" - para "You also want to specify a Title" + para "Save will create an populate and .ebook folder there ", + "that you should save at each phase You can also to point ", + "to the top level github menu documents like Home.md if you have them" + para "You do want to specify a Title" + para "Custom icon is optional, but recommended" flow do para "Book Dir:" @ebook_dir = edit_line width: 400 @@ -41,6 +42,13 @@ para "Title " @ebook_title = edit_line width: 400 end + flow do + para "Your icon " + @ebook_icon = edit_line width: 400 + button "Select" do + @ebook_icon.text = ask_open_file + end + end button "Save" do if @ebook_dir.text == nil || @ebook_title == nil || @ebook_menu == nil alert "You are missing something!" @@ -49,6 +57,10 @@ cfg['nested'] = false cfg['input_format'] = 'GFM' cfg['book_title'] = "" + cfg['icon'] = "" + cfg['base_font'] = 'Coolvetica' + cfg['have_nav'] = false + cfg['syntax_highlight'] = false cfg['toc'] = {} cfg['sections'] = {} Dir.mkdir("#{dir}/.ebook") unless Dir.exist?("#{dir}/.ebook") @@ -78,11 +90,14 @@ end end end - cfg['toc']['root'] = File.basename(@ebook_menu.text) + menu_name = @ebook_menu.text + cfg['toc']['root'] = File.basename(menu_name) + cfg['have_nav'] = (menu_name) && (menu_name != '') cfg['toc']['files'] = [] # TODO: may not need cfg['nested'] = true if cfg['sections'].size > 1 cfg['book_title'] = @ebook_title.text - + icon_fl = @ebook_icon.text + cfg['icon'] = (icon_fl && icon_fl != '') ? icon_fl : "#{DIR}/static/app-icon.png" # clean up on aisle 10 - remove toc document tocfn = cfg['toc']['root'] #puts "cleaning find #{tocfn}" diff --git a/kd-render.rb b/kd-render.rb index e06bb30..7449fc9 100644 --- a/kd-render.rb +++ b/kd-render.rb @@ -139,7 +139,7 @@ def highlight_codeblock(el) ##puts h.call(self, el.value, el.attr['class'], :span) #puts syntax_highlighter(self, el.value, el.attr['class'], :span) puts "SB #{el.inspect}" - nil + nil # until it's ready for Shoes to eval it. end def convert_strong(el)