jsduck 4.10.4 → 5.0.0.beta01
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -1
- data/README.md +32 -6
- data/Rakefile +10 -18
- data/bin/compare +5 -5
- data/bin/jsduck +2 -3
- data/jsduck.gemspec +3 -4
- data/lib/jsduck/aggregator.rb +21 -80
- data/lib/jsduck/app.rb +7 -14
- data/lib/jsduck/app_data.rb +4 -5
- data/lib/jsduck/assets.rb +4 -7
- data/lib/jsduck/base_type.rb +53 -0
- data/lib/jsduck/batch_parser.rb +8 -87
- data/lib/jsduck/batch_processor.rb +77 -0
- data/lib/jsduck/categories/auto.rb +83 -0
- data/lib/jsduck/categories/class_name.rb +63 -0
- data/lib/jsduck/categories/factory.rb +113 -0
- data/lib/jsduck/categories/file.rb +75 -0
- data/lib/jsduck/class.rb +3 -9
- data/lib/jsduck/class_doc_expander.rb +1 -1
- data/lib/jsduck/css/lexer.rb +203 -0
- data/lib/jsduck/css/parser.rb +121 -0
- data/lib/jsduck/doc/comment.rb +40 -0
- data/lib/jsduck/doc/map.rb +23 -0
- data/lib/jsduck/doc/parser.rb +128 -0
- data/lib/jsduck/doc/processor.rb +52 -0
- data/lib/jsduck/doc/scanner.rb +76 -0
- data/lib/jsduck/doc/standard_tag_parser.rb +154 -0
- data/lib/jsduck/doc/subproperties.rb +64 -0
- data/lib/jsduck/docs_code_comparer.rb +31 -0
- data/lib/jsduck/export_writer.rb +2 -2
- data/lib/jsduck/exporter/app.rb +16 -4
- data/lib/jsduck/exporter/full.rb +2 -2
- data/lib/jsduck/format/batch.rb +58 -0
- data/lib/jsduck/format/class.rb +62 -0
- data/lib/jsduck/format/doc.rb +172 -0
- data/lib/jsduck/format/html_stack.rb +109 -0
- data/lib/jsduck/format/shortener.rb +55 -0
- data/lib/jsduck/format/subproperties.rb +64 -0
- data/lib/jsduck/guides.rb +32 -14
- data/lib/jsduck/index_html.rb +3 -1
- data/lib/jsduck/inline/auto_link.rb +2 -2
- data/lib/jsduck/inline/link.rb +4 -3
- data/lib/jsduck/inline/link_renderer.rb +2 -2
- data/lib/jsduck/inline/video.rb +8 -2
- data/lib/jsduck/js/ast.rb +361 -0
- data/lib/jsduck/js/esprima.rb +39 -0
- data/lib/jsduck/{esprima → js/esprima}/esprima.js +0 -0
- data/lib/jsduck/js/evaluator.rb +70 -0
- data/lib/jsduck/js/ext_patterns.rb +70 -0
- data/lib/jsduck/js/function.rb +206 -0
- data/lib/jsduck/js/node.rb +194 -0
- data/lib/jsduck/js/node_array.rb +36 -0
- data/lib/jsduck/js/parser.rb +223 -0
- data/lib/jsduck/js/serializer.rb +263 -0
- data/lib/jsduck/js/utils.rb +21 -0
- data/lib/jsduck/logger.rb +3 -13
- data/lib/jsduck/members_index.rb +3 -4
- data/lib/jsduck/merger.rb +25 -145
- data/lib/jsduck/options.rb +29 -132
- data/lib/jsduck/parser.rb +76 -0
- data/lib/jsduck/process/accessors.rb +133 -0
- data/lib/jsduck/process/circular_deps.rb +58 -0
- data/lib/jsduck/process/enums.rb +91 -0
- data/lib/jsduck/process/ext4_events.rb +43 -0
- data/lib/jsduck/process/global_members.rb +36 -0
- data/lib/jsduck/process/ignored_classes.rb +16 -0
- data/lib/jsduck/process/importer.rb +58 -0
- data/lib/jsduck/process/inherit_doc.rb +197 -0
- data/lib/jsduck/process/lint.rb +135 -0
- data/lib/jsduck/process/overrides.rb +99 -0
- data/lib/jsduck/process/return_values.rb +72 -0
- data/lib/jsduck/process/versions.rb +102 -0
- data/lib/jsduck/relations.rb +5 -0
- data/lib/jsduck/render/class.rb +144 -0
- data/lib/jsduck/render/sidebar.rb +97 -0
- data/lib/jsduck/render/signature.rb +94 -0
- data/lib/jsduck/render/subproperties.rb +99 -0
- data/lib/jsduck/render/tags.rb +38 -0
- data/lib/jsduck/search_data.rb +19 -13
- data/lib/jsduck/source/file.rb +8 -17
- data/lib/jsduck/tag/abstract.rb +4 -7
- data/lib/jsduck/tag/accessor.rb +10 -0
- data/lib/jsduck/tag/alias.rb +61 -0
- data/lib/jsduck/tag/alternate_class_names.rb +17 -0
- data/lib/jsduck/tag/aside.rb +28 -31
- data/lib/jsduck/tag/author.rb +9 -5
- data/lib/jsduck/tag/boolean_tag.rb +24 -0
- data/lib/jsduck/tag/cfg.rb +45 -0
- data/lib/jsduck/tag/chainable.rb +5 -7
- data/lib/jsduck/tag/class.rb +28 -0
- data/lib/jsduck/tag/class_list_tag.rb +40 -0
- data/lib/jsduck/tag/constructor.rb +24 -0
- data/lib/jsduck/tag/css_mixin.rb +17 -0
- data/lib/jsduck/tag/css_var.rb +29 -0
- data/lib/jsduck/tag/default.rb +31 -0
- data/lib/jsduck/tag/deprecated.rb +13 -27
- data/lib/jsduck/tag/deprecated_tag.rb +58 -0
- data/lib/jsduck/tag/doc.rb +32 -0
- data/lib/jsduck/tag/docauthor.rb +4 -5
- data/lib/jsduck/tag/enum.rb +70 -0
- data/lib/jsduck/tag/event.rb +28 -0
- data/lib/jsduck/tag/evented.rb +10 -0
- data/lib/jsduck/tag/extends.rb +45 -0
- data/lib/jsduck/tag/ftype.rb +18 -0
- data/lib/jsduck/tag/hide.rb +4 -11
- data/lib/jsduck/tag/ignore.rb +6 -7
- data/lib/jsduck/tag/inheritable.rb +10 -0
- data/lib/jsduck/tag/inheritdoc.rb +48 -0
- data/lib/jsduck/tag/markdown.rb +8 -6
- data/lib/jsduck/tag/member.rb +24 -0
- data/lib/jsduck/tag/method.rb +35 -0
- data/lib/jsduck/tag/mixins.rb +26 -0
- data/lib/jsduck/tag/name.rb +36 -0
- data/lib/jsduck/tag/new.rb +13 -27
- data/lib/jsduck/tag/override.rb +37 -0
- data/lib/jsduck/tag/overrides.rb +29 -0
- data/lib/jsduck/tag/param.rb +87 -0
- data/lib/jsduck/tag/preventable.rb +19 -10
- data/lib/jsduck/tag/private.rb +28 -13
- data/lib/jsduck/tag/property.rb +39 -0
- data/lib/jsduck/tag/protected.rb +5 -7
- data/lib/jsduck/tag/ptype.rb +18 -0
- data/lib/jsduck/tag/readonly.rb +4 -7
- data/lib/jsduck/tag/removed.rb +21 -29
- data/lib/jsduck/tag/required.rb +11 -9
- data/lib/jsduck/tag/requires.rb +12 -0
- data/lib/jsduck/tag/return.rb +47 -0
- data/lib/jsduck/tag/since.rb +19 -11
- data/lib/jsduck/tag/singleton.rb +15 -0
- data/lib/jsduck/tag/static.rb +5 -7
- data/lib/jsduck/tag/subproperties.rb +23 -0
- data/lib/jsduck/tag/tag.rb +208 -0
- data/lib/jsduck/tag/template.rb +14 -9
- data/lib/jsduck/tag/throws.rb +38 -0
- data/lib/jsduck/tag/type.rb +48 -0
- data/lib/jsduck/tag/uses.rb +12 -0
- data/lib/jsduck/tag/xtype.rb +30 -0
- data/lib/jsduck/tag_loader.rb +39 -0
- data/lib/jsduck/tag_registry.rb +189 -0
- data/lib/jsduck/type_parser.rb +3 -3
- data/lib/jsduck/web_writer.rb +2 -2
- data/lib/jsduck/welcome.rb +1 -1
- metadata +578 -538
- data/lib/jsduck/accessors.rb +0 -136
- data/lib/jsduck/ast.rb +0 -524
- data/lib/jsduck/auto_categories.rb +0 -80
- data/lib/jsduck/batch_formatter.rb +0 -60
- data/lib/jsduck/categories.rb +0 -73
- data/lib/jsduck/categories_class_name.rb +0 -37
- data/lib/jsduck/circular_deps.rb +0 -56
- data/lib/jsduck/class_formatter.rb +0 -102
- data/lib/jsduck/columns.rb +0 -56
- data/lib/jsduck/css_lexer.rb +0 -201
- data/lib/jsduck/css_parser.rb +0 -119
- data/lib/jsduck/doc_ast.rb +0 -319
- data/lib/jsduck/doc_formatter.rb +0 -142
- data/lib/jsduck/doc_parser.rb +0 -611
- data/lib/jsduck/doc_type.rb +0 -59
- data/lib/jsduck/enum.rb +0 -73
- data/lib/jsduck/esprima.rb +0 -51
- data/lib/jsduck/evaluator.rb +0 -69
- data/lib/jsduck/ext_patterns.rb +0 -58
- data/lib/jsduck/file_categories.rb +0 -76
- data/lib/jsduck/function_ast.rb +0 -206
- data/lib/jsduck/guide_anchors.rb +0 -32
- data/lib/jsduck/guide_toc.rb +0 -49
- data/lib/jsduck/html_stack.rb +0 -105
- data/lib/jsduck/importer.rb +0 -121
- data/lib/jsduck/inherit_doc.rb +0 -193
- data/lib/jsduck/js_parser.rb +0 -221
- data/lib/jsduck/lint.rb +0 -133
- data/lib/jsduck/meta_tag.rb +0 -88
- data/lib/jsduck/meta_tag_loader.rb +0 -67
- data/lib/jsduck/meta_tag_registry.rb +0 -111
- data/lib/jsduck/meta_tag_renderer.rb +0 -34
- data/lib/jsduck/news.rb +0 -128
- data/lib/jsduck/override.rb +0 -87
- data/lib/jsduck/renderer.rb +0 -361
- data/lib/jsduck/return_values.rb +0 -72
- data/lib/jsduck/serializer.rb +0 -262
- data/lib/jsduck/shortener.rb +0 -58
- data/lib/jsduck/signature_renderer.rb +0 -91
- data/lib/jsduck/source/file_parser.rb +0 -72
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -34,12 +34,38 @@ Standard rubygems install should do:
|
|
34
34
|
|
35
35
|
$ [sudo] gem install jsduck
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
If you encounter errors during gem installation, you may need to
|
38
|
+
install the header files for compiling extension modules for Ruby 1.9.
|
39
|
+
For Debian systems you'll need the `ruby1.9-dev` package. For Red Hat
|
40
|
+
/ CentOS / Fedora use the `ruby-devel` package.
|
41
|
+
|
42
|
+
In **OSX Mountain Lion** the compilation of `therubyracer` dependency
|
43
|
+
often fails for so far unknown reasons. Most users have found a
|
44
|
+
solution in upgrading to Ruby 1.9 using [RVM][].
|
45
|
+
|
46
|
+
For **Windows** users out there, you can download the binary version,
|
47
|
+
which includes Ruby interpreter and all dependencies bundled in a
|
48
|
+
single .exe file. Grab it from the [download page][].
|
49
|
+
|
50
|
+
Alternatively you can install through rubygems, but you need to do
|
51
|
+
some additional tweaks. First go and [download][libs download]
|
52
|
+
therubyracer gem and v8 lib that stereobooster has built for
|
53
|
+
windows. You need to install this special rubyracer version instead of
|
54
|
+
the one from rubygems:
|
55
|
+
|
56
|
+
> gem install therubyracer-0.11.0beta1-x86-mingw32.gem
|
57
|
+
|
58
|
+
To make it actually work you need `v8.dll` somewhere in your
|
59
|
+
system. Extract the `lib_v8.3.11.9.zip` take the `v8.dll` inside it
|
60
|
+
and place into the `bin` directory of your Ruby installation (other
|
61
|
+
dirs that are on your PATH can work too, but I've found this to be the
|
62
|
+
most sensible place to put it). Now you're ready to install JSDuck:
|
63
|
+
|
64
|
+
> gem install jsduck
|
65
|
+
|
66
|
+
[RVM]: https://rvm.io/
|
67
|
+
[download page]: https://sourceforge.net/projects/jsduck/files/
|
68
|
+
[libs download]: https://github.com/stereobooster/therubyracer/downloads
|
43
69
|
|
44
70
|
Usage
|
45
71
|
-----
|
data/Rakefile
CHANGED
@@ -104,7 +104,7 @@ def compress
|
|
104
104
|
dir = "template-min"
|
105
105
|
|
106
106
|
# Create JSB3 file for Docs app
|
107
|
-
system("sencha", "create", "jsb", "-a", "http://localhost/docs/", "-p", "#{dir}/app.jsb3")
|
107
|
+
system("sencha", "create", "jsb", "-a", "http://localhost/~renesaarsoo/docs/", "-p", "#{dir}/app.jsb3")
|
108
108
|
# Concatenate files listed in JSB3 file
|
109
109
|
system("sencha", "build", "-p", "#{dir}/app.jsb3", "-d", dir)
|
110
110
|
|
@@ -159,11 +159,6 @@ class JsDuckRunner
|
|
159
159
|
add_options("--comments-domain", db_name+"/"+version)
|
160
160
|
end
|
161
161
|
|
162
|
-
def add_search(product, version)
|
163
|
-
add_options("--search-url", "http://support-test.sencha.com:8080/docsearch/search")
|
164
|
-
add_options("--search-domain", product+"/"+version)
|
165
|
-
end
|
166
|
-
|
167
162
|
def add_ext4
|
168
163
|
@options += [
|
169
164
|
"--title", "Sencha Docs - Ext JS 4.0",
|
@@ -252,7 +247,7 @@ task :ext4 => :sass do
|
|
252
247
|
runner.add_debug
|
253
248
|
runner.run
|
254
249
|
|
255
|
-
system("
|
250
|
+
system("cp -r #{EXT_BUILD} #{OUT_DIR}/extjs-build")
|
256
251
|
end
|
257
252
|
|
258
253
|
desc "Run JSDuck on Ext JS from SDK repo (for internal use at Sencha)"
|
@@ -262,14 +257,15 @@ task :sdk => :sass do
|
|
262
257
|
"--output", OUT_DIR,
|
263
258
|
"--config", "#{SDK_DIR}/extjs/docs/config.json",
|
264
259
|
"--examples-base-url", "extjs-build/examples/",
|
260
|
+
# "--import", "4.1:../docs.sencha.com/exports/extjs-4.1.1",
|
261
|
+
# "--import", "4.2",
|
265
262
|
"--seo"
|
266
263
|
)
|
267
264
|
runner.add_debug
|
268
265
|
runner.add_comments('ext-js', '4')
|
269
|
-
runner.add_search('Ext JS', '4.2.0')
|
270
266
|
runner.run
|
271
267
|
|
272
|
-
system("
|
268
|
+
system("cp -r #{EXT_BUILD} #{OUT_DIR}/extjs-build")
|
273
269
|
end
|
274
270
|
|
275
271
|
desc "Run JSDuck on Sencha Touch 2 repo (for internal use at Sencha)"
|
@@ -279,14 +275,10 @@ task :touch2 => :sass do
|
|
279
275
|
"--output", OUT_DIR,
|
280
276
|
"--config", "#{SDK_DIR}/touch/docs/config.json",
|
281
277
|
"--examples-base-url", "touch-build/examples/production/",
|
282
|
-
# "--import", "1.1
|
283
|
-
# "--import", "
|
284
|
-
# "--import", "2.
|
285
|
-
# "--import", "2.
|
286
|
-
# "--import", "2.1.0:../docs.sencha.com/exports/touch-2.1.0",
|
287
|
-
# "--import", "2.1.1:../docs.sencha.com/exports/touch-2.1.1",
|
288
|
-
# "--import", "2.2.0:../docs.sencha.com/exports/touch-2.2.0",
|
289
|
-
# "--import", "2.2.1",
|
278
|
+
# "--import", "Touch 1.1:../docs.sencha.com/exports/touch-1.1",
|
279
|
+
# "--import", "Touch 2.0:../docs.sencha.com/exports/touch-2.0.1",
|
280
|
+
# "--import", "Touch 2.1.0:../docs.sencha.com/exports/touch-2.1.0",
|
281
|
+
# "--import", "Touch 2.1.1",
|
290
282
|
"--seo"
|
291
283
|
)
|
292
284
|
|
@@ -294,7 +286,7 @@ task :touch2 => :sass do
|
|
294
286
|
runner.add_comments('touch', '2')
|
295
287
|
runner.run
|
296
288
|
|
297
|
-
system("
|
289
|
+
system("cp -r #{TOUCH_BUILD} #{OUT_DIR}/touch-build")
|
298
290
|
end
|
299
291
|
|
300
292
|
task :default => :spec
|
data/bin/compare
CHANGED
@@ -105,7 +105,7 @@ def read_ignored_members(filename)
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def normal_public_member?(m)
|
108
|
-
!m["private"] && !m["
|
108
|
+
!m["private"] && !m["protected"] && !m["deprecated"] && !m["removed"]
|
109
109
|
end
|
110
110
|
|
111
111
|
def unify_default(v)
|
@@ -115,7 +115,7 @@ end
|
|
115
115
|
def visibility(m)
|
116
116
|
if m["private"]
|
117
117
|
"private"
|
118
|
-
elsif m["
|
118
|
+
elsif m["protected"]
|
119
119
|
"protected"
|
120
120
|
else
|
121
121
|
"public"
|
@@ -125,7 +125,7 @@ end
|
|
125
125
|
# Finds equivalent member to given member from class.
|
126
126
|
# Returns the member found or nil.
|
127
127
|
def find_member(cls, member)
|
128
|
-
cls[member["
|
128
|
+
cls[member["static"] ? "statics" : "members"][member["tagname"]].find do |m|
|
129
129
|
member["name"] == m["name"]
|
130
130
|
end
|
131
131
|
end
|
@@ -190,9 +190,9 @@ def compare_classes(cls1, cls2)
|
|
190
190
|
:what => "removed",
|
191
191
|
:other => other ? {
|
192
192
|
:type => other["tagname"],
|
193
|
-
:static => other["
|
193
|
+
:static => other["static"],
|
194
194
|
:private => other["private"],
|
195
|
-
:protected => other["
|
195
|
+
:protected => other["protected"],
|
196
196
|
} : nil
|
197
197
|
}
|
198
198
|
end
|
data/bin/jsduck
CHANGED
@@ -17,11 +17,10 @@
|
|
17
17
|
# For running when gem not installed
|
18
18
|
$:.unshift File.dirname(File.dirname(__FILE__)) + "/lib"
|
19
19
|
|
20
|
+
require 'rubygems'
|
20
21
|
require 'jsduck/app'
|
21
22
|
require 'jsduck/options'
|
22
23
|
|
23
24
|
opts = JsDuck::Options.new
|
24
25
|
opts.parse!(ARGV)
|
25
|
-
|
26
|
-
|
27
|
-
exit exit_code
|
26
|
+
JsDuck::App.new(opts).run
|
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 = '
|
6
|
-
s.date =
|
5
|
+
s.version = '5.0.0.beta01'
|
6
|
+
s.date = '2013-02-25'
|
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"
|
@@ -22,8 +22,7 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_dependency 'rdiscount'
|
23
23
|
s.add_dependency 'json'
|
24
24
|
s.add_dependency 'parallel'
|
25
|
-
s.add_dependency '
|
26
|
-
s.add_dependency 'therubyracer', '>= 0.10.0'
|
25
|
+
s.add_dependency 'therubyracer', '>= 0.10.0', '< 0.11.0'
|
27
26
|
s.add_dependency 'dimensions'
|
28
27
|
|
29
28
|
s.add_development_dependency 'rspec'
|
data/lib/jsduck/aggregator.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
1
|
-
require 'jsduck/class'
|
2
|
-
require 'jsduck/accessors'
|
3
1
|
require 'jsduck/logger'
|
4
|
-
require 'jsduck/enum'
|
5
|
-
require 'jsduck/override'
|
6
2
|
|
7
3
|
module JsDuck
|
8
4
|
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Groups parsed documentation data from source files into classes.
|
6
|
+
#
|
7
|
+
# Produces Hash of classes as result. When a member is found that
|
8
|
+
# doesn't belong to any class, it's placed into special "global"
|
9
|
+
# class.
|
11
10
|
class Aggregator
|
12
11
|
def initialize
|
13
|
-
@documentation = []
|
14
12
|
@classes = {}
|
15
13
|
@alt_names = {}
|
16
14
|
@orphans = []
|
@@ -28,6 +26,18 @@ module JsDuck
|
|
28
26
|
file.each {|doc| register(doc) }
|
29
27
|
end
|
30
28
|
|
29
|
+
# Returns the final result which is a Hash of all classes indexed
|
30
|
+
# by name. It's a hash because some processors applied to this
|
31
|
+
# returned classes list need a random-access look up classes by
|
32
|
+
# name.
|
33
|
+
def result
|
34
|
+
classify_orphans
|
35
|
+
create_global_class
|
36
|
+
@classes
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
31
41
|
# Registers documentation node either as class or as member of
|
32
42
|
# some class.
|
33
43
|
def register(node)
|
@@ -52,7 +62,6 @@ module JsDuck
|
|
52
62
|
@current_class = old_cls
|
53
63
|
else
|
54
64
|
@current_class = cls
|
55
|
-
@documentation << cls
|
56
65
|
@classes[cls[:name]] = cls
|
57
66
|
|
58
67
|
# Register all alternate names of class for lookup too
|
@@ -67,7 +76,6 @@ module JsDuck
|
|
67
76
|
# it by merging the class with alt-name into this class.
|
68
77
|
if @classes[altname]
|
69
78
|
merge_classes(cls, @classes[altname])
|
70
|
-
@documentation.delete(@classes[altname])
|
71
79
|
@classes.delete(altname)
|
72
80
|
warn_alt_name(cls)
|
73
81
|
end
|
@@ -91,12 +99,8 @@ module JsDuck
|
|
91
99
|
old[tag] = old[tag] || new[tag]
|
92
100
|
end
|
93
101
|
# Merge arrays
|
94
|
-
[:mixins, :alternateClassNames, :files].each do |tag|
|
95
|
-
old[tag] = old[tag] + new[tag]
|
96
|
-
end
|
97
|
-
# Merge meta hashes
|
98
|
-
new[:meta].each_pair do |name, value|
|
99
|
-
old[:meta][name] = old[:meta][name] || value
|
102
|
+
[:mixins, :alternateClassNames, :requires, :uses, :files].each do |tag|
|
103
|
+
old[tag] = (old[tag] || []) + (new[tag] || [])
|
100
104
|
end
|
101
105
|
# Merge hashes of arrays
|
102
106
|
[:aliases].each do |tag|
|
@@ -120,7 +124,7 @@ module JsDuck
|
|
120
124
|
# When no class precedes them - they too are orphaned.
|
121
125
|
def add_member(node)
|
122
126
|
# Completely ignore member if @ignore used
|
123
|
-
return if node[:
|
127
|
+
return if node[:ignore]
|
124
128
|
|
125
129
|
if node[:owner]
|
126
130
|
if @classes[node[:owner]]
|
@@ -156,9 +160,7 @@ module JsDuck
|
|
156
160
|
# Creates classes for orphans that have :owner property defined,
|
157
161
|
# and then inserts orphans to these classes.
|
158
162
|
def classify_orphans
|
159
|
-
|
160
|
-
# #inster_orphan method deleting items from @orphans array.
|
161
|
-
@orphans.clone.each do |orph|
|
163
|
+
@orphans.each do |orph|
|
162
164
|
if orph[:owner]
|
163
165
|
class_name = orph[:owner]
|
164
166
|
if !@classes[class_name]
|
@@ -187,73 +189,12 @@ module JsDuck
|
|
187
189
|
:tagname => :class,
|
188
190
|
:name => name,
|
189
191
|
:doc => doc,
|
190
|
-
:mixins => [],
|
191
192
|
:alternateClassNames => [],
|
192
193
|
:members => [],
|
193
194
|
:aliases => {},
|
194
|
-
:meta => {},
|
195
195
|
:files => [{:filename => "", :linenr => 0, :href => ""}],
|
196
196
|
})
|
197
197
|
end
|
198
|
-
|
199
|
-
# Gets rid of classes marked with @ignore
|
200
|
-
def remove_ignored_classes
|
201
|
-
@documentation.delete_if do |cls|
|
202
|
-
if cls[:meta][:ignore]
|
203
|
-
@classes.delete(cls["name"])
|
204
|
-
true
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
# Appends Ext4 options parameter to each event parameter list.
|
210
|
-
def append_ext4_event_options
|
211
|
-
options = {
|
212
|
-
:tagname => :param,
|
213
|
-
:name => "eOpts",
|
214
|
-
:type => "Object",
|
215
|
-
:doc => "The options object passed to {@link Ext.util.Observable#addListener}."
|
216
|
-
}
|
217
|
-
@classes.each_value do |cls|
|
218
|
-
cls[:members].each do |m|
|
219
|
-
m[:params] << options if m[:tagname] == :event
|
220
|
-
end
|
221
|
-
end
|
222
|
-
end
|
223
|
-
|
224
|
-
# Creates accessor method for configs marked with @accessor
|
225
|
-
def create_accessors
|
226
|
-
accessors = Accessors.new
|
227
|
-
@classes.each_value do |cls|
|
228
|
-
accessors.create(cls)
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
# Loops through all enums and auto-detects their types if needed.
|
233
|
-
def process_enums
|
234
|
-
Enum.new(@classes).process_all!
|
235
|
-
end
|
236
|
-
|
237
|
-
# Processes all overrides.
|
238
|
-
# Returns list of override classes.
|
239
|
-
def process_overrides
|
240
|
-
Override.new(@classes).process_all!.map do |cls|
|
241
|
-
# discard each override class
|
242
|
-
@classes.delete(cls[:name])
|
243
|
-
@documentation.delete(cls)
|
244
|
-
cls
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
# Are we dealing with ExtJS 4?
|
249
|
-
# True if any of the classes is defined with Ext.define()
|
250
|
-
def ext4?
|
251
|
-
@documentation.any? {|cls| cls[:code_type] == :ext_define }
|
252
|
-
end
|
253
|
-
|
254
|
-
def result
|
255
|
-
@documentation + @orphans
|
256
|
-
end
|
257
198
|
end
|
258
199
|
|
259
200
|
end
|
data/lib/jsduck/app.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'jsduck/batch_parser'
|
2
|
+
require 'jsduck/batch_processor'
|
2
3
|
require 'jsduck/assets'
|
3
|
-
require 'jsduck/
|
4
|
+
require 'jsduck/tag_registry'
|
4
5
|
require 'jsduck/export_writer'
|
5
6
|
require 'jsduck/web_writer'
|
6
|
-
require 'jsduck/logger'
|
7
7
|
|
8
8
|
module JsDuck
|
9
9
|
|
@@ -15,7 +15,6 @@ module JsDuck
|
|
15
15
|
end
|
16
16
|
|
17
17
|
# Main App logic.
|
18
|
-
# Returns application exit code.
|
19
18
|
def run
|
20
19
|
parse
|
21
20
|
|
@@ -26,27 +25,21 @@ module JsDuck
|
|
26
25
|
else
|
27
26
|
generate_web_page
|
28
27
|
end
|
29
|
-
|
30
|
-
if @opts.warnings_exit_nonzero && Logger.warnings_logged?
|
31
|
-
return 2
|
32
|
-
else
|
33
|
-
return 0
|
34
|
-
end
|
35
28
|
end
|
36
29
|
|
37
30
|
private
|
38
31
|
|
39
32
|
def parse
|
40
|
-
@
|
41
|
-
@relations = @
|
33
|
+
@parsed_files = BatchParser.parse(@opts)
|
34
|
+
@relations = BatchProcessor.process(@parsed_files, @opts)
|
42
35
|
end
|
43
36
|
|
44
37
|
def init_assets
|
45
38
|
# Initialize guides, videos, examples, ...
|
46
39
|
@assets = Assets.new(@relations, @opts)
|
47
40
|
|
48
|
-
# Give access to assets from
|
49
|
-
|
41
|
+
# HACK: Give access to assets from @aside tag
|
42
|
+
TagRegistry.get_by_name(:aside).assets = @assets
|
50
43
|
end
|
51
44
|
|
52
45
|
def generate_export
|
@@ -54,7 +47,7 @@ module JsDuck
|
|
54
47
|
end
|
55
48
|
|
56
49
|
def generate_web_page
|
57
|
-
WebWriter.new(@relations, @assets, @
|
50
|
+
WebWriter.new(@relations, @assets, @parsed_files, @opts).write
|
58
51
|
end
|
59
52
|
|
60
53
|
end
|
data/lib/jsduck/app_data.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'jsduck/util/json'
|
2
2
|
require 'jsduck/icons'
|
3
3
|
require 'jsduck/search_data'
|
4
|
-
require 'jsduck/
|
4
|
+
require 'jsduck/tag_registry'
|
5
5
|
|
6
6
|
module JsDuck
|
7
7
|
|
@@ -21,17 +21,16 @@ module JsDuck
|
|
21
21
|
:guides => @assets.guides.to_array,
|
22
22
|
:videos => @assets.videos.to_array,
|
23
23
|
:examples => @assets.examples.to_array,
|
24
|
-
:search => SearchData.new.create(@relations.classes, @assets
|
25
|
-
:guideSearch => @opts.search,
|
24
|
+
:search => SearchData.new.create(@relations.classes, @assets),
|
26
25
|
:tests => @opts.tests,
|
27
|
-
:signatures =>
|
26
|
+
:signatures => TagRegistry.signatures,
|
27
|
+
:memberTypes => TagRegistry.member_types,
|
28
28
|
:localStorageDb => @opts.local_storage_db,
|
29
29
|
:showPrintButton => @opts.seo,
|
30
30
|
:touchExamplesUi => @opts.touch_examples_ui,
|
31
31
|
:source => @opts.source,
|
32
32
|
:commentsUrl => @opts.comments_url,
|
33
33
|
:commentsDomain => @opts.comments_domain,
|
34
|
-
:message => @opts.message,
|
35
34
|
}
|
36
35
|
}) + ";\n"
|
37
36
|
File.open(filename, 'w') {|f| f.write(js) }
|