Commit b50435ca authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Implement --no-source option.

Using this option will disable output of source files and
links to source files in UI.
parent a3216ade
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ module JsDuck
  # }
  #
  class ApiExporter
    def initialize(relations)
    def initialize(relations, opts)
      # All params ignored, they're present to be compatible with
      # other exporters.
    end
+4 −2
Original line number Diff line number Diff line
@@ -67,8 +67,10 @@ module JsDuck
        # class-formatting is done in parallel which breaks the links
        # between source files and classes. Therefore it MUST to be done
        # after writing sources which needs the links to work.
        if @opts.source
          source_writer = SourceWriter.new(parsed_files, @parallel)
          source_writer.write(@opts.output_dir + "/source")
        end
        format_classes

        cw = ClassWriter.new(AppExporter, @relations, @opts)
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ module JsDuck
          :localStorageDb => @opts.local_storage_db,
          :showPrintButton => @opts.seo,
          :touchExamplesUi => @opts.touch_examples_ui,
          :source => @opts.source,
        }
      }) + ";\n"
      File.open(filename, 'w') {|f| f.write(js) }
+3 −3
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@ module JsDuck

  # Exports data for Docs app.
  class AppExporter < FullExporter
    def initialize(relations)
      super(relations)
      @renderer = Renderer.new
    def initialize(relations, opts)
      super(relations, opts)
      @renderer = Renderer.new(opts)
    end

    # Returns compacted class data hash which contains an additional
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ module JsDuck
  class ClassWriter
    def initialize(exporter_class, relations, opts)
      @relations = relations
      @exporter = exporter_class.new(relations)
      @exporter = exporter_class.new(relations, opts)
      @parallel = ParallelWrap.new(:in_processes => opts.processes)
    end

Loading