Sha256: 57d50e0ca1dcb56c73488e9d5ab67d678657f0df885bb817deb33f8f26f80cb7
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
require 'jsduck/json_duck' require 'jsduck/icons' require 'jsduck/search_data' require 'jsduck/stats' require 'jsduck/meta_tag_registry' module JsDuck # Creates big JS file with data for Docs app. class AppData attr_accessor :guides attr_accessor :videos attr_accessor :examples def initialize(relations, opts) @relations = relations @opts = opts end # Writes classes, guides, videos, and search data to one big .js file def write(filename) js = "Docs = " + JsonDuck.generate({ :data => { :classes => Icons.new.create(@relations.classes), :guides => @guides.to_array, :videos => @videos.to_array, :examples => @examples.to_array, :search => SearchData.new.create(@relations.classes), :stats => @opts.stats ? Stats.new.create(@relations.classes) : [], :signatures => MetaTagRegistry.instance.signatures, :localStorageDb => @opts.local_storage_db, :showPrintButton => @opts.seo, :touchExamplesUi => @opts.touch_examples_ui, } }) + ";\n" File.open(filename, 'w') {|f| f.write(js) } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
jsduck-3.3.1 | lib/jsduck/app_data.rb |
jsduck-3.3.0 | lib/jsduck/app_data.rb |
jsduck-3.2.1 | lib/jsduck/app_data.rb |