jazzy 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3b6a6bd1f08daea4c0cabeed1607b0c4ab3d70b
4
- data.tar.gz: 69b661bafc0c0cb2f19d9fe01b5d483f0f272d2d
3
+ metadata.gz: f5a0f16d2a7503e43f28a7eff101228617d44ed4
4
+ data.tar.gz: e423b906a68d413d3c8e63ce0c7961b5e88da272
5
5
  SHA512:
6
- metadata.gz: 0b08613b7a92b0dec87e096e979dbe57882ee7fec15a02afab20788b9f127d273d76fdd60b2288928afa5340b82f5a72ba5910e436a395083f14cb73e5d5c3b4
7
- data.tar.gz: 4435f590f247b0dad8f3cbae02727c794a59a3b54595cfa8878c6e8e4c6f6ca59103d286ada3ff35cdd2ffd05575d85718054251526481feb0e7330b12be3a73
6
+ metadata.gz: ceff92f660c07d63dfd1bf95c6b9928c7ab56fbe8ec8899d37d275248510d2a79c691fc8c83cdb5dfe5516926009ddd10162c48e74898a37613be2cbfd043299
7
+ data.tar.gz: 21f47afdaadb40618d31c8b0597c698688adc7c2cd64a152d58d3feea0cf47e5607720ac743730bb5b9191cd970c8fdfb63c5270b8775fe6754e813e04a06985
@@ -1,3 +1,31 @@
1
+ ## 0.9.5
2
+
3
+ ##### Breaking
4
+
5
+ * None.
6
+
7
+ ##### Enhancements
8
+
9
+ * Link to documentation pages from contents pages.
10
+ [John Fairhurst](https://github.com/johnfairh)
11
+ [#730](https://github.com/realm/jazzy/issues/730)
12
+
13
+ * Call out unavailable and deprecated Objective-C declarations.
14
+ [Stefan Kieleithner](https://github.com/steviki)
15
+ [John Fairhurst](https://github.com/johnfairh)
16
+ [#843](https://github.com/realm/jazzy/issues/843)
17
+
18
+ ##### Bug Fixes
19
+
20
+ * Support Swift 4.2 with `--podspec`.
21
+ [John Fairhurst](https://github.com/johnfairh)
22
+ [#1015](https://github.com/realm/jazzy/issues/1015)
23
+
24
+ * Fix multiline copyright for `apple` theme.
25
+ [Fabien Lydoire](https://github.com/fabienlydoire)
26
+ [John Fairhurst](https://github.com/johnfairh)
27
+ [#1016](https://github.com/realm/jazzy/issues/1016)
28
+
1
29
  ## 0.9.4
2
30
 
3
31
  ##### Breaking
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.9.4)
5
- cocoapods (~> 1.0)
6
- mustache (~> 0.99)
4
+ jazzy (0.9.5)
5
+ cocoapods (~> 1.5.3)
6
+ mustache (~> 1.1.0)
7
7
  open4
8
- redcarpet (~> 3.2)
8
+ redcarpet (~> 3.4.0)
9
9
  rouge (>= 2.0.6, < 4.0)
10
- sass (~> 3.4)
11
- sqlite3 (~> 1.3)
10
+ sass (~> 3.6.0)
11
+ sqlite3 (~> 1.3.13)
12
12
  xcinvoke (~> 0.3.0)
13
13
 
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
17
  CFPropertyList (3.0.0)
18
- activesupport (4.2.10)
18
+ activesupport (4.2.11)
19
19
  i18n (~> 0.7)
20
20
  minitest (~> 5.1)
21
21
  thread_safe (~> 0.3, >= 0.3.4)
@@ -23,7 +23,7 @@ GEM
23
23
  addressable (2.5.2)
24
24
  public_suffix (>= 2.0.2, < 4.0)
25
25
  ast (2.4.0)
26
- atomos (0.1.2)
26
+ atomos (0.1.3)
27
27
  bacon (1.2.0)
28
28
  claide (1.0.2)
29
29
  claide-plugins (0.9.2)
@@ -33,10 +33,10 @@ GEM
33
33
  clintegracon (0.7.0)
34
34
  colored (~> 1.2)
35
35
  diffy
36
- cocoapods (1.5.0)
36
+ cocoapods (1.5.3)
37
37
  activesupport (>= 4.0.2, < 5)
38
38
  claide (>= 1.0.2, < 2.0)
39
- cocoapods-core (= 1.5.0)
39
+ cocoapods-core (= 1.5.3)
40
40
  cocoapods-deintegrate (>= 1.0.2, < 2.0)
41
41
  cocoapods-downloader (>= 1.2.0, < 2.0)
42
42
  cocoapods-plugins (>= 1.0.0, < 2.0)
@@ -52,86 +52,86 @@ GEM
52
52
  nap (~> 1.0)
53
53
  ruby-macho (~> 1.1)
54
54
  xcodeproj (>= 1.5.7, < 2.0)
55
- cocoapods-core (1.5.0)
55
+ cocoapods-core (1.5.3)
56
56
  activesupport (>= 4.0.2, < 6)
57
57
  fuzzy_match (~> 2.0.4)
58
58
  nap (~> 1.0)
59
59
  cocoapods-deintegrate (1.0.2)
60
- cocoapods-downloader (1.2.0)
60
+ cocoapods-downloader (1.2.2)
61
61
  cocoapods-plugins (1.0.0)
62
62
  nap
63
63
  cocoapods-search (1.0.0)
64
- cocoapods-stats (1.0.0)
65
- cocoapods-trunk (1.3.0)
64
+ cocoapods-stats (1.1.0)
65
+ cocoapods-trunk (1.3.1)
66
66
  nap (>= 0.8, < 2.0)
67
67
  netrc (~> 0.11)
68
68
  cocoapods-try (1.1.0)
69
69
  colored (1.2)
70
70
  colored2 (3.1.2)
71
- concurrent-ruby (1.0.5)
71
+ concurrent-ruby (1.1.4)
72
72
  cork (0.3.0)
73
73
  colored2 (~> 3.1)
74
74
  crack (0.4.3)
75
75
  safe_yaml (~> 1.0.0)
76
- danger (5.5.12)
76
+ danger (5.11.1)
77
77
  claide (~> 1.0)
78
78
  claide-plugins (>= 0.9.2)
79
79
  colored2 (~> 3.1)
80
80
  cork (~> 0.1)
81
81
  faraday (~> 0.9)
82
82
  faraday-http-cache (~> 1.0)
83
- git (~> 1)
83
+ git (~> 1.5)
84
84
  kramdown (~> 1.5)
85
85
  no_proxy_fix
86
86
  octokit (~> 4.7)
87
87
  terminal-table (~> 1)
88
- diffy (3.2.0)
88
+ diffy (3.3.0)
89
89
  escape (0.0.4)
90
- faraday (0.15.0)
90
+ faraday (0.15.4)
91
91
  multipart-post (>= 1.2, < 3)
92
92
  faraday-http-cache (1.3.1)
93
93
  faraday (~> 0.8)
94
- ffi (1.9.23)
94
+ ffi (1.10.0)
95
95
  fourflusher (2.0.1)
96
96
  fuzzy_match (2.0.4)
97
97
  gh_inspector (1.1.3)
98
- git (1.3.0)
99
- hashdiff (0.3.7)
98
+ git (1.5.0)
99
+ hashdiff (0.3.8)
100
100
  i18n (0.9.5)
101
101
  concurrent-ruby (~> 1.0)
102
- kramdown (1.16.2)
102
+ kramdown (1.17.0)
103
103
  liferaft (0.0.6)
104
104
  metaclass (0.0.4)
105
105
  minitest (5.11.3)
106
- mocha (1.5.0)
106
+ mocha (1.8.0)
107
107
  metaclass (~> 0.0.1)
108
108
  mocha-on-bacon (0.2.3)
109
109
  mocha (>= 0.13.0)
110
- molinillo (0.6.5)
110
+ molinillo (0.6.6)
111
111
  multipart-post (2.0.0)
112
- mustache (0.99.8)
113
- nanaimo (0.2.5)
112
+ mustache (1.1.0)
113
+ nanaimo (0.2.6)
114
114
  nap (1.1.0)
115
115
  netrc (0.11.0)
116
116
  no_proxy_fix (0.1.2)
117
- octokit (4.8.0)
117
+ octokit (4.13.0)
118
118
  sawyer (~> 0.8.0, >= 0.5.3)
119
119
  open4 (1.3.4)
120
- parallel (1.12.1)
121
- parser (2.5.1.0)
120
+ parallel (1.13.0)
121
+ parser (2.6.0.0)
122
122
  ast (~> 2.4.0)
123
- powerpack (0.1.1)
123
+ powerpack (0.1.2)
124
124
  prettybacon (0.0.2)
125
125
  bacon (~> 1.2)
126
- public_suffix (3.0.2)
126
+ public_suffix (3.0.3)
127
127
  rainbow (2.2.2)
128
128
  rake
129
129
  rake (10.5.0)
130
130
  rb-fsevent (0.10.3)
131
- rb-inotify (0.9.10)
132
- ffi (>= 0.5.0, < 2)
131
+ rb-inotify (0.10.0)
132
+ ffi (~> 1.0)
133
133
  redcarpet (3.4.0)
134
- rouge (3.1.1)
134
+ rouge (3.3.0)
135
135
  rubocop (0.49.0)
136
136
  parallel (~> 1.10)
137
137
  parser (>= 2.3.3.1, < 3.0)
@@ -139,10 +139,10 @@ GEM
139
139
  rainbow (>= 1.99.1, < 3.0)
140
140
  ruby-progressbar (~> 1.7)
141
141
  unicode-display_width (~> 1.0, >= 1.0.1)
142
- ruby-macho (1.1.0)
143
- ruby-progressbar (1.9.0)
142
+ ruby-macho (1.3.1)
143
+ ruby-progressbar (1.10.0)
144
144
  safe_yaml (1.0.4)
145
- sass (3.5.6)
145
+ sass (3.6.0)
146
146
  sass-listen (~> 4.0.0)
147
147
  sass-listen (4.0.0)
148
148
  rb-fsevent (~> 0.9, >= 0.9.4)
@@ -156,19 +156,19 @@ GEM
156
156
  thread_safe (0.3.6)
157
157
  tzinfo (1.2.5)
158
158
  thread_safe (~> 0.1)
159
- unicode-display_width (1.3.2)
160
- webmock (3.3.0)
159
+ unicode-display_width (1.4.1)
160
+ webmock (3.5.1)
161
161
  addressable (>= 2.3.6)
162
162
  crack (>= 0.3.2)
163
163
  hashdiff
164
164
  xcinvoke (0.3.0)
165
165
  liferaft (~> 0.0.6)
166
- xcodeproj (1.5.7)
166
+ xcodeproj (1.7.0)
167
167
  CFPropertyList (>= 2.3.3, < 4.0)
168
- atomos (~> 0.1.2)
168
+ atomos (~> 0.1.3)
169
169
  claide (>= 1.0.2, < 2.0)
170
170
  colored2 (~> 3.1)
171
- nanaimo (~> 0.2.4)
171
+ nanaimo (~> 0.2.6)
172
172
 
173
173
  PLATFORMS
174
174
  ruby
@@ -188,4 +188,4 @@ DEPENDENCIES
188
188
  webmock
189
189
 
190
190
  BUNDLED WITH
191
- 1.16.0
191
+ 1.17.3
data/README.md CHANGED
@@ -33,9 +33,8 @@ document. It must be installed in a location indexed by Spotlight for the
33
33
  [sudo] gem install jazzy
34
34
  ```
35
35
 
36
- The Xcode command-line developer tools must be installed to successfully build
37
- the gems that `jazzy` depends on: try `xcode-select --install` if you see build
38
- errors.
36
+ See [Installation Problems](#installation-problems) for solutions to some
37
+ common problems.
39
38
 
40
39
  ## Usage
41
40
 
@@ -166,7 +165,7 @@ Any files found matching the file pattern will be parsed and included as a docum
166
165
 
167
166
  There are a few limitations:
168
167
  - File names must be unique from source files.
169
- - Readme should be specified separately using the `readme_path` option.
168
+ - Readme should be specified separately using the `readme` option.
170
169
 
171
170
  ### Section description abstracts
172
171
 
@@ -220,6 +219,20 @@ Note that the `--include` option is applied before the `--exclude` option. For e
220
219
  Declarations with a documentation comment containing `:nodoc:` are excluded from the
221
220
  documentation.
222
221
 
222
+ ### Choosing the Swift language version
223
+
224
+ Jazzy normally uses the Swift compiler from the Xcode currently configured by
225
+ `xcode-select`. Use the `--swift-version` flag to compile with a different
226
+ Xcode.
227
+
228
+ The value you pass to `--swift-version` must be the Swift language version given
229
+ by `swift --version` in the Xcode you want to use.
230
+
231
+ For example to use Xcode 9.4:
232
+ ```shell
233
+ jazzy --swift-version 4.1.2
234
+ ```
235
+
223
236
  ## Troubleshooting
224
237
 
225
238
  #### Swift
@@ -228,6 +241,33 @@ documentation.
228
241
 
229
242
  Check the `--min-acl` setting -- see [above](#controlling-what-is-documented).
230
243
 
244
+ **Unable to find an Xcode with swift version X**
245
+
246
+ 1. The value passed with `--swift-version` must exactly match the version
247
+ number from `swiftc --version`. For example Xcode 10.1 needs
248
+ `--swift-version 4.2.1`. See [the flag documentation](#choosing-the-swift-language-version).
249
+ 2. The Xcode you want to use must be in the Spotlight index. You can check
250
+ this using `mdfind 'kMDItemCFBundleIdentifier == com.apple.dt.Xcode'`.
251
+ Some users have reported this issue being fixed by a reboot; `mdutil -E`
252
+ may also help. If none of these work then you can set the `DEVELOPER_DIR`
253
+ environment variable to point to the Xcode you want before running Jazzy
254
+ without the `--swift-version` flag.
255
+
256
+ #### Installation Problems
257
+
258
+ **Can't find header files / clang**
259
+
260
+ Some of the Ruby gems that Jazzy depends on have native C extensions. This
261
+ means you need the Xcode command-line developer tools installed to build
262
+ them: run `xcode-select --install` to install the tools.
263
+
264
+ **/Applications/Xcode: No such file or directory**
265
+
266
+ The path of your active Xcode installation must not contain spaces. So
267
+ `/Applications/Xcode.app/` is fine, `/Applications/Xcode-10.2.app/` is fine,
268
+ but `/Applications/Xcode 10.2.app/` is not. This restriction applies only
269
+ when *installing* Jazzy, not running it.
270
+
231
271
  ## Development
232
272
 
233
273
  Please review jazzy's [contributing guidelines](https://github.com/realm/jazzy/blob/master/CONTRIBUTING.md) when submitting pull requests.
Binary file
@@ -17,13 +17,13 @@ Gem::Specification.new do |spec|
17
17
  spec.files = `git ls-files`.split($/)
18
18
  spec.executables << 'jazzy'
19
19
 
20
- spec.add_runtime_dependency 'cocoapods', '~> 1.0'
21
- spec.add_runtime_dependency 'mustache', '~> 0.99'
20
+ spec.add_runtime_dependency 'cocoapods', '~> 1.5.3'
21
+ spec.add_runtime_dependency 'mustache', '~> 1.1.0'
22
22
  spec.add_runtime_dependency 'open4'
23
- spec.add_runtime_dependency 'redcarpet', '~> 3.2'
23
+ spec.add_runtime_dependency 'redcarpet', '~> 3.4.0'
24
24
  spec.add_runtime_dependency 'rouge', ['>= 2.0.6', '< 4.0']
25
- spec.add_runtime_dependency 'sass', '~> 3.4'
26
- spec.add_runtime_dependency 'sqlite3', '~> 1.3'
25
+ spec.add_runtime_dependency 'sass', '~> 3.6.0'
26
+ spec.add_runtime_dependency 'sqlite3', '~> 1.3.13'
27
27
  spec.add_runtime_dependency 'xcinvoke', '~> 0.3.0'
28
28
 
29
29
  spec.add_development_dependency 'bundler', '~> 1.7'
@@ -10,7 +10,6 @@ require 'jazzy/documentation_generator'
10
10
  require 'jazzy/search_builder'
11
11
  require 'jazzy/jazzy_markdown'
12
12
  require 'jazzy/podspec_documenter'
13
- require 'jazzy/readme_generator'
14
13
  require 'jazzy/source_declaration'
15
14
  require 'jazzy/source_document'
16
15
  require 'jazzy/source_module'
@@ -95,7 +94,7 @@ module Jazzy
95
94
 
96
95
  def self.each_doc(output_dir, docs, &block)
97
96
  docs.each do |doc|
98
- next unless doc.render?
97
+ next unless doc.render_as_page?
99
98
  # Assuming URL is relative to documentation root:
100
99
  path = output_dir + (doc.url || "#{doc.name}.html")
101
100
  block.call(doc, path)
@@ -332,6 +331,7 @@ module Jazzy
332
331
  # Build mustache item for a top-level doc
333
332
  # @param [Hash] item Parsed doc child item
334
333
  # @param [Config] options Build options
334
+ # rubocop:disable Metrics/MethodLength
335
335
  def self.render_item(item, source_module)
336
336
  # Combine abstract and discussion into abstract
337
337
  abstract = (item.abstract || '') + (item.discussion || '')
@@ -347,11 +347,16 @@ module Jazzy
347
347
  from_protocol_extension: item.from_protocol_extension,
348
348
  return: item.return,
349
349
  parameters: (item.parameters if item.parameters.any?),
350
- url: (item.url if item.children.any?),
350
+ url: (item.url if item.render_as_page?),
351
351
  start_line: item.start_line,
352
352
  end_line: item.end_line,
353
+ direct_link: item.omit_content_from_parent?,
354
+ deprecation_message: item.deprecation_message,
355
+ unavailable_message: item.unavailable_message,
356
+ usage_discouraged: item.usage_discouraged?,
353
357
  }
354
358
  end
359
+ # rubocop:enable Metrics/MethodLength
355
360
 
356
361
  def self.make_task(mark, uid, items)
357
362
  {
@@ -391,7 +396,7 @@ module Jazzy
391
396
  # @param [Array] doc_structure doc structure comprised of section names and
392
397
  # child names and URLs. @see doc_structure_for_docs
393
398
  def self.document(source_module, doc_model, path_to_root)
394
- if doc_model.type.kind == 'document.markdown'
399
+ if doc_model.type.markdown?
395
400
  return document_markdown(source_module, doc_model, path_to_root)
396
401
  end
397
402
 
@@ -418,6 +423,9 @@ module Jazzy
418
423
  doc[:github_url] = source_module.github_url
419
424
  doc[:dash_url] = source_module.dash_url
420
425
  doc[:path_to_root] = path_to_root
426
+ doc[:deprecation_message] = doc_model.deprecation_message
427
+ doc[:unavailable_message] = doc_model.unavailable_message
428
+ doc[:usage_discouraged] = doc_model.usage_discouraged?
421
429
  doc.render.gsub(ELIDED_AUTOLINK_TOKEN, path_to_root)
422
430
  end
423
431
  # rubocop:enable Metrics/MethodLength
@@ -11,15 +11,8 @@ module Jazzy
11
11
  documentation_entries.map do |file_path|
12
12
  SourceDocument.new.tap do |sd|
13
13
  sd.name = File.basename(file_path, '.md')
14
- sd.url = sd.name.downcase.strip
15
- .tr(' ', '-').gsub(/[^\w-]/, '') + '.html'
16
- sd.type = SourceDeclaration::Type.new 'document.markdown'
17
- sd.children = []
18
14
  sd.overview = overview Pathname(file_path)
19
15
  sd.usr = 'documentation.' + sd.name
20
- sd.abstract = ''
21
- sd.return = ''
22
- sd.parameters = []
23
16
  end
24
17
  end
25
18
  end
@@ -1,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.9.4'.freeze unless defined? Jazzy::VERSION
2
+ VERSION = '0.9.5'.freeze unless defined? Jazzy::VERSION
3
3
  end
@@ -27,7 +27,7 @@ module Jazzy
27
27
 
28
28
  targets.map do |t|
29
29
  args = %W[doc --module-name #{podspec.module_name} -- -target #{t}]
30
- swift_version = (config.swift_version || '4')[0] + '.0'
30
+ swift_version = compiler_swift_version(config.swift_version)
31
31
  args << "SWIFT_VERSION=#{swift_version}"
32
32
  SourceKitten.run_sourcekitten(args)
33
33
  end
@@ -97,6 +97,23 @@ module Jazzy
97
97
 
98
98
  private_class_method :github_file_prefix
99
99
 
100
+ # Latest valid value for SWIFT_VERSION.
101
+ LATEST_SWIFT_VERSION = '4.2'.freeze
102
+
103
+ # All valid values for SWIFT_VERSION that are longer
104
+ # than a major version number. Ordered ascending.
105
+ LONG_SWIFT_VERSIONS = ['4.2'].freeze
106
+
107
+ # Go from a full Swift version like 4.2.1 to
108
+ # something valid for SWIFT_VERSION.
109
+ def compiler_swift_version(user_version)
110
+ return LATEST_SWIFT_VERSION unless user_version
111
+
112
+ LONG_SWIFT_VERSIONS.select do |version|
113
+ user_version.start_with?(version)
114
+ end.last || "#{user_version[0]}.0"
115
+ end
116
+
100
117
  # @!group SourceKitten output helper methods
101
118
 
102
119
  def pod_path
@@ -8,12 +8,15 @@ module Jazzy
8
8
  # static type of declared element (e.g. String.Type -> ())
9
9
  attr_accessor :typename
10
10
 
11
- def type?(type_kind)
12
- respond_to?(:type) && type.kind == type_kind
11
+ # Give the item its own page or just inline into parent?
12
+ def render_as_page?
13
+ children.any?
13
14
  end
14
15
 
15
- def render?
16
- type?('document.markdown') || children.count != 0
16
+ # When referencing this item from its parent category,
17
+ # include the content or just link to it directly?
18
+ def omit_content_from_parent?
19
+ false
17
20
  end
18
21
 
19
22
  # Element containing this declaration in the code
@@ -99,6 +102,14 @@ module Jazzy
99
102
  attr_accessor :end_line
100
103
  attr_accessor :nav_order
101
104
  attr_accessor :url_name
105
+ attr_accessor :deprecated
106
+ attr_accessor :deprecation_message
107
+ attr_accessor :unavailable
108
+ attr_accessor :unavailable_message
109
+
110
+ def usage_discouraged?
111
+ unavailable || deprecated
112
+ end
102
113
 
103
114
  def alternative_abstract
104
115
  if file = alternative_abstract_file
@@ -129,6 +129,16 @@ module Jazzy
129
129
  Type.new('Overview')
130
130
  end
131
131
 
132
+ MARKDOWN_KIND = 'document.markdown'.freeze
133
+
134
+ def self.markdown
135
+ Type.new(MARKDOWN_KIND)
136
+ end
137
+
138
+ def markdown?
139
+ kind == MARKDOWN_KIND
140
+ end
141
+
132
142
  def hash
133
143
  kind.hash
134
144
  end
@@ -140,7 +150,7 @@ module Jazzy
140
150
 
141
151
  TYPES = {
142
152
  # Markdown
143
- 'document.markdown' => {
153
+ MARKDOWN_KIND => {
144
154
  jazzy: 'Guide',
145
155
  dash: 'Guide',
146
156
  }.freeze,
@@ -3,19 +3,35 @@ require 'pathname'
3
3
  require 'jazzy/jazzy_markdown'
4
4
 
5
5
  module Jazzy
6
+ # Standalone markdown docs including index.html
6
7
  class SourceDocument < SourceDeclaration
7
8
  attr_accessor :overview
8
9
  attr_accessor :readme_path
9
10
 
11
+ def initialize
12
+ super
13
+ self.children = []
14
+ self.parameters = []
15
+ self.abstract = ''
16
+ self.type = SourceDeclaration::Type.markdown
17
+ self.mark = SourceMark.new
18
+ end
19
+
10
20
  def self.make_index(readme_path)
11
21
  SourceDocument.new.tap do |sd|
12
22
  sd.name = 'index'
13
- sd.children = []
14
- sd.type = SourceDeclaration::Type.new 'document.markdown'
15
23
  sd.readme_path = readme_path
16
24
  end
17
25
  end
18
26
 
27
+ def render_as_page?
28
+ true
29
+ end
30
+
31
+ def omit_content_from_parent?
32
+ true
33
+ end
34
+
19
35
  def config
20
36
  Config.instance
21
37
  end
@@ -322,6 +322,8 @@ module Jazzy
322
322
  Highlighter.highlight(make_swift_declaration(doc, declaration))
323
323
  end
324
324
 
325
+ make_deprecation_info(doc, declaration)
326
+
325
327
  unless doc['key.doc.full_as_xml']
326
328
  return process_undocumented_token(doc, declaration)
327
329
  end
@@ -335,6 +337,17 @@ module Jazzy
335
337
  @stats.add_documented
336
338
  end
337
339
 
340
+ def self.make_deprecation_info(doc, declaration)
341
+ if declaration.deprecated
342
+ declaration.deprecation_message =
343
+ Markdown.render(doc['key.deprecation_message'] || '')
344
+ end
345
+ if declaration.unavailable
346
+ declaration.unavailable_message =
347
+ Markdown.render(doc['key.unavailable_message'] || '')
348
+ end
349
+ end
350
+
338
351
  # Strip tags and convert entities
339
352
  def self.xml_to_text(xml)
340
353
  document = REXML::Document.new(xml)
@@ -482,6 +495,8 @@ module Jazzy
482
495
  declaration.column = doc['key.doc.column']
483
496
  declaration.start_line = doc['key.parsed_scope.start']
484
497
  declaration.end_line = doc['key.parsed_scope.end']
498
+ declaration.deprecated = doc['key.always_deprecated']
499
+ declaration.unavailable = doc['key.always_unavailable']
485
500
 
486
501
  next unless make_doc_info(doc, declaration)
487
502
  make_substructure(doc, declaration)
@@ -742,28 +757,34 @@ module Jazzy
742
757
  end
743
758
  end
744
759
 
760
+ AUTOLINK_TEXT_FIELDS = %w[return
761
+ abstract
762
+ unavailable_message
763
+ deprecation_message].freeze
764
+
765
+ AUTOLINK_HIGHLIGHT_FIELDS = %w[declaration
766
+ other_language_declaration].freeze
767
+
745
768
  def self.autolink(docs, root_decls)
746
769
  @autolink_root_decls = root_decls
747
770
  docs.each do |doc|
748
771
  doc.children = autolink(doc.children, root_decls)
749
772
 
750
- doc.return = autolink_text(doc.return, doc, root_decls) if doc.return
751
- doc.abstract = autolink_text(doc.abstract, doc, root_decls)
752
- (doc.parameters || []).each do |param|
753
- param[:discussion] =
754
- autolink_text(param[:discussion], doc, root_decls)
773
+ AUTOLINK_TEXT_FIELDS.each do |field|
774
+ if text = doc.send(field)
775
+ doc.send(field + '=', autolink_text(text, doc, root_decls))
776
+ end
755
777
  end
756
778
 
757
- if doc.declaration
758
- doc.declaration = autolink_text(
759
- doc.declaration, doc, root_decls, true
760
- )
779
+ AUTOLINK_HIGHLIGHT_FIELDS.each do |field|
780
+ if text = doc.send(field)
781
+ doc.send(field + '=', autolink_text(text, doc, root_decls, true))
782
+ end
761
783
  end
762
784
 
763
- if doc.other_language_declaration
764
- doc.other_language_declaration = autolink_text(
765
- doc.other_language_declaration, doc, root_decls, true
766
- )
785
+ (doc.parameters || []).each do |param|
786
+ param[:discussion] =
787
+ autolink_text(param[:discussion], doc, root_decls)
767
788
  end
768
789
  end
769
790
  end
@@ -240,7 +240,7 @@ header {
240
240
  margin-left: $content_body_left_offset;
241
241
  position: absolute;
242
242
  overflow: hidden;
243
- padding-bottom: 60px;
243
+ padding-bottom: 20px;
244
244
  top: $content_top_offset;
245
245
  width: $content_wrapper_width - $content_body_left_offset;
246
246
  p, a, code, em, ul, table, blockquote {
@@ -333,11 +333,14 @@ header {
333
333
  background-color: transparent;
334
334
  padding: 0;
335
335
  }
336
- .token {
336
+ .token, .direct-link {
337
337
  padding-left: 3px;
338
338
  margin-left: 15px;
339
339
  font-size: 11.9px;
340
340
  }
341
+ .discouraged {
342
+ text-decoration: line-through;
343
+ }
341
344
  .declaration-note {
342
345
  font-size: .85em;
343
346
  color: rgba(128,128,128,1);
@@ -412,7 +415,7 @@ header {
412
415
  }
413
416
  }
414
417
 
415
- .aside-warning {
418
+ .aside-warning, .aside-deprecated, .aside-unavailable {
416
419
  border-left: $aside_warning_border;
417
420
  .aside-title {
418
421
  color: $aside_warning_color;
@@ -446,8 +449,9 @@ header {
446
449
  }
447
450
 
448
451
  #footer {
449
- position: absolute;
450
- bottom: 10px;
452
+ position: relative;
453
+ top: 10px;
454
+ bottom: 0px;
451
455
  margin-left: 25px;
452
456
  p {
453
457
  margin: 0;
@@ -0,0 +1,12 @@
1
+ {{#deprecation_message}}
2
+ <div class="aside aside-deprecated">
3
+ <p class="aside-title">Deprecated</p>
4
+ {{{deprecation_message}}}
5
+ </div>
6
+ {{/deprecation_message}}
7
+ {{#unavailable_message}}
8
+ <div class="aside aside-unavailable">
9
+ <p class="aside-title">Unavailable</p>
10
+ {{{unavailable_message}}}
11
+ </div>
12
+ {{/unavailable_message}}
@@ -28,6 +28,7 @@
28
28
  <section>
29
29
  <section class="section">
30
30
  {{^hide_name}}<h1>{{name}}</h1>{{/hide_name}}
31
+ {{> deprecation}}
31
32
  {{#declaration}}
32
33
  <div class="declaration">
33
34
  <div class="language">
@@ -15,7 +15,17 @@
15
15
  <code>
16
16
  <a name="/{{usr}}"></a>
17
17
  <a name="//apple_ref/{{language_stub}}/{{dash_type}}/{{name}}" class="dashAnchor"></a>
18
+ {{#direct_link}}
19
+ <a class="direct-link" href="{{url}}">{{name}}</a>
20
+ </code>
21
+ {{/direct_link}}
22
+ {{^direct_link}}
23
+ {{^usage_discouraged}}
18
24
  <a class="token" href="#/{{usr}}">{{name}}</a>
25
+ {{/usage_discouraged}}
26
+ {{#usage_discouraged}}
27
+ <a class="token discouraged" href="#/{{usr}}">{{name}}</a>
28
+ {{/usage_discouraged}}
19
29
  </code>
20
30
  {{#default_impl_abstract}}
21
31
  <span class="declaration-note">
@@ -32,6 +42,7 @@
32
42
  <div class="pointer-container"></div>
33
43
  <section class="section">
34
44
  <div class="pointer"></div>
45
+ {{> deprecation}}
35
46
  {{#abstract}}
36
47
  <div class="abstract">
37
48
  {{{abstract}}}
@@ -85,6 +96,7 @@
85
96
  </div>
86
97
  {{/github_token_url}}
87
98
  </section>
99
+ {{/direct_link}}
88
100
  </div>
89
101
  </li>
90
102
  {{/items}}
@@ -154,8 +154,14 @@ a {
154
154
  outline: 0;
155
155
  text-decoration: underline;
156
156
  }
157
- }
158
157
 
158
+ &.discouraged {
159
+ text-decoration: line-through;
160
+ &:hover, &:focus {
161
+ text-decoration: underline line-through;
162
+ }
163
+ }
164
+ }
159
165
 
160
166
  // ----- Tables
161
167
 
@@ -404,7 +410,7 @@ pre code {
404
410
  }
405
411
  }
406
412
 
407
- .token {
413
+ .token, .direct-link {
408
414
  padding-left: 3px;
409
415
  margin-left: 0px;
410
416
  font-size: 1rem;
@@ -479,7 +485,7 @@ pre code {
479
485
  }
480
486
  }
481
487
 
482
- .aside-warning {
488
+ .aside-warning, .aside-deprecated, .aside-unavailable {
483
489
  border-left: $aside_warning_border;
484
490
  .aside-title {
485
491
  color: $aside_warning_color;
@@ -612,4 +618,4 @@ form[role=search] {
612
618
  .tt-suggestion.tt-cursor .doc-parent-name {
613
619
  color: #fff;
614
620
  }
615
- }
621
+ }
@@ -2,6 +2,7 @@ $(function(){
2
2
  var searchIndex = lunr(function() {
3
3
  this.ref('url');
4
4
  this.field('name');
5
+ this.field('abstract');
5
6
  });
6
7
 
7
8
  var $typeahead = $('[data-typeahead]');
@@ -27,7 +28,7 @@ $(function(){
27
28
 
28
29
  $.getJSON(searchURL).then(function(searchData) {
29
30
  $.each(searchData, function (url, doc) {
30
- searchIndex.add({url: url, name: doc.name});
31
+ searchIndex.add({url: url, name: doc.name, abstract: doc.abstract});
31
32
  });
32
33
 
33
34
  $typeahead.typeahead(
@@ -0,0 +1,12 @@
1
+ {{#deprecation_message}}
2
+ <div class="aside aside-deprecated">
3
+ <p class="aside-title">Deprecated</p>
4
+ {{{deprecation_message}}}
5
+ </div>
6
+ {{/deprecation_message}}
7
+ {{#unavailable_message}}
8
+ <div class="aside aside-unavailable">
9
+ <p class="aside-title">Unavailable</p>
10
+ {{{unavailable_message}}}
11
+ </div>
12
+ {{/unavailable_message}}
@@ -37,6 +37,7 @@
37
37
  <section class="section">
38
38
  <div class="section-content">
39
39
  {{^hide_name}}<h1>{{name}}</h1>{{/hide_name}}
40
+ {{> deprecation}}
40
41
  {{#declaration}}
41
42
  <div class="declaration">
42
43
  <div class="language">
@@ -15,7 +15,17 @@
15
15
  <code>
16
16
  <a name="/{{usr}}"></a>
17
17
  <a name="//apple_ref/{{language_stub}}/{{dash_type}}/{{name}}" class="dashAnchor"></a>
18
+ {{#direct_link}}
19
+ <a class="direct-link" href="{{url}}">{{name}}</a>
20
+ </code>
21
+ {{/direct_link}}
22
+ {{^direct_link}}
23
+ {{^usage_discouraged}}
18
24
  <a class="token" href="#/{{usr}}">{{name}}</a>
25
+ {{/usage_discouraged}}
26
+ {{#usage_discouraged}}
27
+ <a class="token discouraged" href="#/{{usr}}">{{name}}</a>
28
+ {{/usage_discouraged}}
19
29
  </code>
20
30
  {{#default_impl_abstract}}
21
31
  <span class="declaration-note">
@@ -32,6 +42,7 @@
32
42
  <div class="pointer-container"></div>
33
43
  <section class="section">
34
44
  <div class="pointer"></div>
45
+ {{> deprecation}}
35
46
  {{#abstract}}
36
47
  <div class="abstract">
37
48
  {{{abstract}}}
@@ -85,6 +96,7 @@
85
96
  </div>
86
97
  {{/github_token_url}}
87
98
  </section>
99
+ {{/direct_link}}
88
100
  </div>
89
101
  </li>
90
102
  {{/items}}
@@ -372,10 +372,13 @@ header {
372
372
  background-color: transparent;
373
373
  padding: 0;
374
374
  }
375
- .token {
375
+ .token, .direct-link {
376
376
  padding-left: 3px;
377
377
  margin-left: 35px;
378
378
  }
379
+ .discouraged {
380
+ text-decoration: line-through;
381
+ }
379
382
  .declaration-note {
380
383
  font-size: .85em;
381
384
  color: rgba(128,128,128,1);
@@ -448,7 +451,7 @@ header {
448
451
  }
449
452
  }
450
453
 
451
- .aside-warning {
454
+ .aside-warning, .aside-deprecated, .aside-unavailable {
452
455
  border-left: $aside_warning_border;
453
456
  .aside-title {
454
457
  color: $aside_warning_color;
@@ -0,0 +1,12 @@
1
+ {{#deprecation_message}}
2
+ <div class="aside aside-deprecated">
3
+ <p class="aside-title">Deprecated</p>
4
+ {{{deprecation_message}}}
5
+ </div>
6
+ {{/deprecation_message}}
7
+ {{#unavailable_message}}
8
+ <div class="aside aside-unavailable">
9
+ <p class="aside-title">Unavailable</p>
10
+ {{{unavailable_message}}}
11
+ </div>
12
+ {{/unavailable_message}}
@@ -33,6 +33,7 @@
33
33
  <section>
34
34
  <section class="section">
35
35
  {{^hide_name}}<h1>{{name}}</h1>{{/hide_name}}
36
+ {{> deprecation}}
36
37
  {{#declaration}}
37
38
  <div class="declaration">
38
39
  <div class="language">
@@ -15,7 +15,17 @@
15
15
  <code>
16
16
  <a name="/{{usr}}"></a>
17
17
  <a name="//apple_ref/{{language_stub}}/{{dash_type}}/{{name}}" class="dashAnchor"></a>
18
+ {{#direct_link}}
19
+ <a class="direct-link" href="{{url}}">{{name}}</a>
20
+ </code>
21
+ {{/direct_link}}
22
+ {{^direct_link}}
23
+ {{^usage_discouraged}}
18
24
  <a class="token" href="#/{{usr}}">{{name}}</a>
25
+ {{/usage_discouraged}}
26
+ {{#usage_discouraged}}
27
+ <a class="token discouraged" href="#/{{usr}}">{{name}}</a>
28
+ {{/usage_discouraged}}
19
29
  </code>
20
30
  {{#default_impl_abstract}}
21
31
  <span class="declaration-note">
@@ -32,6 +42,7 @@
32
42
  <div class="pointer-container"></div>
33
43
  <section class="section">
34
44
  <div class="pointer"></div>
45
+ {{> deprecation}}
35
46
  {{#abstract}}
36
47
  <div class="abstract">
37
48
  {{{abstract}}}
@@ -85,6 +96,7 @@
85
96
  </div>
86
97
  {{/github_token_url}}
87
98
  </section>
99
+ {{/direct_link}}
88
100
  </div>
89
101
  </li>
90
102
  {{/items}}
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.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - JP Simard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-11-01 00:00:00.000000000 Z
13
+ date: 2019-01-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cocoapods
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.0'
21
+ version: 1.5.3
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.0'
28
+ version: 1.5.3
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: mustache
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: '0.99'
35
+ version: 1.1.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: '0.99'
42
+ version: 1.1.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: open4
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -60,14 +60,14 @@ dependencies:
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: '3.2'
63
+ version: 3.4.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: '3.2'
70
+ version: 3.4.0
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rouge
73
73
  requirement: !ruby/object:Gem::Requirement
@@ -94,28 +94,28 @@ dependencies:
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '3.4'
97
+ version: 3.6.0
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '3.4'
104
+ version: 3.6.0
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: sqlite3
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '1.3'
111
+ version: 1.3.13
112
112
  type: :runtime
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '1.3'
118
+ version: 1.3.13
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: xcinvoke
121
121
  requirement: !ruby/object:Gem::Requirement
@@ -198,7 +198,6 @@ files:
198
198
  - lib/jazzy/highlighter.rb
199
199
  - lib/jazzy/jazzy_markdown.rb
200
200
  - lib/jazzy/podspec_documenter.rb
201
- - lib/jazzy/readme_generator.rb
202
201
  - lib/jazzy/search_builder.rb
203
202
  - lib/jazzy/source_declaration.rb
204
203
  - lib/jazzy/source_declaration/access_control_level.rb
@@ -215,6 +214,7 @@ files:
215
214
  - lib/jazzy/themes/apple/assets/img/gh.png
216
215
  - lib/jazzy/themes/apple/assets/js/jazzy.js
217
216
  - lib/jazzy/themes/apple/assets/js/jquery.min.js
217
+ - lib/jazzy/themes/apple/templates/deprecation.mustache
218
218
  - lib/jazzy/themes/apple/templates/doc.mustache
219
219
  - lib/jazzy/themes/apple/templates/footer.mustache
220
220
  - lib/jazzy/themes/apple/templates/header.mustache
@@ -233,6 +233,7 @@ files:
233
233
  - lib/jazzy/themes/fullwidth/assets/js/jquery.min.js
234
234
  - lib/jazzy/themes/fullwidth/assets/js/lunr.min.js
235
235
  - lib/jazzy/themes/fullwidth/assets/js/typeahead.jquery.js
236
+ - lib/jazzy/themes/fullwidth/templates/deprecation.mustache
236
237
  - lib/jazzy/themes/fullwidth/templates/doc.mustache
237
238
  - lib/jazzy/themes/fullwidth/templates/footer.mustache
238
239
  - lib/jazzy/themes/fullwidth/templates/header.mustache
@@ -247,6 +248,7 @@ files:
247
248
  - lib/jazzy/themes/jony/assets/img/gh.png
248
249
  - lib/jazzy/themes/jony/assets/js/jazzy.js
249
250
  - lib/jazzy/themes/jony/assets/js/jquery.min.js
251
+ - lib/jazzy/themes/jony/templates/deprecation.mustache
250
252
  - lib/jazzy/themes/jony/templates/doc.mustache
251
253
  - lib/jazzy/themes/jony/templates/footer.mustache
252
254
  - lib/jazzy/themes/jony/templates/header.mustache
@@ -278,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
280
  version: '0'
279
281
  requirements: []
280
282
  rubyforge_project:
281
- rubygems_version: 2.6.14.3
283
+ rubygems_version: 2.4.5
282
284
  signing_key:
283
285
  specification_version: 4
284
286
  summary: Soulful docs for Swift & Objective-C.
@@ -1,61 +0,0 @@
1
- require 'pathname'
2
-
3
- require 'jazzy/jazzy_markdown'
4
-
5
- module Jazzy
6
- module ReadmeGenerator
7
- extend Config::Mixin
8
-
9
- def self.generate(source_module)
10
- readme = readme_path
11
-
12
- unless readme && readme.exist? && readme = readme.read
13
- readme = generated_readme(source_module)
14
- end
15
-
16
- Jazzy.markdown.render(readme)
17
- end
18
-
19
- def self.readme_path
20
- return config.readme_path if config.readme_path
21
- %w[README.md README.markdown README.mdown README].each do |potential_name|
22
- file = config.source_directory + potential_name
23
- return file if file.exist?
24
- end
25
- nil
26
- end
27
-
28
- def self.generated_readme(source_module)
29
- if podspec = config.podspec
30
- ### License
31
-
32
- # <a href="#{license[:url]}">#{license[:license]}</a>
33
- <<-EOS
34
- # #{podspec.name}
35
-
36
- ### #{podspec.summary}
37
-
38
- #{podspec.description}
39
-
40
- ### Installation
41
-
42
- ```ruby
43
- pod '#{podspec.name}'
44
- ```
45
-
46
- ### Authors
47
-
48
- #{source_module.author_name}
49
- EOS
50
- else
51
- <<-EOS
52
- # #{source_module.name}
53
-
54
- ### Authors
55
-
56
- #{source_module.author_name}
57
- EOS
58
- end
59
- end
60
- end
61
- end