Class: YDoc::HtmlBuilder
- Inherits:
-
Object
- Object
- YDoc::HtmlBuilder
- Defined in:
- lib/appcom-ydoc-ruby/html/html_builder.rb
Instance Method Summary collapse
-
#initialize ⇒ HtmlBuilder
constructor
A new instance of HtmlBuilder.
- #to_html(file_or_directory, output_directory, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ HtmlBuilder
Returns a new instance of HtmlBuilder.
8 9 |
# File 'lib/appcom-ydoc-ruby/html/html_builder.rb', line 8 def initialize end |
Instance Method Details
#to_html(file_or_directory, output_directory, options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/appcom-ydoc-ruby/html/html_builder.rb', line 11 def to_html file_or_directory, output_directory, = {} abort 'Pandoc command is not available. Make sure it is installed and added to the path' unless find_executable('pandoc') is_file = File.file?(file_or_directory) && File.exists?(file_or_directory) is_directory = File.directory?(file_or_directory) && File.exists?(file_or_directory) = load_config([:config]) || if is_file file_to_html file_or_directory, output_directory, elsif is_directory Dir["#{file_or_directory}/*.md"].each { |file| file_to_html file, output_directory, } end end |