lib/jsduck/web/writer.rb in jsduck-5.3.4 vs lib/jsduck/web/writer.rb in jsduck-6.0.0beta

- old
+ new

@@ -6,10 +6,11 @@ require 'jsduck/web/template' require 'jsduck/web/index_html' require 'jsduck/web/data' require 'jsduck/web/css' require 'jsduck/web/source' +require 'jsduck/web/class_icons' require 'jsduck/web/member_icons' require 'fileutils' module JsDuck module Web @@ -26,11 +27,11 @@ def write clean_output_dir write_template_files - write_member_icons + write_icons write_html_files # class-formatting is done in parallel which breaks the links # between source files and classes. Therefore it MUST to be done @@ -52,45 +53,46 @@ # Copy over template files def write_template_files Web::Template.new(@opts).write end - # Copy over member icons - def write_member_icons - Web::MemberIcons.write(@opts.output_dir+"/member-icons") + # Copy over class and member icons + def write_icons + Web::ClassIcons.write(@opts.output+"/class-icons") + Web::MemberIcons.write(@opts.output+"/member-icons") end # Generate data.js and styles.css. # Then generate HTML files, linking to the data.js and styles.css from them. def write_html_files # Remember the MD5-fingerprinted filenames paths = { - :data => Web::Data.new(@relations, @assets, @opts).write(@opts.output_dir+"/data.js"), - :css => Web::Css.new(@opts).write(@opts.output_dir+"/styles.css"), + :data => Web::Data.new(@relations, @assets, @opts).write(@opts.output+"/data.js"), + :css => Web::Css.new(@opts).write(@opts.output+"/styles.css"), } Web::IndexHtml.new(@assets, @opts, paths).write end def write_source source_writer = Web::Source.new(@parsed_files) - source_writer.write(@opts.output_dir + "/source") + source_writer.write(@opts.output + "/source") end def format_classes Format::Batch.format_all!(@relations, @assets, @opts) end def write_inline_examples examples = InlineExamples.new examples.add_classes(@relations) examples.add_guides(@assets.guides) - examples.write(@opts.output_dir+"/inline-examples.js") + examples.write(@opts.output+"/inline-examples.js") end def write_classes class_writer = ClassWriter.new(Exporter::App, @relations, @opts) - class_writer.write(@opts.output_dir+"/output", ".js") + class_writer.write(@opts.output+"/output", ".js") end end end