jsduck 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/jsduck.gemspec +2 -2
- data/lib/jsduck/aggregator.rb +13 -0
- data/lib/jsduck/app.rb +1 -0
- data/lib/jsduck/app_data.rb +1 -8
- data/lib/jsduck/app_exporter.rb +0 -2
- data/lib/jsduck/assets.rb +2 -4
- data/lib/jsduck/class.rb +34 -5
- data/lib/jsduck/class_formatter.rb +2 -2
- data/lib/jsduck/doc_parser.rb +0 -2
- data/lib/jsduck/examples.rb +0 -8
- data/lib/jsduck/grouped_asset.rb +11 -4
- data/lib/jsduck/guides.rb +22 -16
- data/lib/jsduck/icons.rb +1 -11
- data/lib/jsduck/logger.rb +3 -0
- data/lib/jsduck/merger.rb +5 -2
- data/lib/jsduck/meta_tag_registry.rb +29 -3
- data/lib/jsduck/options.rb +5 -2
- data/lib/jsduck/renderer.rb +0 -2
- data/lib/jsduck/search_data.rb +8 -12
- data/lib/jsduck/tag/hide.rb +18 -0
- data/lib/jsduck/tag/ignore.rb +13 -0
- data/lib/jsduck/tag/private.rb +20 -0
- data/lib/jsduck/videos.rb +0 -8
- metadata +8 -4
data/jsduck.gemspec
CHANGED
@@ -2,8 +2,8 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.required_rubygems_version = ">= 1.3.5"
|
3
3
|
|
4
4
|
s.name = 'jsduck'
|
5
|
-
s.version = '3.
|
6
|
-
s.date = '2012-02-
|
5
|
+
s.version = '3.6.0'
|
6
|
+
s.date = '2012-02-20'
|
7
7
|
s.summary = "Simple JavaScript Duckumentation generator"
|
8
8
|
s.description = "Documentation generator for Sencha JS frameworks"
|
9
9
|
s.homepage = "https://github.com/senchalabs/jsduck"
|
data/lib/jsduck/aggregator.rb
CHANGED
@@ -118,6 +118,9 @@ module JsDuck
|
|
118
118
|
# Items without @member belong by default to the preceding class.
|
119
119
|
# When no class precedes them - they too are orphaned.
|
120
120
|
def add_member(node)
|
121
|
+
# Completely ignore member if @ignore used
|
122
|
+
return if node[:meta][:ignore]
|
123
|
+
|
121
124
|
if node[:owner]
|
122
125
|
if @classes[node[:owner]]
|
123
126
|
add_to_class(@classes[node[:owner]], node)
|
@@ -191,6 +194,16 @@ module JsDuck
|
|
191
194
|
})
|
192
195
|
end
|
193
196
|
|
197
|
+
# Gets rid of classes marked with @ignore
|
198
|
+
def remove_ignored_classes
|
199
|
+
@documentation.delete_if do |cls|
|
200
|
+
if cls[:meta][:ignore]
|
201
|
+
@classes.delete(cls["name"])
|
202
|
+
true
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
194
207
|
# Appends Ext4 options parameter to each event parameter list.
|
195
208
|
# But only when we are dealing with Ext4 codebase.
|
196
209
|
def append_ext4_event_options
|
data/lib/jsduck/app.rb
CHANGED
data/lib/jsduck/app_data.rb
CHANGED
@@ -24,7 +24,7 @@ module JsDuck
|
|
24
24
|
:examples => @assets.examples.to_array,
|
25
25
|
:search => SearchData.new.create(@relations.classes),
|
26
26
|
:stats => @opts.stats ? Stats.new.create(@relations.classes) : [],
|
27
|
-
:signatures => signatures,
|
27
|
+
:signatures => MetaTagRegistry.instance.signatures,
|
28
28
|
:localStorageDb => @opts.local_storage_db,
|
29
29
|
:showPrintButton => @opts.seo,
|
30
30
|
:touchExamplesUi => @opts.touch_examples_ui,
|
@@ -33,13 +33,6 @@ module JsDuck
|
|
33
33
|
File.open(filename, 'w') {|f| f.write(js) }
|
34
34
|
end
|
35
35
|
|
36
|
-
def signatures
|
37
|
-
sigs = MetaTagRegistry.instance.signatures
|
38
|
-
# Inject private to meta tag signatures list
|
39
|
-
sigs << {:key => 'private', :long => 'private', :short => 'PRI'}
|
40
|
-
sigs
|
41
|
-
end
|
42
|
-
|
43
36
|
end
|
44
37
|
|
45
38
|
end
|
data/lib/jsduck/app_exporter.rb
CHANGED
data/lib/jsduck/assets.rb
CHANGED
@@ -28,20 +28,18 @@ module JsDuck
|
|
28
28
|
|
29
29
|
@images = Images.new(@opts.images)
|
30
30
|
@welcome = Welcome.create(@opts.welcome)
|
31
|
-
@guides = Guides.create(@opts.guides, DocFormatter.new(@relations, @opts))
|
31
|
+
@guides = Guides.create(@opts.guides, DocFormatter.new(@relations, @opts), @opts)
|
32
32
|
@videos = Videos.create(@opts.videos)
|
33
33
|
@examples = Examples.create(@opts.examples, @opts)
|
34
34
|
@categories = Categories.create(@opts.categories_path, DocFormatter.new(@relations, @opts), @relations)
|
35
35
|
end
|
36
36
|
|
37
37
|
# Writes out the assets that can be written out separately:
|
38
|
-
# guides,
|
38
|
+
# guides, images.
|
39
39
|
#
|
40
40
|
# Welcome page and categories are written in JsDuck::IndexHtml
|
41
41
|
def write
|
42
42
|
@guides.write(@opts.output_dir+"/guides")
|
43
|
-
@videos.write(@opts.output_dir+"/videos")
|
44
|
-
@examples.write(@opts.output_dir+"/examples")
|
45
43
|
@images.copy(@opts.output_dir+"/images")
|
46
44
|
end
|
47
45
|
|
data/lib/jsduck/class.rb
CHANGED
@@ -150,7 +150,7 @@ module JsDuck
|
|
150
150
|
ms = parent ? parent.members_hash(type, context) : {}
|
151
151
|
|
152
152
|
mixins.each do |mix|
|
153
|
-
|
153
|
+
merge!(ms, mix.members_hash(type, context))
|
154
154
|
end
|
155
155
|
|
156
156
|
# For static members, exclude everything not explicitly marked as inheritable
|
@@ -158,19 +158,38 @@ module JsDuck
|
|
158
158
|
ms.delete_if {|key, member| !member[:inheritable] }
|
159
159
|
end
|
160
160
|
|
161
|
-
|
161
|
+
merge!(ms, local_members_hash(type, context))
|
162
162
|
|
163
163
|
# If singleton has static members, include them as if they were
|
164
164
|
# instance members. Otherwise they will be completely excluded
|
165
165
|
# from the docs, as the static members block is not created for
|
166
166
|
# singletons.
|
167
167
|
if @doc[:singleton] && @doc[:statics][type].length > 0
|
168
|
-
|
168
|
+
merge!(ms, local_members_hash(type, :statics))
|
169
169
|
end
|
170
170
|
|
171
171
|
ms
|
172
172
|
end
|
173
173
|
|
174
|
+
# merges second members hash into first one
|
175
|
+
def merge!(hash1, hash2)
|
176
|
+
hash2.each_pair do |name, m|
|
177
|
+
if m[:meta] && m[:meta][:hide]
|
178
|
+
if hash1[name]
|
179
|
+
hash1.delete(name)
|
180
|
+
else
|
181
|
+
ctx = m[:files][0]
|
182
|
+
Logger.instance.warn(:hide, "@hide used but #{m[:tagname]} #{m[:name]} not found in parent class", ctx[:filename], ctx[:linenr])
|
183
|
+
end
|
184
|
+
else
|
185
|
+
if hash1[name]
|
186
|
+
store_overrides(hash1[name], m)
|
187
|
+
end
|
188
|
+
hash1[name] = m
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
174
193
|
# Invoked when merge! finds two members with the same name.
|
175
194
|
# New member always overrides the old, but inside new we keep
|
176
195
|
# a list of members it overrides. Normally one member will
|
@@ -179,7 +198,7 @@ module JsDuck
|
|
179
198
|
# ExtJS, we have to handle it.
|
180
199
|
#
|
181
200
|
# Every overridden member is listed just once.
|
182
|
-
def store_overrides(
|
201
|
+
def store_overrides(old, new)
|
183
202
|
# Sometimes a class is included multiple times (like Ext.Base)
|
184
203
|
# resulting in its members overriding themselves. Because of
|
185
204
|
# this, ignore overriding itself.
|
@@ -187,7 +206,6 @@ module JsDuck
|
|
187
206
|
new[:overrides] = [] unless new[:overrides]
|
188
207
|
new[:overrides] << old unless new[:overrides].any? {|m| m[:owner] == old[:owner] }
|
189
208
|
end
|
190
|
-
new
|
191
209
|
end
|
192
210
|
|
193
211
|
# Helper method to get the direct members of this class
|
@@ -267,6 +285,17 @@ module JsDuck
|
|
267
285
|
Class.short_name(@doc[:name])
|
268
286
|
end
|
269
287
|
|
288
|
+
# Returns CSS icons class for the class
|
289
|
+
def icon
|
290
|
+
if @doc[:singleton]
|
291
|
+
"icon-singleton"
|
292
|
+
elsif inherits_from?("Ext.Component")
|
293
|
+
"icon-component"
|
294
|
+
else
|
295
|
+
"icon-class"
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
270
299
|
# Static methods
|
271
300
|
|
272
301
|
# Utility method that given a package or class name finds the name
|
@@ -27,8 +27,8 @@ module JsDuck
|
|
27
27
|
cls[:doc] = @formatter.format(cls[:doc]) if cls[:doc]
|
28
28
|
[:members, :statics].each do |group|
|
29
29
|
cls[group].each_pair do |type, members|
|
30
|
-
# format all members
|
31
|
-
cls[group][type] = members.map {|m| format_member(m)
|
30
|
+
# format all members (except hidden ones)
|
31
|
+
cls[group][type] = members.map {|m| m[:meta][:hide] ? m : format_member(m) }
|
32
32
|
end
|
33
33
|
end
|
34
34
|
cls[:html_meta] = format_meta_data(cls)
|
data/lib/jsduck/doc_parser.rb
CHANGED
@@ -134,8 +134,6 @@ module JsDuck
|
|
134
134
|
at_var
|
135
135
|
elsif look(/@inheritable\b/)
|
136
136
|
boolean_at_tag(/@inheritable/, :inheritable)
|
137
|
-
elsif look(/@(private|ignore|hide)\b/)
|
138
|
-
boolean_at_tag(/@(private|ignore|hide)/, :private)
|
139
137
|
elsif look(/@accessor\b/)
|
140
138
|
boolean_at_tag(/@accessor/, :accessor)
|
141
139
|
elsif look(/@evented\b/)
|
data/lib/jsduck/examples.rb
CHANGED
@@ -48,14 +48,6 @@ module JsDuck
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
# Writes examples JSON file to dir
|
52
|
-
def write(dir)
|
53
|
-
FileUtils.mkdir(dir) unless File.exists?(dir)
|
54
|
-
# Write the JSON to output dir, so it's available in released
|
55
|
-
# version of docs and people can use it with JSDuck by themselves.
|
56
|
-
JsonDuck.write_json(dir+"/examples.json", @groups)
|
57
|
-
end
|
58
|
-
|
59
51
|
# Extracts example icon URL from example hash
|
60
52
|
def icon_url(example)
|
61
53
|
@opts.examples_base_url + example["icon"]
|
data/lib/jsduck/grouped_asset.rb
CHANGED
@@ -10,13 +10,20 @@ module JsDuck
|
|
10
10
|
class GroupedAsset
|
11
11
|
# Should be called from constructor after @groups have been read in,
|
12
12
|
# and after it's been ensured that all items in groupes have names.
|
13
|
+
#
|
14
|
+
# Prints warning when there is a duplicate item within a group.
|
15
|
+
# The warning message should say something like "duplicate <asset type>"
|
13
16
|
def build_map_by_name(warning_msg)
|
14
17
|
@map_by_name = {}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
@groups.each do |group|
|
19
|
+
group_map = {}
|
20
|
+
group["items"].each do |item|
|
21
|
+
if group_map[item["name"]]
|
22
|
+
Logger.instance.warn(:dup_asset, "#{warning_msg} '#{item['name']}'")
|
23
|
+
end
|
24
|
+
@map_by_name[item["name"]] = item
|
25
|
+
group_map[item["name"]] = item
|
18
26
|
end
|
19
|
-
@map_by_name[item["name"]] = item
|
20
27
|
end
|
21
28
|
end
|
22
29
|
|
data/lib/jsduck/guides.rb
CHANGED
@@ -10,43 +10,33 @@ module JsDuck
|
|
10
10
|
# Reads in guides and converts them to JsonP files
|
11
11
|
class Guides < GroupedAsset
|
12
12
|
# Creates Guides object from filename and formatter
|
13
|
-
def self.create(filename, formatter)
|
13
|
+
def self.create(filename, formatter, opts)
|
14
14
|
if filename
|
15
|
-
Guides.new(filename, formatter)
|
15
|
+
Guides.new(filename, formatter, opts)
|
16
16
|
else
|
17
17
|
NullObject.new(:to_array => [], :to_html => "", :[] => nil)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
# Parses guides config file
|
22
|
-
def initialize(filename, formatter)
|
22
|
+
def initialize(filename, formatter, opts)
|
23
23
|
@path = File.dirname(filename)
|
24
24
|
@groups = JsonDuck.read(filename)
|
25
25
|
build_map_by_name("Two guides have the same name")
|
26
26
|
@formatter = formatter
|
27
|
+
@opts = opts
|
27
28
|
end
|
28
29
|
|
29
30
|
# Writes all guides to given dir in JsonP format
|
30
31
|
def write(dir)
|
31
32
|
FileUtils.mkdir(dir) unless File.exists?(dir)
|
32
33
|
each_item {|guide| write_guide(guide, dir) }
|
33
|
-
# Write the JSON to output dir, so it's available in released
|
34
|
-
# version of docs and people can use it with JSDuck by themselves.
|
35
|
-
JsonDuck.write_json(dir+"/guides.json", @groups)
|
36
34
|
end
|
37
35
|
|
38
36
|
def write_guide(guide, dir)
|
39
|
-
|
40
|
-
tutorial_dir = @path + "/tutorials/" + guide["name"]
|
37
|
+
in_dir = @path + "/guides/" + guide["name"]
|
41
38
|
out_dir = dir + "/" + guide["name"]
|
42
|
-
|
43
|
-
if File.exists?(guide_dir)
|
44
|
-
in_dir = guide_dir
|
45
|
-
elsif File.exists?(tutorial_dir)
|
46
|
-
in_dir = tutorial_dir
|
47
|
-
else
|
48
|
-
return Logger.instance.warn(:guide, "Guide #{guide_dir} / #{tutorial_dir} not found")
|
49
|
-
end
|
39
|
+
return Logger.instance.warn(:guide, "Guide #{in_dir} not found") unless File.exists?(in_dir)
|
50
40
|
|
51
41
|
guide_file = in_dir + "/README.md"
|
52
42
|
return Logger.instance.warn(:guide, "README.md not found in #{in_dir}") unless File.exists?(guide_file)
|
@@ -55,6 +45,9 @@ module JsDuck
|
|
55
45
|
# Copy the whole guide dir over
|
56
46
|
FileUtils.cp_r(in_dir, out_dir)
|
57
47
|
|
48
|
+
# Ensure the guide has an icon
|
49
|
+
fix_icon(out_dir)
|
50
|
+
|
58
51
|
@formatter.doc_context = {:filename => guide_file, :linenr => 0}
|
59
52
|
name = File.basename(in_dir)
|
60
53
|
@formatter.img_path = "guides/#{name}"
|
@@ -63,6 +56,19 @@ module JsDuck
|
|
63
56
|
JsonDuck.write_jsonp(out_dir+"/README.js", name, {:guide => html, :title => guide["title"]})
|
64
57
|
end
|
65
58
|
|
59
|
+
# Ensures the guide dir contains icon.png.
|
60
|
+
# When there isn't looks for icon-lg.png and renames it to icon.png.
|
61
|
+
# When neither exists, copies over default icon.
|
62
|
+
def fix_icon(dir)
|
63
|
+
if File.exists?(dir+"/icon.png")
|
64
|
+
# All ok
|
65
|
+
elsif File.exists?(dir+"/icon-lg.png")
|
66
|
+
FileUtils.mv(dir+"/icon-lg.png", dir+"/icon.png")
|
67
|
+
else
|
68
|
+
FileUtils.cp(@opts.template_dir+"/resources/images/default-guide.png", dir+"/icon.png")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
66
72
|
# Creates table of contents at the top of guide by looking for <h2> elements in HTML.
|
67
73
|
def add_toc(guide, html)
|
68
74
|
toc = [
|
data/lib/jsduck/icons.rb
CHANGED
@@ -9,20 +9,10 @@ module JsDuck
|
|
9
9
|
:name => cls[:name],
|
10
10
|
:extends => cls[:extends],
|
11
11
|
:private => cls[:private],
|
12
|
-
:icon => icon
|
12
|
+
:icon => cls.icon,
|
13
13
|
}
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
17
|
-
def icon(cls)
|
18
|
-
if cls[:singleton]
|
19
|
-
"icon-singleton"
|
20
|
-
elsif cls.inherits_from?("Ext.Component")
|
21
|
-
"icon-component"
|
22
|
-
else
|
23
|
-
"icon-class"
|
24
|
-
end
|
25
|
-
end
|
26
16
|
end
|
27
17
|
|
28
18
|
end
|
data/lib/jsduck/logger.rb
CHANGED
@@ -25,6 +25,7 @@ module JsDuck
|
|
25
25
|
[:no_doc, "Member or class without documentation"],
|
26
26
|
[:dup_param, "Method has two parameters with the same name"],
|
27
27
|
[:dup_member, "Class has two members with the same name"],
|
28
|
+
[:dup_asset, "Duplicate guide/video/example"],
|
28
29
|
[:req_after_opt, "Required parameter comes after optional"],
|
29
30
|
[:subproperty, "@param foo.bar where foo param doesn't exist"],
|
30
31
|
[:sing_static, "Singleton class member marked as @static"],
|
@@ -37,7 +38,9 @@ module JsDuck
|
|
37
38
|
[:cat_no_match, "Class pattern in categories file matches nothing"],
|
38
39
|
[:cat_class_missing, "Class is missing from categories file"],
|
39
40
|
[:guide, "Guide is missing from --guides dir"],
|
41
|
+
|
40
42
|
[:aside, "Problem with @aside tag"],
|
43
|
+
[:hide, "Problem with @hide tag"],
|
41
44
|
]
|
42
45
|
# Turn off all warnings by default.
|
43
46
|
# This is good for testing.
|
data/lib/jsduck/merger.rb
CHANGED
@@ -227,12 +227,15 @@ module JsDuck
|
|
227
227
|
# Detects properties common for each doc-object and adds them
|
228
228
|
def add_shared(hash, doc_map)
|
229
229
|
hash.merge!({
|
230
|
-
:private => !!doc_map[:private],
|
231
230
|
:inheritable => !!doc_map[:inheritable],
|
232
231
|
:inheritdoc => doc_map[:inheritdoc] ? doc_map[:inheritdoc].first : nil,
|
233
232
|
:meta => detect_meta(doc_map),
|
234
233
|
})
|
234
|
+
# copy :private also to main hash
|
235
|
+
hash[:private] = true if hash[:meta][:private]
|
236
|
+
|
235
237
|
hash[:id] = create_member_id(hash)
|
238
|
+
|
236
239
|
return hash
|
237
240
|
end
|
238
241
|
|
@@ -279,7 +282,7 @@ module JsDuck
|
|
279
282
|
elsif code[:type] == :assignment && code[:right]
|
280
283
|
if code[:right][:type] == :function
|
281
284
|
return "Function"
|
282
|
-
elsif code[:right][:type] == :literal
|
285
|
+
elsif code[:right][:type] == :literal && code[:right][:class] != nil
|
283
286
|
return code[:right][:class]
|
284
287
|
end
|
285
288
|
end
|
@@ -1,11 +1,27 @@
|
|
1
|
-
require 'singleton'
|
2
1
|
require "jsduck/meta_tag_loader"
|
3
2
|
|
4
3
|
module JsDuck
|
5
4
|
|
6
5
|
# Access to meta-tags
|
7
6
|
class MetaTagRegistry
|
8
|
-
|
7
|
+
|
8
|
+
@@instance = nil
|
9
|
+
|
10
|
+
# Returns singleton instance of MetaTagRegistry.
|
11
|
+
# By default this will be auto-loaded with builtin tags.
|
12
|
+
def self.instance
|
13
|
+
if !@@instance
|
14
|
+
@@instance = MetaTagRegistry.new
|
15
|
+
@@instance.load([:builtins])
|
16
|
+
end
|
17
|
+
@@instance
|
18
|
+
end
|
19
|
+
|
20
|
+
# Allows injecting another MetaTagRegistry to be used as a global instance.
|
21
|
+
def self.instance=(instance)
|
22
|
+
@@instance = instance
|
23
|
+
end
|
24
|
+
|
9
25
|
|
10
26
|
def initialize
|
11
27
|
@tags = []
|
@@ -34,7 +50,17 @@ module JsDuck
|
|
34
50
|
# Returns array of all available tag instances.
|
35
51
|
# When position provided, returns only tags in that position
|
36
52
|
def tags(position=nil)
|
37
|
-
|
53
|
+
return @tags unless position
|
54
|
+
|
55
|
+
unless @position_map
|
56
|
+
@position_map = {}
|
57
|
+
@tags.each do |t|
|
58
|
+
@position_map[t.position] = [] unless @position_map[t.position]
|
59
|
+
@position_map[t.position] << t
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
@position_map[position] || []
|
38
64
|
end
|
39
65
|
|
40
66
|
# Accesses tag by key or name
|
data/lib/jsduck/options.rb
CHANGED
@@ -72,7 +72,7 @@ module JsDuck
|
|
72
72
|
]
|
73
73
|
@meta_tag_paths = []
|
74
74
|
|
75
|
-
@version = "3.
|
75
|
+
@version = "3.6.0"
|
76
76
|
|
77
77
|
# Customizing output
|
78
78
|
@title = "Sencha Docs - Ext JS"
|
@@ -124,7 +124,10 @@ module JsDuck
|
|
124
124
|
read_filenames(canonical(fname))
|
125
125
|
end
|
126
126
|
validate
|
127
|
-
|
127
|
+
|
128
|
+
reg = MetaTagRegistry.new
|
129
|
+
reg.load([:builtins] + @meta_tag_paths)
|
130
|
+
MetaTagRegistry.instance = reg
|
128
131
|
end
|
129
132
|
|
130
133
|
def create_option_parser
|
data/lib/jsduck/renderer.rb
CHANGED
@@ -239,8 +239,6 @@ module JsDuck
|
|
239
239
|
MetaTagRegistry.instance.signatures.each do |s|
|
240
240
|
after += "<strong class='#{s[:key]} signature'>#{s[:long]}</strong>" if m[:meta][s[:key]]
|
241
241
|
end
|
242
|
-
# Special case for :private which isn't inside :meta.
|
243
|
-
after += "<strong class='private signature'>private</strong>" if m[:private]
|
244
242
|
|
245
243
|
uri = "#!/api/#{m[:owner]}-#{m[:id]}"
|
246
244
|
|
data/lib/jsduck/search_data.rb
CHANGED
@@ -41,10 +41,9 @@ module JsDuck
|
|
41
41
|
:cls => alias_display_name(key)+": "+name,
|
42
42
|
:member => name,
|
43
43
|
:type => :class,
|
44
|
-
:icon =>
|
44
|
+
:icon => cls.icon,
|
45
45
|
:id => cls.full_name,
|
46
|
-
:
|
47
|
-
:removed => cls[:meta][:removed],
|
46
|
+
:meta => cls[:meta],
|
48
47
|
:sort => 0,
|
49
48
|
}
|
50
49
|
end
|
@@ -55,10 +54,9 @@ module JsDuck
|
|
55
54
|
:cls => cls.full_name,
|
56
55
|
:member => cls.short_name,
|
57
56
|
:type => :class,
|
58
|
-
:icon =>
|
57
|
+
:icon => cls.icon,
|
59
58
|
:id => cls.full_name,
|
60
|
-
:
|
61
|
-
:removed => cls[:meta][:removed],
|
59
|
+
:meta => cls[:meta],
|
62
60
|
:sort => 1,
|
63
61
|
}
|
64
62
|
end
|
@@ -69,10 +67,9 @@ module JsDuck
|
|
69
67
|
:cls => name,
|
70
68
|
:member => Class.short_name(name),
|
71
69
|
:type => :class,
|
72
|
-
:icon =>
|
70
|
+
:icon => cls.icon,
|
73
71
|
:id => cls.full_name,
|
74
|
-
:
|
75
|
-
:removed => cls[:meta][:removed],
|
72
|
+
:meta => cls[:meta],
|
76
73
|
:sort => 2,
|
77
74
|
}
|
78
75
|
end
|
@@ -83,10 +80,9 @@ module JsDuck
|
|
83
80
|
:cls => cls.full_name,
|
84
81
|
:member => member[:name],
|
85
82
|
:type => :member,
|
86
|
-
:icon => member[:tagname],
|
83
|
+
:icon => "icon-" + member[:tagname].to_s,
|
87
84
|
:id => cls.full_name + "-" + member[:id],
|
88
|
-
:
|
89
|
-
:removed => member[:meta][:removed],
|
85
|
+
:meta => member[:meta],
|
90
86
|
:sort => 3,
|
91
87
|
}
|
92
88
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require "jsduck/meta_tag"
|
2
|
+
|
3
|
+
module JsDuck::Tag
|
4
|
+
# Implementation of @hide tag.
|
5
|
+
#
|
6
|
+
# Hides a member in parent class.
|
7
|
+
#
|
8
|
+
# The core of the implementation is built into jsduck.
|
9
|
+
#
|
10
|
+
class Hide < JsDuck::MetaTag
|
11
|
+
def initialize
|
12
|
+
@name = "hide"
|
13
|
+
@key = :hide
|
14
|
+
@boolean = true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "jsduck/meta_tag"
|
2
|
+
|
3
|
+
module JsDuck::Tag
|
4
|
+
# Implementation of @private tag.
|
5
|
+
#
|
6
|
+
# Marks class/member as private.
|
7
|
+
#
|
8
|
+
# Because :private is accessed a lot internally, it's also injected
|
9
|
+
# to the main hash of documentation item.
|
10
|
+
#
|
11
|
+
class Private < JsDuck::MetaTag
|
12
|
+
def initialize
|
13
|
+
@name = "private"
|
14
|
+
@key = :private
|
15
|
+
@boolean = true
|
16
|
+
@signature = {:long => "private", :short => "PRI"}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
data/lib/jsduck/videos.rb
CHANGED
@@ -30,14 +30,6 @@ module JsDuck
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
# Writes videos JSON file to a dir
|
34
|
-
def write(dir)
|
35
|
-
FileUtils.mkdir(dir) unless File.exists?(dir)
|
36
|
-
# Write the JSON to output dir, so it's available in released
|
37
|
-
# version of docs and people can use it with JSDuck by themselves.
|
38
|
-
JsonDuck.write_json(dir+"/videos.json", @groups)
|
39
|
-
end
|
40
|
-
|
41
33
|
# Extracts video icon URL from video hash
|
42
34
|
def icon_url(video)
|
43
35
|
video["thumb"]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsduck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
|
-
-
|
8
|
+
- 6
|
9
9
|
- 0
|
10
|
-
version: 3.
|
10
|
+
version: 3.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rene Saarsoo
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-02-
|
19
|
+
date: 2012-02-20 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -135,8 +135,11 @@ files:
|
|
135
135
|
- lib/jsduck/tag/author.rb
|
136
136
|
- lib/jsduck/tag/deprecated.rb
|
137
137
|
- lib/jsduck/tag/docauthor.rb
|
138
|
+
- lib/jsduck/tag/hide.rb
|
139
|
+
- lib/jsduck/tag/ignore.rb
|
138
140
|
- lib/jsduck/tag/markdown.rb
|
139
141
|
- lib/jsduck/tag/preventable.rb
|
142
|
+
- lib/jsduck/tag/private.rb
|
140
143
|
- lib/jsduck/tag/protected.rb
|
141
144
|
- lib/jsduck/tag/readonly.rb
|
142
145
|
- lib/jsduck/tag/removed.rb
|
@@ -193,6 +196,7 @@ files:
|
|
193
196
|
- template-min/resources/images/iphone-small-l.jpg
|
194
197
|
- template-min/resources/images/ipad-p.jpg
|
195
198
|
- template-min/resources/images/text-bg.gif
|
199
|
+
- template-min/resources/images/default-guide.png
|
196
200
|
- template-min/resources/images/loading-title.png
|
197
201
|
- template-min/resources/images/version-tabs.png
|
198
202
|
- template-min/resources/images/more.png
|