jazzy 0.13.2 → 0.13.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/Tests.yml +52 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +118 -0
- data/CONTRIBUTING.md +5 -5
- data/Gemfile.lock +68 -59
- data/README.md +65 -5
- data/Rakefile +30 -0
- data/bin/sourcekitten +0 -0
- data/js/package-lock.json +44 -0
- data/js/package.json +17 -0
- data/lib/jazzy/config.rb +29 -8
- data/lib/jazzy/doc_builder.rb +14 -2
- data/lib/jazzy/docset_builder.rb +2 -0
- data/lib/jazzy/docset_builder/info_plist.mustache +8 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Bold.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Italic.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-Italic.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Script-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/lib/jazzy/extensions/katex/css/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/lib/jazzy/extensions/katex/css/katex.min.css +1 -1
- data/lib/jazzy/extensions/katex/js/katex.min.js +1 -1
- data/lib/jazzy/gem_version.rb +1 -1
- data/lib/jazzy/jazzy_markdown.rb +38 -0
- data/lib/jazzy/podspec_documenter.rb +15 -3
- data/lib/jazzy/source_declaration.rb +15 -2
- data/lib/jazzy/source_declaration/type.rb +30 -0
- data/lib/jazzy/source_module.rb +2 -1
- data/lib/jazzy/sourcekitten.rb +11 -11
- data/lib/jazzy/symbol_graph.rb +95 -0
- data/lib/jazzy/symbol_graph/constraint.rb +94 -0
- data/lib/jazzy/symbol_graph/ext_node.rb +114 -0
- data/lib/jazzy/symbol_graph/graph.rb +193 -0
- data/lib/jazzy/symbol_graph/relationship.rb +39 -0
- data/lib/jazzy/symbol_graph/sym_node.rb +158 -0
- data/lib/jazzy/symbol_graph/symbol.rb +219 -0
- data/lib/jazzy/themes/apple/assets/css/jazzy.css.scss +96 -3
- data/lib/jazzy/themes/apple/assets/img/spinner.gif +0 -0
- data/lib/jazzy/themes/apple/assets/js/jazzy.search.js +70 -0
- data/lib/jazzy/themes/apple/assets/js/jquery.min.js +2 -2
- data/lib/jazzy/themes/apple/assets/js/lunr.min.js +6 -0
- data/lib/jazzy/themes/apple/assets/js/typeahead.jquery.js +1694 -0
- data/lib/jazzy/themes/apple/templates/doc.mustache +35 -0
- data/lib/jazzy/themes/apple/templates/header.mustache +7 -0
- data/lib/jazzy/themes/apple/templates/task.mustache +1 -1
- data/lib/jazzy/themes/fullwidth/assets/css/jazzy.css.scss +5 -0
- data/lib/jazzy/themes/fullwidth/assets/js/jquery.min.js +2 -2
- data/lib/jazzy/themes/fullwidth/assets/js/lunr.min.js +6 -1
- data/lib/jazzy/themes/fullwidth/assets/js/typeahead.jquery.js +34 -14
- data/lib/jazzy/themes/fullwidth/templates/doc.mustache +30 -0
- data/lib/jazzy/themes/fullwidth/templates/task.mustache +1 -1
- data/lib/jazzy/themes/jony/assets/css/jazzy.css.scss +29 -1
- data/lib/jazzy/themes/jony/assets/js/jquery.min.js +2 -2
- data/lib/jazzy/themes/jony/templates/doc.mustache +30 -0
- data/lib/jazzy/themes/jony/templates/task.mustache +1 -1
- data/spec/integration_spec.rb +17 -8
- metadata +20 -8
- data/.circleci/config.yml +0 -83
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
![jazzy](images/logo.jpg)
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://github.com/realm/jazzy/actions/workflows/Tests.yml/badge.svg)](https://github.com/realm/jazzy/actions/workflows/Tests.yml)
|
4
4
|
|
5
5
|
*jazzy is a command-line utility that generates documentation for Swift or Objective-C*
|
6
6
|
|
@@ -8,13 +8,14 @@
|
|
8
8
|
|
9
9
|
Both Swift and Objective-C projects are supported.
|
10
10
|
|
11
|
-
*SwiftPM support was recently added, so please report any issues you find.*
|
12
|
-
|
13
11
|
Instead of parsing your source files, `jazzy` hooks into [Clang][clang] and
|
14
12
|
[SourceKit][sourcekit] to use the [AST][ast] representation of your code and
|
15
13
|
its comments for more accurate results. The output matches the look and feel
|
16
14
|
of Apple’s official reference documentation, post WWDC 2014.
|
17
15
|
|
16
|
+
Jazzy can also generate documentation from compiled swift modules [using their
|
17
|
+
symbol graph](#docs-from-swiftmodules-or-frameworks) instead of source code.
|
18
|
+
|
18
19
|
![Screenshot](images/screenshot.jpg)
|
19
20
|
|
20
21
|
This project adheres to the [Contributor Covenant Code of Conduct](https://realm.io/conduct).
|
@@ -49,13 +50,14 @@ succeed too!
|
|
49
50
|
|
50
51
|
If Jazzy generates docs for the wrong module then use `--module` to tell it which
|
51
52
|
one you'd prefer. If this doesn't help, and you're using Xcode, then try passing
|
52
|
-
extra arguments to `xcodebuild`, for example
|
53
|
+
extra arguments to `xcodebuild`, for example
|
54
|
+
`jazzy --build-tool-arguments -scheme,MyScheme,-target,MyTarget`.
|
53
55
|
|
54
56
|
You can set options for your project’s documentation in a configuration file,
|
55
57
|
`.jazzy.yaml` by default. For a detailed explanation and an exhaustive list of
|
56
58
|
all available options, run `jazzy --help config`.
|
57
59
|
|
58
|
-
### Supported keywords
|
60
|
+
### Supported documentation keywords
|
59
61
|
|
60
62
|
Swift documentation is written in markdown and supports a number of special keywords.
|
61
63
|
For a complete list and examples, see Erica Sadun's post on [*Swift header documentation in Xcode 7*](https://ericasadun.com/2015/06/14/swift-header-documentation-in-xcode-7/),
|
@@ -200,6 +202,57 @@ sourcekitten doc --objc $(pwd)/MyProject/MyProject.h \
|
|
200
202
|
jazzy --sourcekitten-sourcefile swiftDoc.json,objcDoc.json
|
201
203
|
```
|
202
204
|
|
205
|
+
### Docs from `.swiftmodule`s or frameworks
|
206
|
+
|
207
|
+
*This feature is new and relies on a new Swift feature: there may be crashes
|
208
|
+
and mistakes: reports welcome.*
|
209
|
+
|
210
|
+
Swift 5.3 adds support for symbol graph generation from `.swiftmodule` files.
|
211
|
+
This looks to be part of Apple's toolchain for generating their online docs.
|
212
|
+
|
213
|
+
Jazzy can use this to generate API documentation. This is faster than using
|
214
|
+
the source code directly but does have limitations: for example documentation
|
215
|
+
comments are available only for `public` declarations, and the presentation of
|
216
|
+
Swift extensions may not match the way they are written in code.
|
217
|
+
|
218
|
+
Some examples:
|
219
|
+
|
220
|
+
1. Generate docs for the Apple Combine framework for macOS:
|
221
|
+
```shell
|
222
|
+
jazzy --module Combine --swift-build-tool symbolgraph
|
223
|
+
```
|
224
|
+
The SDK's library directories are included in the search path by
|
225
|
+
default.
|
226
|
+
2. Same but for iOS:
|
227
|
+
```shell
|
228
|
+
jazzy --module Combine --swift-build-tool symbolgraph
|
229
|
+
--sdk iphoneos
|
230
|
+
--build-tool-arguments --target,arm64-apple-ios14.1
|
231
|
+
```
|
232
|
+
The `target` is the LLVM target triple and needs to match the SDK. The
|
233
|
+
default here is the target of the host system that Jazzy is running on,
|
234
|
+
something like `x86_64-apple-darwin19.6.0`.
|
235
|
+
3. Generate docs for a personal `.swiftmodule`:
|
236
|
+
```shell
|
237
|
+
jazzy --module MyMod --swift-build-tool symbolgraph
|
238
|
+
--build-tool-arguments -I,/Build/Products
|
239
|
+
```
|
240
|
+
This implies that `/Build/Products/MyMod.swiftmodule` exists. Jazzy's
|
241
|
+
`--source-directory` (default current directory) is searched by default,
|
242
|
+
so you only need the `-I` override if that's not enough.
|
243
|
+
4. For a personal framework:
|
244
|
+
```shell
|
245
|
+
jazzy --module MyMod --swift-build-tool symbolgraph
|
246
|
+
--build-tool-arguments -F,/Build/Products
|
247
|
+
```
|
248
|
+
This implies that `/Build/Products/MyMod.framework` exists and contains
|
249
|
+
a `.swiftmodule`. Again the `--source-directory` is searched by default
|
250
|
+
if `-F` is not passed in.
|
251
|
+
|
252
|
+
See `swift symbolgraph-extract --help` for all the things you can pass via
|
253
|
+
`--build-tool-arguments`: if your module has dependencies then you may need
|
254
|
+
to add various search path options to let Swift load it.
|
255
|
+
|
203
256
|
### Themes
|
204
257
|
|
205
258
|
Three themes are provided with jazzy: `apple` (default), `fullwidth` and `jony`.
|
@@ -281,6 +334,13 @@ Note that the `--include` option is applied before the `--exclude` option. For e
|
|
281
334
|
Declarations with a documentation comment containing `:nodoc:` are excluded from the
|
282
335
|
documentation.
|
283
336
|
|
337
|
+
### Documentation structure
|
338
|
+
|
339
|
+
By default Jazzy does not create separate web pages for declarations that do
|
340
|
+
not have any members: instead they are nested into some parent page. Use the
|
341
|
+
`--separate-global-declarations` flag to change this and always create pages
|
342
|
+
for declarations that can be directly accessed from client code.
|
343
|
+
|
284
344
|
### Choosing the Swift language version
|
285
345
|
|
286
346
|
Jazzy normally uses the Swift compiler from the Xcode currently configured by
|
data/Rakefile
CHANGED
@@ -109,6 +109,36 @@ begin
|
|
109
109
|
FileUtils.cp_r "#{sk_dir}/.build/release/sourcekitten", 'bin'
|
110
110
|
end
|
111
111
|
|
112
|
+
#-- Theme Dependencies -----------------------------------------------------#
|
113
|
+
|
114
|
+
THEME_FILES = {
|
115
|
+
'jquery/dist/jquery.min.js' => [
|
116
|
+
'themes/apple/assets/js',
|
117
|
+
'themes/fullwidth/assets/js',
|
118
|
+
'themes/jony/assets/js'
|
119
|
+
],
|
120
|
+
'lunr/lunr.min.js' => [
|
121
|
+
'themes/apple/assets/js',
|
122
|
+
'themes/fullwidth/assets/js'
|
123
|
+
],
|
124
|
+
'corejs-typeahead/dist/typeahead.jquery.js' => [
|
125
|
+
'themes/apple/assets/js',
|
126
|
+
'themes/fullwidth/assets/js'
|
127
|
+
],
|
128
|
+
'katex/dist/katex.min.css' => ['extensions/katex/css'],
|
129
|
+
'katex/dist/fonts' => ['extensions/katex/css'],
|
130
|
+
'katex/dist/katex.min.js' => ['extensions/katex/js']
|
131
|
+
}
|
132
|
+
|
133
|
+
desc 'Copies theme dependencies (`npm update/install` by hand first)'
|
134
|
+
task :theme_deps do
|
135
|
+
THEME_FILES.each_pair do |src, dsts|
|
136
|
+
dsts.each do |dst|
|
137
|
+
FileUtils.cp_r "js/node_modules/#{src}", "lib/jazzy/#{dst}"
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
112
142
|
rescue LoadError, NameError => e
|
113
143
|
$stderr.puts "\033[0;31m" \
|
114
144
|
'[!] Some Rake tasks haven been disabled because the environment' \
|
data/bin/sourcekitten
CHANGED
Binary file
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"lockfileVersion": 2,
|
3
|
+
"requires": true,
|
4
|
+
"packages": {
|
5
|
+
"node_modules/commander": {
|
6
|
+
"version": "6.2.1",
|
7
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
|
8
|
+
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
|
9
|
+
"engines": {
|
10
|
+
"node": ">= 6"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"node_modules/corejs-typeahead": {
|
14
|
+
"version": "1.3.1",
|
15
|
+
"resolved": "https://registry.npmjs.org/corejs-typeahead/-/corejs-typeahead-1.3.1.tgz",
|
16
|
+
"integrity": "sha512-fyNlBNWJNL6EQUnJyAunEzBzRcwR2cEHtZXBi2pndHPOJ/wpOf3wbS+/Oh+kYYS5sKowQcs0LFwMSl6Y2Xeqkw==",
|
17
|
+
"dependencies": {
|
18
|
+
"jquery": ">=1.11"
|
19
|
+
}
|
20
|
+
},
|
21
|
+
"node_modules/jquery": {
|
22
|
+
"version": "3.6.0",
|
23
|
+
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
|
24
|
+
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
|
25
|
+
},
|
26
|
+
"node_modules/katex": {
|
27
|
+
"version": "0.13.5",
|
28
|
+
"resolved": "https://registry.npmjs.org/katex/-/katex-0.13.5.tgz",
|
29
|
+
"integrity": "sha512-n2uEzFpNFUOAlWs0eCgmT82LQyP+BlS45yBgnLRqe+ENp3+FEM3lM+cJwZwwxxONFgayyq1fm6n+w35vo2MaUg==",
|
30
|
+
"dependencies": {
|
31
|
+
"commander": "^6.0.0"
|
32
|
+
},
|
33
|
+
"bin": {
|
34
|
+
"katex": "cli.js"
|
35
|
+
}
|
36
|
+
},
|
37
|
+
"node_modules/lunr": {
|
38
|
+
"version": "2.3.9",
|
39
|
+
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz",
|
40
|
+
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow=="
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"dependencies": {}
|
44
|
+
}
|
data/js/package.json
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"name": "jazzy-js",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "Jazzy theme dependencies",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"author": "",
|
10
|
+
"license": "MIT",
|
11
|
+
"dependencies": {
|
12
|
+
"corejs-typeahead": "^1.3.1",
|
13
|
+
"jquery": "^3.6.0",
|
14
|
+
"katex": "^0.13.3",
|
15
|
+
"lunr": "^2.3.9"
|
16
|
+
}
|
17
|
+
}
|
data/lib/jazzy/config.rb
CHANGED
@@ -59,7 +59,7 @@ module Jazzy
|
|
59
59
|
|
60
60
|
def full_command_line_name
|
61
61
|
long_option_names = command_line.map do |opt|
|
62
|
-
Regexp.last_match(1) if opt =~ %r{
|
62
|
+
Regexp.last_match(1) if opt.to_s =~ %r{
|
63
63
|
^-- # starts with double dash
|
64
64
|
(?:\[no-\])? # optional prefix for booleans
|
65
65
|
([^\s]+) # long option name
|
@@ -219,14 +219,14 @@ module Jazzy
|
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
222
|
-
SWIFT_BUILD_TOOLS = %w[spm xcodebuild].freeze
|
222
|
+
SWIFT_BUILD_TOOLS = %w[spm xcodebuild symbolgraph].freeze
|
223
223
|
|
224
224
|
config_attr :swift_build_tool,
|
225
225
|
command_line: "--swift-build-tool #{SWIFT_BUILD_TOOLS.join(' | ')}",
|
226
|
-
description: 'Control whether Jazzy uses Swift Package Manager
|
227
|
-
'xcodebuild to build the module
|
228
|
-
'default it uses xcodebuild if
|
229
|
-
'file in the source directory.',
|
226
|
+
description: 'Control whether Jazzy uses Swift Package Manager, '\
|
227
|
+
'xcodebuild, or swift-symbolgraph to build the module '\
|
228
|
+
'to be documented. By default it uses xcodebuild if '\
|
229
|
+
'there is a .xcodeproj file in the source directory.',
|
230
230
|
parse: ->(tool) do
|
231
231
|
return tool.to_sym if SWIFT_BUILD_TOOLS.include?(tool)
|
232
232
|
raise "Unsupported swift_build_tool #{tool}, "\
|
@@ -253,7 +253,7 @@ module Jazzy
|
|
253
253
|
|
254
254
|
config_attr :version,
|
255
255
|
command_line: '--module-version VERSION',
|
256
|
-
description: 'Version string to use as part of the
|
256
|
+
description: 'Version string to use as part of the default docs '\
|
257
257
|
'title and inside the docset.',
|
258
258
|
default: '1.0'
|
259
259
|
|
@@ -289,6 +289,14 @@ module Jazzy
|
|
289
289
|
parse: ->(ps) { PodspecDocumenter.create_podspec(Pathname(ps)) if ps },
|
290
290
|
default: Dir['*.podspec{,.json}'].first
|
291
291
|
|
292
|
+
config_attr :pod_sources,
|
293
|
+
command_line: ['--pod-sources url1,url2,…urlN', Array],
|
294
|
+
description: 'A list of sources to find pod dependencies. Used only '\
|
295
|
+
'with --podspec when the podspec contains references to '\
|
296
|
+
'privately hosted pods. You must include the default pod '\
|
297
|
+
'source if public pods are also used.',
|
298
|
+
default: []
|
299
|
+
|
292
300
|
config_attr :docset_icon,
|
293
301
|
command_line: '--docset-icon FILEPATH',
|
294
302
|
parse: ->(di) { expand_path(di) }
|
@@ -302,7 +310,8 @@ module Jazzy
|
|
302
310
|
config_attr :root_url,
|
303
311
|
command_line: ['-r', '--root-url URL'],
|
304
312
|
description: 'Absolute URL root where these docs will be stored',
|
305
|
-
|
313
|
+
# ensure trailing slash for correct URI.join()
|
314
|
+
parse: ->(r) { URI(r.sub(%r{/?$}, '/')) }
|
306
315
|
|
307
316
|
config_attr :dash_url,
|
308
317
|
command_line: ['-d', '--dash_url URL'],
|
@@ -321,6 +330,11 @@ module Jazzy
|
|
321
330
|
description: 'GitHub URL file prefix of this project (e.g. '\
|
322
331
|
'https://github.com/realm/realm-cocoa/tree/v0.87.1)'
|
323
332
|
|
333
|
+
config_attr :docset_playground_url,
|
334
|
+
command_line: '--docset-playground-url URL',
|
335
|
+
description: 'URL of an interactive playground to demonstrate the '\
|
336
|
+
'framework, linked to from the docset.'
|
337
|
+
|
324
338
|
# ──────── Doc generation options ────────
|
325
339
|
config_attr :disable_search,
|
326
340
|
command_line: '--disable-search',
|
@@ -423,6 +437,13 @@ module Jazzy
|
|
423
437
|
'is "Undocumented", put "" if no text is required',
|
424
438
|
default: 'Undocumented'
|
425
439
|
|
440
|
+
config_attr :separate_global_declarations,
|
441
|
+
command_line: '--[no-]separate-global-declarations',
|
442
|
+
description: 'Create separate pages for all global declarations '\
|
443
|
+
"(classes, structures, enums etc.) even if they don't "\
|
444
|
+
'have children.',
|
445
|
+
default: false
|
446
|
+
|
426
447
|
# rubocop:enable Style/AlignParameter
|
427
448
|
|
428
449
|
def initialize
|
data/lib/jazzy/doc_builder.rb
CHANGED
@@ -14,6 +14,7 @@ require 'jazzy/source_declaration'
|
|
14
14
|
require 'jazzy/source_document'
|
15
15
|
require 'jazzy/source_module'
|
16
16
|
require 'jazzy/sourcekitten'
|
17
|
+
require 'jazzy/symbol_graph'
|
17
18
|
|
18
19
|
module Jazzy
|
19
20
|
# This module handles HTML generation, file writing, asset copying,
|
@@ -72,6 +73,8 @@ module Jazzy
|
|
72
73
|
elsif options.podspec_configured
|
73
74
|
pod_documenter = PodspecDocumenter.new(options.podspec)
|
74
75
|
stdout = pod_documenter.sourcekitten_output(options)
|
76
|
+
elsif options.swift_build_tool == :symbolgraph
|
77
|
+
stdout = SymbolGraph.build(options)
|
75
78
|
else
|
76
79
|
stdout = Dir.chdir(options.source_directory) do
|
77
80
|
arguments = SourceKitten.arguments_from_options(options)
|
@@ -192,7 +195,10 @@ module Jazzy
|
|
192
195
|
|
193
196
|
lint_report = {
|
194
197
|
warnings: warnings.sort_by do |w|
|
195
|
-
[w[:file]
|
198
|
+
[w[:file] || Pathname(''),
|
199
|
+
w[:line] || 0,
|
200
|
+
w[:symbol],
|
201
|
+
w[:symbol_kind]]
|
196
202
|
end,
|
197
203
|
source_directory: options.source_directory,
|
198
204
|
}
|
@@ -378,7 +384,7 @@ module Jazzy
|
|
378
384
|
{
|
379
385
|
name: mark.name,
|
380
386
|
name_html: (render(doc_model, mark.name) if mark.name),
|
381
|
-
uid:
|
387
|
+
uid: ERB::Util.url_encode(uid),
|
382
388
|
items: items,
|
383
389
|
pre_separator: mark.has_start_dash,
|
384
390
|
post_separator: mark.has_end_dash,
|
@@ -432,12 +438,18 @@ module Jazzy
|
|
432
438
|
doc[:kind] = doc_model.type.name
|
433
439
|
doc[:dash_type] = doc_model.type.dash_type
|
434
440
|
doc[:declaration] = doc_model.display_declaration
|
441
|
+
doc[:language] = doc_model.display_language
|
442
|
+
doc[:other_language_declaration] =
|
443
|
+
doc_model.display_other_language_declaration
|
435
444
|
doc[:overview] = overview
|
445
|
+
doc[:parameters] = doc_model.parameters
|
446
|
+
doc[:return] = doc_model.return
|
436
447
|
doc[:structure] = source_module.doc_structure
|
437
448
|
doc[:tasks] = render_tasks(source_module, doc_model.children)
|
438
449
|
doc[:module_name] = source_module.name
|
439
450
|
doc[:author_name] = source_module.author_name
|
440
451
|
doc[:github_url] = source_module.github_url
|
452
|
+
doc[:github_token_url] = gh_token_url(doc_model, source_module)
|
441
453
|
doc[:dash_url] = source_module.dash_url
|
442
454
|
doc[:path_to_root] = path_to_root
|
443
455
|
doc[:deprecation_message] = doc_model.deprecation_message
|
data/lib/jazzy/docset_builder.rb
CHANGED
@@ -16,5 +16,13 @@
|
|
16
16
|
<true/>
|
17
17
|
<key>DashDocSetFamily</key>
|
18
18
|
<string>dashtoc</string>
|
19
|
+
{{#root_url}}
|
20
|
+
<key>DashDocSetFallbackURL</key>
|
21
|
+
<string>{{{.}}}</string>
|
22
|
+
{{/root_url}}
|
23
|
+
{{#playground_url}}
|
24
|
+
<key>DashDocSetPlayURL</key>
|
25
|
+
<string>{{{.}}}</string>
|
26
|
+
{{/playground_url}}
|
19
27
|
</dict>
|
20
28
|
</plist>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|