jsduck 4.5.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -257,6 +257,8 @@ task :sdk => :sass do
257
257
  "--output", OUT_DIR,
258
258
  "--config", "#{SDK_DIR}/extjs/docs/config.json",
259
259
  "--examples-base-url", "extjs-build/examples/",
260
+ "--import", "Ext 4.1.3:#{SDK_DIR}/../docs.sencha.com/exports/extjs-4.1.3",
261
+ "--import", "Ext 4.2.0",
260
262
  "--seo"
261
263
  )
262
264
  runner.add_debug
@@ -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 = '4.5.0'
6
- s.date = '2012-12-06'
5
+ s.version = '4.5.1'
6
+ s.date = '2012-12-07'
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"
@@ -1,6 +1,7 @@
1
1
  require 'jsduck/logger'
2
2
  require 'jsduck/file_categories'
3
3
  require 'jsduck/auto_categories'
4
+ require 'jsduck/categories_class_name'
4
5
 
5
6
  module JsDuck
6
7
 
@@ -17,8 +18,7 @@ module JsDuck
17
18
 
18
19
  def initialize(categories, doc_formatter, relations={})
19
20
  @categories = categories
20
- @doc_formatter = doc_formatter
21
- @relations = relations
21
+ @class_name = CategoriesClassName.new(doc_formatter, relations)
22
22
  end
23
23
 
24
24
  # Returns HTML listing of classes divided into categories
@@ -58,7 +58,7 @@ module JsDuck
58
58
  [
59
59
  "<h3>#{g['name']}</h3>",
60
60
  "<ul class='links'>",
61
- g["classes"].map {|cls| "<li>" + (@relations[cls] ? @doc_formatter.link(cls, nil, cls) : cls) + "</li>" },
61
+ g["classes"].map {|cls| "<li>" + @class_name.render(cls) + "</li>" },
62
62
  "</ul>",
63
63
  ]
64
64
  end
@@ -0,0 +1,61 @@
1
+ module JsDuck
2
+
3
+ # Renders class names for class categories page.
4
+ class CategoriesClassName
5
+ def initialize(doc_formatter, relations={})
6
+ @doc_formatter = doc_formatter
7
+ @relations = relations
8
+ end
9
+
10
+ # Renders the class name as a link or plain text.
11
+ #
12
+ # For new classes appends a star behind class name. For classes
13
+ # with new members appends list n small stars behind class name
14
+ # (reflecting the number of new members).
15
+ def render(name)
16
+ cls = @relations[name]
17
+ if cls
18
+ @doc_formatter.link(name, nil, name) + render_new_label(cls)
19
+ else
20
+ name
21
+ end
22
+ end
23
+
24
+ private
25
+
26
+ # Adds small star to new classes in the current version.
27
+ def render_new_label(cls)
28
+ if cls[:meta][:new]
29
+ "&nbsp;<span class='new-class' title='New class'>#{stars(1)}</span>"
30
+ else
31
+ n = new_members_count(cls)
32
+ if n > 0
33
+ title = "#{n} new member#{(n>1) ? 's' : ''}"
34
+ "&nbsp;<span class='new-members' title='#{title}'>#{stars(n)}</span>"
35
+ else
36
+ ""
37
+ end
38
+ end
39
+ end
40
+
41
+ # Produces string of n stars.
42
+ # First 3 stars are rendered as "<unicode-star>", the following as "+".
43
+ # At max 15 stars are rendered.
44
+ def stars(n)
45
+ if n > 15
46
+ stars(3) + ("+" * (15-3))
47
+ elsif n > 3
48
+ stars(3) + ("+" * (n-3))
49
+ else
50
+ "&#9733;" * n
51
+ end
52
+ end
53
+
54
+ # Returns number of new members the class has in the current version
55
+ def new_members_count(cls)
56
+ cls.find_members(:local => true).find_all {|m| m[:meta][:new] && !m[:private] }.length
57
+ end
58
+
59
+ end
60
+
61
+ end
@@ -292,7 +292,7 @@ module JsDuck
292
292
  # Combines :doc-s of most tags
293
293
  # Ignores tags that have doc comment themselves and subproperty tags
294
294
  def detect_doc(docs)
295
- ignore_tags = [:param, :return, :meta]
295
+ ignore_tags = [:param, :return, :throws, :meta]
296
296
  doc_tags = docs.find_all { |tag| !ignore_tags.include?(tag[:tagname]) && !subproperty?(tag) }
297
297
  doc_tags.map { |tag| tag[:doc] }.compact.join(" ")
298
298
  end
@@ -90,7 +90,7 @@ module JsDuck
90
90
  @ext4_events = nil
91
91
  @meta_tag_paths = []
92
92
 
93
- @version = "4.5.0"
93
+ @version = "4.5.1"
94
94
 
95
95
  # Customizing output
96
96
  @title = "Documentation - JSDuck"
@@ -444,7 +444,11 @@ module JsDuck
444
444
  "when used in type definitions or inherited from.",
445
445
  "",
446
446
  "Multiple classes can be given in comma-separated list,",
447
- "or by using the option repeatedly.") do |classes|
447
+ "or by using the option repeatedly.",
448
+ "",
449
+ "The wildcard '*' can be used to match a set of classes",
450
+ "e.g. to ignore all classes of a particular namespace:",
451
+ "--external='Foo.*'") do |classes|
448
452
  @external_classes += classes
449
453
  end
450
454
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsduck
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.0
4
+ version: 4.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-06 00:00:00.000000000 Z
13
+ date: 2012-12-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdiscount
@@ -158,6 +158,7 @@ files:
158
158
  - lib/jsduck/batch_formatter.rb
159
159
  - lib/jsduck/batch_parser.rb
160
160
  - lib/jsduck/categories.rb
161
+ - lib/jsduck/categories_class_name.rb
161
162
  - lib/jsduck/circular_deps.rb
162
163
  - lib/jsduck/class.rb
163
164
  - lib/jsduck/class_doc_expander.rb
@@ -251,7 +252,7 @@ files:
251
252
  - lib/jsduck/videos.rb
252
253
  - lib/jsduck/web_writer.rb
253
254
  - lib/jsduck/welcome.rb
254
- - template-min/app-7574bba7233cfaa4a67c0f9f5e139cc6.js
255
+ - template-min/app-c6fdef5b424714d909c92c47a65b7a8f.js
255
256
  - template-min/eg-iframe.html
256
257
  - template-min/extjs/ext-all.js
257
258
  - template-min/extjs/resources/themes/images/default/boundlist/trigger-arrow.png
@@ -630,7 +631,7 @@ files:
630
631
  - template-min/mobile-redirect.js
631
632
  - template-min/print-template.html
632
633
  - template-min/README.md
633
- - template-min/resources/css/app-b0e40cf7e8fb751f924fb29f733d5bae.css
634
+ - template-min/resources/css/app-1dec1b800f7fee208bc8260fa2fd1d22.css
634
635
  - template-min/resources/css/reset.css
635
636
  - template-min/resources/css/scrollbars.css
636
637
  - template-min/resources/css/welcome.css