jazzy 0.9.4 → 0.11.1

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.
Files changed (49) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +3 -3
  3. data/CHANGELOG.md +162 -0
  4. data/CONTRIBUTING.md +1 -1
  5. data/Gemfile.lock +67 -70
  6. data/README.md +92 -13
  7. data/Rakefile +7 -6
  8. data/bin/sourcekitten +0 -0
  9. data/jazzy.gemspec +4 -4
  10. data/lib/jazzy/config.rb +38 -5
  11. data/lib/jazzy/doc.rb +19 -2
  12. data/lib/jazzy/doc_builder.rb +22 -24
  13. data/lib/jazzy/docset_builder.rb +1 -1
  14. data/lib/jazzy/documentation_generator.rb +0 -7
  15. data/lib/jazzy/gem_version.rb +1 -1
  16. data/lib/jazzy/jazzy_markdown.rb +1 -1
  17. data/lib/jazzy/podspec_documenter.rb +36 -9
  18. data/lib/jazzy/source_declaration.rb +19 -4
  19. data/lib/jazzy/source_declaration/access_control_level.rb +10 -3
  20. data/lib/jazzy/source_declaration/type.rb +11 -1
  21. data/lib/jazzy/source_document.rb +21 -4
  22. data/lib/jazzy/sourcekitten.rb +69 -35
  23. data/lib/jazzy/themes/apple/assets/css/jazzy.css.scss +13 -5
  24. data/lib/jazzy/themes/apple/assets/js/jazzy.js +33 -20
  25. data/lib/jazzy/themes/apple/assets/js/jquery.min.js +2 -4
  26. data/lib/jazzy/themes/apple/templates/deprecation.mustache +12 -0
  27. data/lib/jazzy/themes/apple/templates/doc.mustache +1 -0
  28. data/lib/jazzy/themes/apple/templates/header.mustache +1 -1
  29. data/lib/jazzy/themes/apple/templates/task.mustache +12 -0
  30. data/lib/jazzy/themes/fullwidth/assets/css/jazzy.css.scss +10 -4
  31. data/lib/jazzy/themes/fullwidth/assets/js/jazzy.js +33 -17
  32. data/lib/jazzy/themes/fullwidth/assets/js/jazzy.search.js +17 -9
  33. data/lib/jazzy/themes/fullwidth/assets/js/jquery.min.js +2 -4
  34. data/lib/jazzy/themes/fullwidth/assets/js/lunr.min.js +1 -6
  35. data/lib/jazzy/themes/fullwidth/assets/js/typeahead.jquery.js +182 -46
  36. data/lib/jazzy/themes/fullwidth/templates/deprecation.mustache +12 -0
  37. data/lib/jazzy/themes/fullwidth/templates/doc.mustache +1 -0
  38. data/lib/jazzy/themes/fullwidth/templates/header.mustache +1 -1
  39. data/lib/jazzy/themes/fullwidth/templates/task.mustache +12 -0
  40. data/lib/jazzy/themes/jony/assets/css/jazzy.css.scss +9 -2
  41. data/lib/jazzy/themes/jony/assets/js/jazzy.js +33 -21
  42. data/lib/jazzy/themes/jony/assets/js/jquery.min.js +2 -4
  43. data/lib/jazzy/themes/jony/templates/deprecation.mustache +12 -0
  44. data/lib/jazzy/themes/jony/templates/doc.mustache +1 -0
  45. data/lib/jazzy/themes/jony/templates/header.mustache +1 -1
  46. data/lib/jazzy/themes/jony/templates/task.mustache +12 -0
  47. data/spec/integration_spec.rb +7 -12
  48. metadata +15 -13
  49. data/lib/jazzy/readme_generator.rb +0 -61
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Both Swift and Objective-C projects are supported.
10
10
 
11
- *Objective-C support was recently added, so please report any issues you find.*
11
+ *SwiftPM support was recently added, so please report any issues you find.*
12
12
 
13
13
  Instead of parsing your source files, `jazzy` hooks into [Clang][clang] and
14
14
  [SourceKit][sourcekit] to use the [AST][ast] representation of your code and
@@ -23,9 +23,11 @@ unacceptable behavior to [info@realm.io](mailto:info@realm.io).
23
23
 
24
24
  ## Requirements
25
25
 
