jazzy 0.13.7 → 0.14.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/Tests.yml +6 -6
  3. data/.rubocop.yml +155 -24
  4. data/CHANGELOG.md +91 -0
  5. data/CONTRIBUTING.md +1 -1
  6. data/Dangerfile +11 -8
  7. data/Gemfile +3 -1
  8. data/Gemfile.lock +85 -64
  9. data/ObjectiveC.md +208 -0
  10. data/README.md +63 -33
  11. data/Rakefile +18 -15
  12. data/bin/jazzy +3 -2
  13. data/bin/sourcekitten +0 -0
  14. data/jazzy.gemspec +9 -6
  15. data/lib/jazzy/config.rb +135 -69
  16. data/lib/jazzy/doc.rb +3 -1
  17. data/lib/jazzy/doc_builder.rb +72 -83
  18. data/lib/jazzy/docset_builder.rb +3 -1
  19. data/lib/jazzy/documentation_generator.rb +6 -2
  20. data/lib/jazzy/executable.rb +3 -0
  21. data/lib/jazzy/extensions/bitbucket/img/bitbucket.svg +11 -0
  22. data/lib/jazzy/{themes/apple/assets → extensions/github}/img/gh.png +0 -0
  23. data/lib/jazzy/extensions/gitlab/img/gitlab.svg +23 -0
  24. data/lib/jazzy/gem_version.rb +3 -1
  25. data/lib/jazzy/highlighter.rb +5 -3
  26. data/lib/jazzy/jazzy_markdown.rb +75 -32
  27. data/lib/jazzy/podspec_documenter.rb +14 -16
  28. data/lib/jazzy/search_builder.rb +5 -6
  29. data/lib/jazzy/source_declaration/access_control_level.rb +7 -5
  30. data/lib/jazzy/source_declaration/type.rb +29 -3
  31. data/lib/jazzy/source_declaration.rb +22 -5
  32. data/lib/jazzy/source_document.rb +8 -5
  33. data/lib/jazzy/source_host.rb +111 -0
  34. data/lib/jazzy/source_mark.rb +8 -6
  35. data/lib/jazzy/source_module.rb +6 -6
  36. data/lib/jazzy/sourcekitten.rb +155 -81
  37. data/lib/jazzy/stats.rb +14 -3
  38. data/lib/jazzy/symbol_graph/constraint.rb +5 -1
  39. data/lib/jazzy/symbol_graph/ext_node.rb +3 -1
  40. data/lib/jazzy/symbol_graph/graph.rb +19 -12
  41. data/lib/jazzy/symbol_graph/relationship.rb +9 -0
  42. data/lib/jazzy/symbol_graph/sym_node.rb +25 -7
  43. data/lib/jazzy/symbol_graph/symbol.rb +54 -25
  44. data/lib/jazzy/symbol_graph.rb +43 -32
  45. data/lib/jazzy/themes/apple/assets/css/highlight.css.scss +63 -59
  46. data/lib/jazzy/themes/apple/assets/css/jazzy.css.scss +5 -1
  47. data/lib/jazzy/themes/apple/assets/js/jazzy.js +4 -0
  48. data/lib/jazzy/themes/apple/assets/js/jazzy.search.js +4 -0
  49. data/lib/jazzy/themes/apple/templates/doc.mustache +4 -5
  50. data/lib/jazzy/themes/apple/templates/footer.mustache +1 -1
  51. data/lib/jazzy/themes/apple/templates/header.mustache +6 -6
  52. data/lib/jazzy/themes/apple/templates/task.mustache +6 -11
  53. data/lib/jazzy/themes/fullwidth/assets/css/highlight.css.scss +63 -59
  54. data/lib/jazzy/themes/fullwidth/assets/css/jazzy.css.scss +6 -2
  55. data/lib/jazzy/themes/fullwidth/assets/js/jazzy.js +4 -0
  56. data/lib/jazzy/themes/fullwidth/assets/js/jazzy.search.js +4 -0
  57. data/lib/jazzy/themes/fullwidth/templates/doc.mustache +4 -5
  58. data/lib/jazzy/themes/fullwidth/templates/footer.mustache +1 -1
  59. data/lib/jazzy/themes/fullwidth/templates/header.mustache +8 -8
  60. data/lib/jazzy/themes/fullwidth/templates/task.mustache +6 -11
  61. data/lib/jazzy/themes/jony/assets/css/highlight.css.scss +63 -59
  62. data/lib/jazzy/themes/jony/assets/css/jazzy.css.scss +5 -1
  63. data/lib/jazzy/themes/jony/assets/js/jazzy.js +4 -0
  64. data/lib/jazzy/themes/jony/templates/doc.mustache +4 -5
  65. data/lib/jazzy/themes/jony/templates/footer.mustache +1 -1
  66. data/lib/jazzy/themes/jony/templates/header.mustache +6 -6
  67. data/lib/jazzy/themes/jony/templates/task.mustache +6 -11
  68. data/lib/jazzy.rb +2 -0
  69. data/spec/integration_spec.rb +46 -42
  70. data/spec/spec_helper/pre_flight.rb +2 -0
  71. data/spec/spec_helper.rb +3 -1
  72. metadata +32 -16
  73. data/lib/jazzy/themes/fullwidth/assets/img/gh.png +0 -0
  74. data/lib/jazzy/themes/jony/assets/img/gh.png +0 -0
  75. data/spec/sourcekitten_spec.rb +0 -6
