Sha256: 40d3be2dbe6cf2f6260677ad76bb0909586ca7cd8c1abe94ef836d7b1327d69c
Contents?: true
Size: 1.24 KB
Versions: 4
Compression:
Stored size: 1.24 KB
Contents
require 'jsduck/util/json' require 'jsduck/icons' require 'jsduck/search_data' require 'jsduck/meta_tag_registry' module JsDuck # Creates big JS file with data for Docs app. class AppData def initialize(relations, assets, opts) @relations = relations @assets = assets @opts = opts end # Writes classes, guides, videos, and search data to one big .js file def write(filename) js = "Docs = " + Util::Json.generate({ :data => { :classes => Icons.new.create(@relations.classes), :guides => @assets.guides.to_array, :videos => @assets.videos.to_array, :examples => @assets.examples.to_array, :search => SearchData.new.create(@relations.classes, @assets), :tests => @opts.tests, :signatures => MetaTagRegistry.instance.signatures, :localStorageDb => @opts.local_storage_db, :showPrintButton => @opts.seo, :touchExamplesUi => @opts.touch_examples_ui, :source => @opts.source, :commentsUrl => @opts.comments_url, :commentsDomain => @opts.comments_domain, :message => @opts.message, } }) + ";\n" File.open(filename, 'w') {|f| f.write(js) } end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
jsduck-4.9.0 | lib/jsduck/app_data.rb |
jsduck-4.8.0 | lib/jsduck/app_data.rb |
jsduck-4.7.1 | lib/jsduck/app_data.rb |
jsduck-4.7.0 | lib/jsduck/app_data.rb |