26
- * A version of [Xcode][xcode] capable of building the project you wish to
27
- document. It must be installed in a location indexed by Spotlight for the
28
- `--swift-version` configuration option to succeed.
26
+ You need development tools to build the project you wish to document. Jazzy supports
27
+ both [Xcode][xcode] and [Swift Package Manager][spm] projects.
28
+
29
+ Jazzy expects to be running on __macOS__. See [below](#linux) for tips to run Jazzy
30
+ on Linux.
29
31
 
30
32
  ## Installation
31
33
 
@@ -33,17 +35,17 @@ document. It must be installed in a location indexed by Spotlight for the
33
35
  [sudo] gem install jazzy
34
36
  ```
35
37
 
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.
38
+ See [Installation Problems](#installation-problems) for solutions to some
39
+ common problems.
39
40
 
40
41
  ## Usage
41
42
 
42
43
  Run `jazzy` from your command line. Run `jazzy -h` for a list of additional options.
43
44
 
44
45
  If your Swift module is the first thing to build, and it builds fine when running
45
- `xcodebuild` without any arguments from the root of your project, then just running
46
- `jazzy` (without any arguments) from the root of your project should succeed too!
46
+ `xcodebuild` or `swift build` without any arguments from the root of your project, then
47
+ just running `jazzy` (without any arguments) from the root of your project should
48
+ succeed too!
47
49
 
48
50
  You can set options for your project’s documentation in a configuration file,
49
51
  `.jazzy.yaml` by default. For a detailed explanation and an exhaustive list of
@@ -84,13 +86,22 @@ jazzy \
84
86
  --github_url https://github.com/realm/realm-cocoa \
85
87
  --github-file-prefix https://github.com/realm/realm-cocoa/tree/v0.96.2 \
86
88
  --module-version 0.96.2 \
87
- --xcodebuild-arguments -scheme,RealmSwift \
89
+ --build-tool-arguments -scheme,RealmSwift \
88
90
  --module RealmSwift \
89
91
  --root-url https://realm.io/docs/swift/0.96.2/api/ \
90
92
  --output docs/swift_output \
91
93
  --theme docs/themes
92
94
  ```
93
95
 
96
+ This is how docs are generated for a project that uses the Swift Package Manager:
97
+
98
+ ```shell
99
+ jazzy \
100
+ --module DeckOfPlayingCards \
101
+ --swift-build-tool spm \
102
+ --build-tool-arguments -Xswiftc,-swift-version,-Xswiftc,5
103
+ ```
104
+
94
105
  ### Objective-C
95
106
 
96
107
  To generate documentation for Objective-C headers, you must pass the following
@@ -117,7 +128,7 @@ jazzy \
117
128
  --github_url https://github.com/realm/realm-cocoa \
118
129
  --github-file-prefix https://github.com/realm/realm-cocoa/tree/v2.2.0 \
119
130
  --module-version 2.2.0 \
120
- --xcodebuild-arguments --objc,Realm/Realm.h,--,-x,objective-c,-isysroot,$(xcrun --show-sdk-path),-I,$(pwd) \
131
+ --build-tool-arguments --objc,Realm/Realm.h,--,-x,objective-c,-isysroot,$(xcrun --show-sdk-path),-I,$(pwd) \
121
132
  --module Realm \
122
133
  --root-url https://realm.io/docs/objc/2.2.0/api/ \
123
134
  --output docs/objc_output \
@@ -166,7 +177,7 @@ Any files found matching the file pattern will be parsed and included as a docum
166
177
 
167
178
  There are a few limitations:
168
179
  - File names must be unique from source files.
169
- - Readme should be specified separately using the `readme_path` option.
180
+ - Readme should be specified separately using the `readme` option.
170
181
 
171
182
  ### Section description abstracts
172
183
 
@@ -220,14 +231,81 @@ Note that the `--include` option is applied before the `--exclude` option. For e
220
231
  Declarations with a documentation comment containing `:nodoc:` are excluded from the
221
232
  documentation.
222
233
 
234
+ ### Choosing the Swift language version
235
+
236
+ Jazzy normally uses the Swift compiler from the Xcode currently configured by
237
+ `xcode-select`. Use the `--swift-version` flag to compile with a different
238
+ Xcode.
239
+
240
+ The value you pass to `--swift-version` must be the Swift language version given
241
+ by `swift --version` in the Xcode you want to use.
242
+
243
+ For example to use Xcode 9.4:
244
+ ```shell
245
+ jazzy --swift-version 4.1.2
246
+ ```
247
+
248
+ ## Linux
249
+
250
+ Jazzy uses [SourceKitten][sourcekitten] to communicate with the Swift build
251
+ environment and compiler. The `sourcekitten` binary included in the Jazzy gem
252
+ is built for macOS and so does not run on other operating systems.
253
+
254
+ To use Jazzy on Linux you first need to install and build `sourcekitten`
255
+ following instructions from [SourceKitten's GitHub repository][sourcekitten].
256
+
257
+ Then to generate documentation for a SwiftPM project, instead of running just
258
+ `jazzy` do:
259
+ ```shell
260
+ sourcekitten doc --spm > doc.json
261
+ jazzy --sourcekitten-sourcefile doc.json
262
+ ```
263
+
264
+ We hope to improve this process in the future.
265
+
223
266
  ## Troubleshooting
224
267
 
225
- #### Swift
268
+ ### Swift
226
269
 
227
270
  **Only extensions are listed in the documentation?**
228
271
 
229
272
  Check the `--min-acl` setting -- see [above](#controlling-what-is-documented).
230
273
 
274
+ **Unable to find an Xcode with swift version X**
275
+
276
+ 1. The value passed with `--swift-version` must exactly match the version
277
+ number from `swiftc --version`. For example Xcode 10.1 needs
278
+ `--swift-version 4.2.1`. See [the flag documentation](#choosing-the-swift-language-version).
279
+ 2. The Xcode you want to use must be in the Spotlight index. You can check
280
+ this using `mdfind 'kMDItemCFBundleIdentifier == com.apple.dt.Xcode'`.
281
+ Some users have reported this issue being fixed by a reboot; `mdutil -E`
282
+ may also help. If none of these work then you can set the `DEVELOPER_DIR`
283
+ environment variable to point to the Xcode you want before running Jazzy
284
+ without the `--swift-version` flag.
285
+
286
+ ### Installation Problems
287
+
288
+ **Can't find header files / clang**
289
+
290
+ Some of the Ruby gems that Jazzy depends on have native C extensions. This
291
+ means you need the Xcode command-line developer tools installed to build
292
+ them: run `xcode-select --install` to install the tools.
293
+
294
+ **/Applications/Xcode: No such file or directory**
295
+
296
+ The path of your active Xcode installation must not contain spaces. So
297
+ `/Applications/Xcode.app/` is fine, `/Applications/Xcode-10.2.app/` is fine,
298
+ but `/Applications/Xcode 10.2.app/` is not. This restriction applies only
299
+ when *installing* Jazzy, not running it.
300
+
301
+ ### MacOS Before 10.14.4
302
+
303
+ Starting with Jazzy 0.10.0, if you see an error similar to `dyld: Symbol not found: _$s11SubSequenceSlTl` then you need to install the [Swift 5 Runtime Support for Command Line Tools](https://support.apple.com/kb/DL1998).
304
+
305
+ Alternatively, you can:
306
+ * Update to macOS 10.14.4 or later; or
307
+ * Install Xcode 10.2 or later at `/Applications/Xcode.app`.
308
+
231
309
  ## Development
232
310
 
233
311
  Please review jazzy's [contributing guidelines](https://github.com/realm/jazzy/blob/master/CONTRIBUTING.md) when submitting pull requests.
@@ -278,3 +356,4 @@ read [our blog](https://realm.io/news) or say hi on twitter
278
356
  [SourceKitten]: https://github.com/jpsim/SourceKitten "SourceKitten"
279
357
  [bundler]: https://rubygems.org/gems/bundler
280
358
  [mustache]: https://mustache.github.io "Mustache"
359
+ [spm]: https://swift.org/package-manager/ "Swift Package Manager"
data/Rakefile CHANGED
@@ -75,13 +75,14 @@ begin
75
75
 
76
76
  # Remove files not used for the comparison
77
77
  # To keep the git diff clean
78
- files_glob = 'spec/integration_specs/*/after/{*,.*}'
78
+ specs_root = 'spec/integration_specs/*/after'
79
+ files_glob = "#{specs_root}/{*,.*}"
79
80
  files_to_delete = FileList[files_glob]
80
81
  .exclude('**/.', '**/..')
81
- .exclude('spec/integration_specs/*/after/*docs',
82
- 'spec/integration_specs/*/after/execution_output.txt')
83
- .include('**/*.dsidx')
84
- .include('**/*.tgz')
82
+ .exclude("#{specs_root}/*docs",
83
+ "#{specs_root}/execution_output.txt")
84
+ .include("#{specs_root}/**/*.dsidx")
85
+ .include("#{specs_root}/**/*.tgz")
85
86
  files_to_delete.each do |file_to_delete|
86
87
  sh "rm -rf '#{file_to_delete}'"
87
88
  end
@@ -103,7 +104,7 @@ begin
103
104
  task :sourcekitten do
104
105
  sk_dir = 'SourceKitten'
105
106
  Dir.chdir(sk_dir) do
106
- `swift build -c release -Xswiftc -static-stdlib`
107
+ `swift build -c release`
107
108
  end
108
109
  FileUtils.cp_r "#{sk_dir}/.build/release/sourcekitten", 'bin'
109
110
  end
data/bin/sourcekitten CHANGED
Binary file
data/jazzy.gemspec CHANGED
@@ -17,12 +17,12 @@ 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'
21
+ spec.add_runtime_dependency 'mustache', '~> 1.1'
22
22
  spec.add_runtime_dependency 'open4'
23
- spec.add_runtime_dependency 'redcarpet', '~> 3.2'
23
+ spec.add_runtime_dependency 'redcarpet', '~> 3.4'
24
24
  spec.add_runtime_dependency 'rouge', ['>= 2.0.6', '< 4.0']
25
- spec.add_runtime_dependency 'sass', '~> 3.4'
25
+ spec.add_runtime_dependency 'sassc', '~> 2.1'
26
26
  spec.add_runtime_dependency 'sqlite3', '~> 1.3'
27
27
  spec.add_runtime_dependency 'xcinvoke', '~> 0.3.0'
28
28
 
data/lib/jazzy/config.rb CHANGED
@@ -2,7 +2,6 @@ require 'optparse'
2
2
  require 'pathname'
3
3
  require 'uri'
4
4
 
5
- require 'jazzy/doc'
6
5
  require 'jazzy/podspec_documenter'
7
6
  require 'jazzy/source_declaration/access_control_level'
8
7
 
@@ -80,6 +79,14 @@ module Jazzy
80
79
  @all_config_attrs << Attribute.new(name, **opts)
81
80
  end
82
81
 
82
+ def self.alias_config_attr(name, forward, **opts)
83
+ alias_method name.to_s, forward.to_s
84
+ alias_method "#{name}=", "#{forward}="
85
+ alias_method "#{name}_configured", "#{forward}_configured"
86
+ alias_method "#{name}_configured=", "#{forward}_configured="
87
+ @all_config_attrs << Attribute.new(name, **opts)
88
+ end
89
+
83
90
  class << self
84
91
  attr_reader :all_config_attrs
85
92
  end
@@ -147,11 +154,16 @@ module Jazzy
147
154
  'Default: .jazzy.yaml in source directory or ancestor'],
148
155
  parse: ->(cf) { expand_path(cf) }
149
156
 
150
- config_attr :xcodebuild_arguments,
151
- command_line: ['-x', '--xcodebuild-arguments arg1,arg2,…argN', Array],
152
- description: 'Arguments to forward to xcodebuild',
157
+ config_attr :build_tool_arguments,
158
+ command_line: ['-b', '--build-tool-arguments arg1,arg2,…argN', Array],
159
+ description: 'Arguments to forward to xcodebuild, swift build, or ' \
160
+ 'sourcekitten.',
153
161
  default: []
154
162
 
163
+ alias_config_attr :xcodebuild_arguments, :build_tool_arguments,
164
+ command_line: ['-x', '--xcodebuild-arguments arg1,arg2,…argN', Array],
165
+ description: 'Back-compatibility alias for build_tool_arguments.'
166
+
155
167
  config_attr :sourcekitten_sourcefile,
156
168
  command_line: ['-s', '--sourcekitten-sourcefile FILEPATH'],
157
169
  description: 'File generated from sourcekitten output to parse',
@@ -193,6 +205,20 @@ module Jazzy
193
205
  end
194
206
  end
195
207
 
208
+ SWIFT_BUILD_TOOLS = %w[spm xcodebuild].freeze
209
+
210
+ config_attr :swift_build_tool,
211
+ command_line: "--swift-build-tool #{SWIFT_BUILD_TOOLS.join(' | ')}",
212
+ description: 'Control whether Jazzy uses Swift Package Manager or '\
213
+ 'xcodebuild to build the module to be documented. By '\
214
+ 'default it uses xcodebuild if there is a .xcodeproj '\
215
+ 'file in the source directory.',
216
+ parse: ->(tool) do
217
+ return tool.to_sym if SWIFT_BUILD_TOOLS.include?(tool)
218
+ raise "Unsupported swift_build_tool #{tool}, "\
219
+ "supported values: #{SWIFT_BUILD_TOOLS.join(', ')}"
220
+ end
221
+
196
222
  # ──────── Metadata ────────
197
223
 
198
224
  config_attr :author_name,
@@ -213,9 +239,16 @@ module Jazzy
213
239
 
214
240
  config_attr :version,
215
241
  command_line: '--module-version VERSION',
216
- description: 'module version. will be used when generating docset',
242
+ description: 'Version string to use as part of the the default docs '\
243
+ 'title and inside the docset.',
217
244
  default: '1.0'
218
245
 
246
+ config_attr :title,
247
+ command_line: '--title TITLE',
248
+ description: 'Title to display at the top of each page, overriding the '\
249
+ 'default generated from module name and version.',
250
+ default: ''
251
+
219
252
  config_attr :copyright,
220
253
  command_line: '--copyright COPYRIGHT_MARKDOWN',
221
254
  description: 'copyright markdown rendered at the bottom of the docs pages'
data/lib/jazzy/doc.rb CHANGED
@@ -8,10 +8,11 @@ require 'jazzy/jazzy_markdown'
8
8
 
9
9
  module Jazzy
10
10
  class Doc < Mustache
11
+ include Config::Mixin
12
+
11
13
  self.template_name = 'doc'
12
14
 
13
15
  def copyright
14
- config = Config.instance
15
16
  copyright = config.copyright || (
16
17
  # Fake date is used to keep integration tests consistent
17
18
  date = ENV['JAZZY_FAKE_DATE'] || DateTime.now.strftime('%Y-%m-%d')
@@ -28,7 +29,7 @@ module Jazzy
28
29
  end
29
30
 
30
31
  def objc_first?
31
- Config.instance.objc_mode && Config.instance.hide_declarations != 'objc'
32
+ config.objc_mode && config.hide_declarations != 'objc'
32
33
  end
33
34
 
34
35
  def language
@@ -38,5 +39,21 @@ module Jazzy
38
39
  def language_stub
39
40
  objc_first? ? 'objc' : 'swift'
40
41
  end
42
+
43
+ def module_version
44
+ config.version_configured ? config.version : nil
45
+ end
46
+
47
+ def docs_title
48
+ if config.title_configured
49
+ config.title
50
+ elsif config.version_configured
51
+ # Fake version for integration tests
52
+ version = ENV['JAZZY_FAKE_MODULE_VERSION'] || config.version
53
+ "#{config.module_name} #{version} Docs"
54
+ else
55
+ "#{config.module_name} Docs"
56
+ end
57
+ end
41
58
  end
42
59
  end
@@ -1,7 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'mustache'
3
3
  require 'pathname'
4
- require 'sass'
4
+ require 'sassc'
5
5
 
6
6
  require 'jazzy/config'
7
7
  require 'jazzy/doc'
@@ -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'
@@ -56,21 +55,13 @@ module Jazzy
56
55
  def self.build(options)
57
56
  if options.sourcekitten_sourcefile
58
57
  stdout = options.sourcekitten_sourcefile.read
58
+ elsif options.podspec_configured
59
+ pod_documenter = PodspecDocumenter.new(options.podspec)
60
+ stdout = pod_documenter.sourcekitten_output(options)
59
61
  else
60
- if options.podspec_configured
61
- pod_documenter = PodspecDocumenter.new(options.podspec)
62
- stdout = pod_documenter.sourcekitten_output(options)
63
- else
64
- stdout = Dir.chdir(options.source_directory) do
65
- arguments = SourceKitten.arguments_from_options(options)
66
- SourceKitten.run_sourcekitten(arguments)
67
- end
68
- end
69
- unless $?.success?
70
- warn 'Please pass in xcodebuild arguments using -x'
71
- warn 'If build arguments are correct, please file an issue on ' \
72
- 'https://github.com/realm/jazzy/issues'
73
- exit $?.exitstatus || 1
62
+ stdout = Dir.chdir(options.source_directory) do
63
+ arguments = SourceKitten.arguments_from_options(options)
64
+ SourceKitten.run_sourcekitten(arguments)
74
65
  end
75
66
  end
76
67
 
@@ -95,11 +86,10 @@ module Jazzy
95
86
 
96
87
  def self.each_doc(output_dir, docs, &block)
97
88
  docs.each do |doc|
98
- next unless doc.render?
99
- # Assuming URL is relative to documentation root:
100
- path = output_dir + (doc.url || "#{doc.name}.html")
89
+ next unless doc.render_as_page?
90
+ # Filepath is relative to documentation root:
91
+ path = output_dir + doc.filepath
101
92
  block.call(doc, path)
102
- next if doc.name == 'index'
103
93
  each_doc(
104
94
  output_dir,
105
95
  doc.children,
@@ -199,8 +189,7 @@ module Jazzy
199
189
  assets_directory = Config.instance.theme_directory + 'assets'
200
190
  FileUtils.cp_r(assets_directory.children, destination)
201
191
  Pathname.glob(destination + 'css/**/*.scss').each do |scss|
202
- contents = scss.read
203
- css = Sass::Engine.new(contents, syntax: :scss).render
192
+ css = SassC::Engine.new(scss.read).render
204
193
  css_filename = scss.sub(/\.scss$/, '')
205
194
  css_filename.open('w') { |f| f.write(css) }
206
195
  FileUtils.rm scss
@@ -332,6 +321,7 @@ module Jazzy
332
321
  # Build mustache item for a top-level doc
333
322
  # @param [Hash] item Parsed doc child item
334
323
  # @param [Config] options Build options
324
+ # rubocop:disable Metrics/MethodLength
335
325
  def self.render_item(item, source_module)
336
326
  # Combine abstract and discussion into abstract
337
327
  abstract = (item.abstract || '') + (item.discussion || '')
@@ -347,11 +337,16 @@ module Jazzy
347
337
  from_protocol_extension: item.from_protocol_extension,
348
338
  return: item.return,
349
339
  parameters: (item.parameters if item.parameters.any?),
350
- url: (item.url if item.children.any?),
340
+ url: (item.url if item.render_as_page?),
351
341
  start_line: item.start_line,
352
342
  end_line: item.end_line,
343
+ direct_link: item.omit_content_from_parent?,
344
+ deprecation_message: item.deprecation_message,
345
+ unavailable_message: item.unavailable_message,
346
+ usage_discouraged: item.usage_discouraged?,
353
347
  }
354
348
  end
349
+ # rubocop:enable Metrics/MethodLength
355
350
 
356
351
  def self.make_task(mark, uid, items)
357
352
  {
@@ -391,7 +386,7 @@ module Jazzy
391
386
  # @param [Array] doc_structure doc structure comprised of section names and
392
387
  # child names and URLs. @see doc_structure_for_docs
393
388
  def self.document(source_module, doc_model, path_to_root)
394
- if doc_model.type.kind == 'document.markdown'
389
+ if doc_model.type.markdown?
395
390
  return document_markdown(source_module, doc_model, path_to_root)
396
391
  end
397
392
 
@@ -418,6 +413,9 @@ module Jazzy
418
413
  doc[:github_url] = source_module.github_url
419
414
  doc[:dash_url] = source_module.dash_url
420
415
  doc[:path_to_root] = path_to_root
416
+ doc[:deprecation_message] = doc_model.deprecation_message
417
+ doc[:unavailable_message] = doc_model.unavailable_message
418
+ doc[:usage_discouraged] = doc_model.usage_discouraged?
421
419
  doc.render.gsub(ELIDED_AUTOLINK_TOKEN, path_to_root)
422
420
  end
423
421
  # rubocop:enable Metrics/MethodLength