@@ -28,16 +28,11 @@
28
28
  <a class="token discouraged" href="#/{{usr}}">{{{name_html}}}</a>
29
29
  {{/usage_discouraged}}
30
30
  </code>
31
- {{#default_impl_abstract}}
31
+ {{#declaration_note}}
32
32
  <span class="declaration-note">
33
- Default implementation
33
+ {{.}}
34
34
  </span>
35
- {{/default_impl_abstract}}
36
- {{#from_protocol_extension}}
37
- <span class="declaration-note">
38
- Extension method
39
- </span>
40
- {{/from_protocol_extension}}
35
+ {{/declaration_note}}
41
36
  </div>
42
37
  <div class="height-container">
43
38
  <div class="pointer-container"></div>
@@ -91,11 +86,11 @@
91
86
  {{{return}}}
92
87
  </div>
93
88
  {{/return}}
94
- {{#github_token_url}}
89
+ {{#source_host_item_url}}
95
90
  <div class="slightly-smaller">
96
- <a href="{{{github_token_url}}}">Show on GitHub</a>
91
+ <a href="{{{.}}}">Show on {{source_host_name}}</a>
97
92
  </div>
98
- {{/github_token_url}}
93
+ {{/source_host_item_url}}
99
94
  </section>
100
95
  {{/direct_link}}
101
96
  </div>
data/lib/jazzy.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'jazzy/config'
2
4
  require 'jazzy/doc_builder'
3
5
 
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
 
2
3
  # ------------------------------------ #
3
4
  # Jazzy Integration tests #
@@ -39,7 +40,7 @@
39
40
 
40
41
  # @return [Pathname] The root of the repo.
41
42
  #
42
- ROOT = Pathname.new(File.expand_path('../../', __FILE__)) unless defined? ROOT
43
+ ROOT = Pathname.new(File.expand_path('..', __dir__)) unless defined? ROOT
43
44
  $:.unshift((ROOT + 'spec').to_s)
44
45
 
45
46
  require 'rubygems'
@@ -84,9 +85,8 @@ CLIntegracon.configure do |c|
84
85
 
85
86
  # Transform produced databases to csv
86
87
  c.transform_produced '**/*.dsidx' do |path|
87
- File.open("#{path}.csv", 'w') do |file|
88
- file.write `sqlite3 -header -csv #{path} "select * from searchIndex;"`
89
- end
88
+ File.write("#{path}.csv",
89
+ `sqlite3 -header -csv #{path} "select * from searchIndex;"`)
90
90
  end
91
91
  # Now that we're comparing the CSV, we don't care about the binary
92
92
  c.ignores '**/*.dsidx'
@@ -98,15 +98,15 @@ describe_cli 'jazzy' do
98
98
  subject do |s|
99
99
  s.executable = "ruby #{ROOT + 'bin/jazzy'}"
100
100
  s.environment_vars = {
101
- 'JAZZY_FAKE_DATE' => 'YYYY-MM-DD',
102
- 'JAZZY_FAKE_VERSION' => 'X.X.X',
101
+ 'JAZZY_FAKE_DATE' => 'YYYY-MM-DD',
102
+ 'JAZZY_FAKE_VERSION' => 'X.X.X',
103
103
  'COCOAPODS_SKIP_UPDATE_MESSAGE' => 'TRUE',
104
104
  'JAZZY_INTEGRATION_SPECS' => 'TRUE',
105
105
  'JAZZY_FAKE_MODULE_VERSION' => 'Y.Y.Y',
106
106
  }
107
107
  s.default_args = []
108
108
  s.replace_path ROOT.to_s, 'ROOT'
109
- s.replace_pattern /^[\d\s:.-]+ ruby\[\d+:\d+\] warning:.*$[\n]?/, ''
109
+ s.replace_pattern /^[\d\s:.-]+ ruby\[\d+:\d+\] warning:.*$\n?/, ''
110
110
  # Remove version numbers from CocoaPods dependencies
111
111
  # to make specs resilient against dependecy updates.
112
112
  s.replace_pattern(/(Installing \w+ )\((.*)\)/, '\1(X.Y.Z)')
@@ -148,19 +148,19 @@ describe_cli 'jazzy' do
148
148
  end
149
149
  behaves_like cli_spec 'document_realm_objc',
150
150
  '--objc ' \
151
- '--author Realm ' \
152
- '--author_url "https://realm.io" ' \
153
- '--github_url ' \
154
- 'https://github.com/realm/realm-cocoa ' \
155
- '--github-file-prefix https://github.com/realm/' \
156
- "realm-cocoa/tree/v#{realm_version} " \
157
- '--module Realm ' \
158
- "--module-version #{realm_version} " \
159
- '--root-url https://realm.io/docs/objc/' \
160
- "#{realm_version}/api/ " \
161
- '--umbrella-header Realm/Realm.h ' \
162
- '--framework-root . ' \
163
- "--head #{realm_head.shellescape}"
151
+ '--author Realm ' \
152
+ '--author_url "https://realm.io" ' \
153
+ '--source-host-url ' \
154
+ 'https://github.com/realm/realm-cocoa ' \
155
+ '--source-host-files-url https://github.com/realm/' \
156
+ "realm-cocoa/tree/v#{realm_version} " \
157
+ '--module Realm ' \
158
+ "--module-version #{realm_version} " \
159
+ '--root-url https://realm.io/docs/objc/' \
160
+ "#{realm_version}/api/ " \
161
+ '--umbrella-header Realm/Realm.h ' \
162
+ '--framework-root . ' \
163
+ "--head #{realm_head.shellescape}"
164
164
  end
165
165
 
166
166
  describe 'Creates docs for ObjC-Swift project with a variety of contents' do
@@ -169,17 +169,17 @@ describe_cli 'jazzy' do
169
169
  sourcekitten = ROOT + 'bin/sourcekitten'
170
170
  sdk = `xcrun --show-sdk-path --sdk iphonesimulator`.chomp
171
171
  objc_args = "#{base}/MiscJazzyObjCFeatures/MiscJazzyObjCFeatures.h " \
172
- '-- -x objective-c ' \
173
- "-isysroot #{sdk} " \
174
- "-I #{base} " \
175
- '-fmodules'
172
+ '-- -x objective-c ' \
173
+ "-isysroot #{sdk} " \
174
+ "-I #{base} " \
175
+ '-fmodules'
176
176
  `#{sourcekitten} doc --objc #{objc_args} > objc.json`
177
177
  `#{sourcekitten} doc -- clean build > swift.json`
178
178
  end
179
179
 
180
180
  behaves_like cli_spec 'misc_jazzy_objc_features',
181
181
  '--theme fullwidth '\
182
- '-s objc.json,swift.json'
182
+ '-s objc.json,swift.json'
183
183
  end
184
184
  end if !spec_subset || spec_subset == 'objc'
185
185
 
@@ -187,9 +187,10 @@ describe_cli 'jazzy' do
187
187
  describe 'Creates docs with a module name, author name, project URL, ' \
188
188
  'xcodebuild options, and github info' do
189
189
  behaves_like cli_spec 'document_alamofire',
190
- '--skip-undocumented',
191
- # Ignore existing docs output
192
- '--clean'
190
+ '--skip-undocumented ' \
191
+ '--clean ' \
192
+ '--xcodebuild-arguments ' \
193
+ "-destination,'platform=OS X'"
193
194
  end
194
195
 
195
196
  describe 'Creates Realm Swift docs' do
@@ -199,18 +200,19 @@ describe_cli 'jazzy' do
199
200
  end
200
201
  behaves_like cli_spec 'document_realm_swift',
201
202
  '--author Realm ' \
202
- '--author_url "https://realm.io" ' \
203
- '--github_url ' \
204
- 'https://github.com/realm/realm-cocoa ' \
205
- '--github-file-prefix https://github.com/realm/' \
206
- "realm-cocoa/tree/v#{realm_version} " \
207
- '--module RealmSwift ' \
208
- "--module-version #{realm_version} " \
209
- '--root-url https://realm.io/docs/swift/' \
210
- "#{realm_version}/api/ " \
211
- '--xcodebuild-arguments ' \
212
- '-scheme,RealmSwift,SWIFT_VERSION=4.2 ' \
213
- "--head #{realm_head.shellescape}"
203
+ '--author_url "https://realm.io" ' \
204
+ '--source-host-url ' \
205
+ 'https://github.com/realm/realm-cocoa ' \
206
+ '--source-host-files-url https://github.com/realm/' \
207
+ "realm-cocoa/tree/v#{realm_version} " \
208
+ '--module RealmSwift ' \
209
+ "--module-version #{realm_version} " \
210
+ '--root-url https://realm.io/docs/swift/' \
211
+ "#{realm_version}/api/ " \
212
+ '--xcodebuild-arguments ' \
213
+ '-scheme,RealmSwift,SWIFT_VERSION=4.2,' \
214
+ "-destination,'platform=OS X' " \
215
+ "--head #{realm_head.shellescape}"
214
216
  end
215
217
 
216
218
  describe 'Creates Siesta docs' do
@@ -218,7 +220,7 @@ describe_cli 'jazzy' do
218
220
  # Use the default Swift version rather than the specified 4.0
219
221
  behaves_like cli_spec 'document_siesta',
220
222
  '--output api-docs ' \
221
- '--swift-version= '
223
+ '--swift-version= '
222
224
  end
223
225
 
224
226
  describe 'Creates docs for Swift project with a variety of contents' do
@@ -233,7 +235,7 @@ describe_cli 'jazzy' do
233
235
  module_path = `swift build --build-path #{build_path} --show-bin-path`
234
236
  behaves_like cli_spec 'misc_jazzy_symgraph_features',
235
237
  '--swift-build-tool symbolgraph ' \
236
- "--build-tool-arguments -I=#{module_path} "
238
+ "--build-tool-arguments -I,#{module_path} "
237
239
  end
238
240
  end if !spec_subset || spec_subset == 'swift'
239
241
 
@@ -244,4 +246,6 @@ describe_cli 'jazzy' do
244
246
  '--podspec=Moya.podspec'
245
247
  end
246
248
  end if !spec_subset || spec_subset == 'cocoapods'
249
+
250
+ # rubocop:enable Style/MultilineIfModifier
247
251
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Restores the config to the default state before each requirement
2
4
 
3
5
  module Bacon
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler/setup'
3
5
  require 'bacon'
@@ -5,7 +7,7 @@ require 'mocha-on-bacon'
5
7
  require 'pretty_bacon'
6
8
  require 'pathname'
7
9
 
8
- ROOT = Pathname.new(File.expand_path('../../', __FILE__))
10
+ ROOT = Pathname.new(File.expand_path('..', __dir__))
9
11
  $LOAD_PATH.unshift((ROOT + 'lib').to_s)
10
12
  $LOAD_PATH.unshift((ROOT + 'spec').to_s)
11
13
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jazzy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.7
4
+ version: 0.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Simard
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-05-06 00:00:00.000000000 Z
14
+ date: 2022-03-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods
@@ -45,16 +45,16 @@ dependencies:
45
45
  name: open4
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ">="
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
- version: '0'
50
+ version: '1.3'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
- version: '0'
57
+ version: '1.3'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: redcarpet
60
60
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +69,20 @@ dependencies:
69
69
  - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: '3.4'
72
+ - !ruby/object:Gem::Dependency
73
+ name: rexml
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - "~>"
77
+ - !ruby/object:Gem::Version
78
+ version: '3.2'
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '3.2'
72
86
  - !ruby/object:Gem::Dependency
73
87
  name: rouge
74
88
  requirement: !ruby/object:Gem::Requirement
@@ -137,14 +151,14 @@ dependencies:
137
151
  requirements:
138
152
  - - "~>"
139
153
  - !ruby/object:Gem::Version
140
- version: '1.7'
154
+ version: '2.1'
141
155
  type: :development
142
156
  prerelease: false
143
157
  version_requirements: !ruby/object:Gem::Requirement
144
158
  requirements:
145
159
  - - "~>"
146
160
  - !ruby/object:Gem::Version
147
- version: '1.7'
161
+ version: '2.1'
148
162
  - !ruby/object:Gem::Dependency
149
163
  name: rake
150
164
  requirement: !ruby/object:Gem::Requirement
@@ -159,8 +173,8 @@ dependencies:
159
173
  - - "~>"
160
174
  - !ruby/object:Gem::Version
161
175
  version: '13.0'
162
- description: Soulful docs for Swift & Objective-C. Run in your Xcode project's root
163
- directory for instant HTML docs.
176
+ description: Soulful docs for Swift & Objective-C. Run in your SPM or Xcode project's
177
+ root directory for instant HTML docs.
164
178
  email:
165
179
  - jp@jpsim.com
166
180
  executables:
@@ -178,6 +192,7 @@ files:
178
192
  - Gemfile
179
193
  - Gemfile.lock
180
194
  - LICENSE
195
+ - ObjectiveC.md
181
196
  - README.md
182
197
  - Rakefile
183
198
  - bin/jazzy
@@ -198,6 +213,9 @@ files:
198
213
  - lib/jazzy/docset_builder/info_plist.mustache
199
214
  - lib/jazzy/documentation_generator.rb
200
215
  - lib/jazzy/executable.rb
216
+ - lib/jazzy/extensions/bitbucket/img/bitbucket.svg
217
+ - lib/jazzy/extensions/github/img/gh.png
218
+ - lib/jazzy/extensions/gitlab/img/gitlab.svg
201
219
  - lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.ttf
202
220
  - lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.woff
203
221
  - lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.woff2
@@ -269,6 +287,7 @@ files:
269
287
  - lib/jazzy/source_declaration/access_control_level.rb
270
288
  - lib/jazzy/source_declaration/type.rb
271
289
  - lib/jazzy/source_document.rb
290
+ - lib/jazzy/source_host.rb
272
291
  - lib/jazzy/source_mark.rb
273
292
  - lib/jazzy/source_module.rb
274
293
  - lib/jazzy/sourcekitten.rb
@@ -284,7 +303,6 @@ files:
284
303
  - lib/jazzy/themes/apple/assets/css/jazzy.css.scss
285
304
  - lib/jazzy/themes/apple/assets/img/carat.png
286
305
  - lib/jazzy/themes/apple/assets/img/dash.png
287
- - lib/jazzy/themes/apple/assets/img/gh.png
288
306
  - lib/jazzy/themes/apple/assets/img/spinner.gif
289
307
  - lib/jazzy/themes/apple/assets/js/jazzy.js
290
308
  - lib/jazzy/themes/apple/assets/js/jazzy.search.js
@@ -303,7 +321,6 @@ files:
303
321
  - lib/jazzy/themes/fullwidth/assets/css/jazzy.css.scss
304
322
  - lib/jazzy/themes/fullwidth/assets/img/carat.png
305
323
  - lib/jazzy/themes/fullwidth/assets/img/dash.png
306
- - lib/jazzy/themes/fullwidth/assets/img/gh.png
307
324
  - lib/jazzy/themes/fullwidth/assets/img/spinner.gif
308
325
  - lib/jazzy/themes/fullwidth/assets/js/jazzy.js
309
326
  - lib/jazzy/themes/fullwidth/assets/js/jazzy.search.js
@@ -322,7 +339,6 @@ files:
322
339
  - lib/jazzy/themes/jony/assets/css/jazzy.css.scss
323
340
  - lib/jazzy/themes/jony/assets/img/carat.png
324
341
  - lib/jazzy/themes/jony/assets/img/dash.png
325
- - lib/jazzy/themes/jony/assets/img/gh.png
326
342
  - lib/jazzy/themes/jony/assets/js/jazzy.js
327
343
  - lib/jazzy/themes/jony/assets/js/jquery.min.js
328
344
  - lib/jazzy/themes/jony/templates/deprecation.mustache
@@ -334,13 +350,13 @@ files:
334
350
  - lib/jazzy/themes/jony/templates/task.mustache
335
351
  - lib/jazzy/themes/jony/templates/tasks.mustache
336
352
  - spec/integration_spec.rb
337
- - spec/sourcekitten_spec.rb
338
353
  - spec/spec_helper.rb
339
354
  - spec/spec_helper/pre_flight.rb
340
355
  homepage: https://github.com/realm/jazzy
341
356
  licenses:
342
357
  - MIT
343
- metadata: {}
358
+ metadata:
359
+ rubygems_mfa_required: 'true'
344
360
  post_install_message:
345
361
  rdoc_options: []
346
362
  require_paths:
@@ -349,7 +365,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
349
365
  requirements:
350
366
  - - ">="
351
367
  - !ruby/object:Gem::Version
352
- version: 2.0.0
368
+ version: 2.6.3
353
369
  required_rubygems_version: !ruby/object:Gem::Requirement
354
370
  requirements:
355
371
  - - ">="
@@ -1,6 +0,0 @@
1
- require File.expand_path('../spec_helper', __FILE__)
2
-
3
- module Jazzy
4
- describe SourceKitten do
5
- end
6
- end