jazzy 0.9.6 → 0.10.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7723d71fdd04817497ff84b517c5d413b43857f56167f3fc96a6de3e082e9cf3
4
- data.tar.gz: e9c0a9283b79b76ecaece6ed35d3d323ffafb370d228f4fcc3e00c81876a6fac
3
+ metadata.gz: bc3616cb1da2da7c201cea6c6bc81659ee5a816da770bc8cc5c087b75e227a19
4
+ data.tar.gz: 9a459463afd8a9b12881175acb5c638d1c27d4f86f6a78898d4d04fd77a2912f
5
5
  SHA512:
6
- metadata.gz: d3d6685a6ca5b1eea07b0775bd0368f4f259e0325fb68f08a24d9ac1d8855b9759feeaad387d34fbd7201cfb61c031f31723fbe3fa65a236fffb01ac422fbb99
7
- data.tar.gz: cc8b9d21b5876440a0a2858791a5e516f550d805b22b41def851921814ff96748880bfab5d613f22297d7570fdb6bd82462eac3597defff8f4464a6b93835164
6
+ metadata.gz: d7e283f41d40a59988031091c64b1be2fc8a78334a3e544d4e00cfe2cb08beebffd2c2148e2e82cd8db63125c88a7ea8d1262e16c8fca1440ee8ef5f64cfbc89
7
+ data.tar.gz: fa1111eda7b0f9f4d06ee49ddd1f114d0625970f77f3ef6515ddac933ce4551eed8852db56e89b95fa80f82e28b75508ecaf90e303df994659a169ae732cf9c7
@@ -1,3 +1,47 @@
1
+ ## 0.10.0
2
+
3
+ ##### Breaking
4
+
5
+ * The included `sourcekitten` binary is built with Xcode 10.2. This means
6
+ it does not run on macOS earlier than 10.14.4 without the *Swift 5 Runtime
7
+ Support for Command Line Tools* being installed.
8
+ [John Fairhurst](https://github.com/johnfairh)
9
+
10
+ ##### Enhancements
11
+
12
+ * Support CocoaPods 1.6+. Use the `swift_version[s]` dsl in `--podspec` mode
13
+ to set the Swift language version.
14
+ [John Fairhurst](https://github.com/johnfairh)
15
+
16
+ * Show the extension declaration when documenting Swift extensions.
17
+ [John Fairhurst](https://github.com/johnfairh)
18
+
19
+ * Allow docs title customization. Include `--module-version` when it is set
20
+ and support `--title` to fully customize the title. Pass `{{module_version}}`
21
+ and `{{docs_title}}` to templates.
22
+ [Maximilian Alexander](https://github.com/mbalex99)
23
+ [John Fairhurst](https://github.com/johnfairh)
24
+ [#666](https://github.com/realm/jazzy/issues/666)
25
+ [#411](https://github.com/realm/jazzy/issues/411)
26
+
27
+ ##### Bug Fixes
28
+
29
+ * Unfold member documentation when linked to from current web page.
30
+ [John Fairhurst](https://github.com/johnfairh)
31
+ [#788](https://github.com/realm/jazzy/issues/788)
32
+
33
+ * Generate docs when there are unusual characters in source pathnames.
34
+ [John Fairhurst](https://github.com/johnfairh)
35
+ [#1049](https://github.com/realm/jazzy/issues/1049)
36
+
37
+ * Generate docs for signed modules with Xcode 10.2.
38
+ [John Fairhurst](https://github.com/johnfairh)
39
+ [#1057](https://github.com/realm/jazzy/issues/1057)
40
+
41
+ * Use correct module name when only target name is supplied.
42
+ [Chris Zielinski](https://github.com/chriszielinski)
43
+ [#422](https://github.com/realm/jazzy/issues/422)
44
+
1
45
  ## 0.9.6
2
46
 
3
47
  This is (probably) the last release to support Ruby earlier than 2.3.
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.9.6)
5
- cocoapods (~> 1.5.3)
6
- mustache (~> 1.1.0)
4
+ jazzy (0.10.0)
5
+ cocoapods (~> 1.5)
6
+ mustache (~> 1.1)
7
7
  open4
8
- redcarpet (~> 3.4.0)
8
+ redcarpet (~> 3.4)
9
9
  rouge (>= 2.0.6, < 4.0)
10
- sass (~> 3.6.0)
11
- sqlite3 (~> 1.3.13)
10
+ sass (~> 3.6)
11
+ sqlite3 (~> 1.3)
12
12
  xcinvoke (~> 0.3.0)
13
13
 
14
14
  GEM
@@ -20,7 +20,7 @@ GEM
20
20
  minitest (~> 5.1)
21
21
  thread_safe (~> 0.3, >= 0.3.4)
22
22
  tzinfo (~> 1.1)
23
- addressable (2.5.2)
23
+ addressable (2.6.0)
24
24
  public_suffix (>= 2.0.2, < 4.0)
25
25
  ast (2.4.0)
26
26
  atomos (0.1.3)
@@ -33,26 +33,26 @@ GEM
33
33
  clintegracon (0.7.0)
34
34
  colored (~> 1.2)
35
35
  diffy
36
- cocoapods (1.5.3)
36
+ cocoapods (1.7.2)
37
37
  activesupport (>= 4.0.2, < 5)
38
38
  claide (>= 1.0.2, < 2.0)
39
- cocoapods-core (= 1.5.3)
40
- cocoapods-deintegrate (>= 1.0.2, < 2.0)
41
- cocoapods-downloader (>= 1.2.0, < 2.0)
39
+ cocoapods-core (= 1.7.2)
40
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
41
+ cocoapods-downloader (>= 1.2.2, < 2.0)
42
42
  cocoapods-plugins (>= 1.0.0, < 2.0)
43
43
  cocoapods-search (>= 1.0.0, < 2.0)
44
44
  cocoapods-stats (>= 1.0.0, < 2.0)
45
- cocoapods-trunk (>= 1.3.0, < 2.0)
45
+ cocoapods-trunk (>= 1.3.1, < 2.0)
46
46
  cocoapods-try (>= 1.1.0, < 2.0)
47
47
  colored2 (~> 3.1)
48
48
  escape (~> 0.0.4)
49
- fourflusher (~> 2.0.1)
49
+ fourflusher (>= 2.3.0, < 3.0)
50
50
  gh_inspector (~> 1.0)
51
- molinillo (~> 0.6.5)
51
+ molinillo (~> 0.6.6)
52
52
  nap (~> 1.0)
53
- ruby-macho (~> 1.1)
54
- xcodeproj (>= 1.5.7, < 2.0)
55
- cocoapods-core (1.5.3)
53
+ ruby-macho (~> 1.4)
54
+ xcodeproj (>= 1.10.0, < 2.0)
55
+ cocoapods-core (1.7.2)
56
56
  activesupport (>= 4.0.2, < 6)
57
57
  fuzzy_match (~> 2.0.4)
58
58
  nap (~> 1.0)
@@ -73,13 +73,13 @@ GEM
73
73
  colored2 (~> 3.1)
74
74
  crack (0.4.3)
75
75
  safe_yaml (~> 1.0.0)
76
- danger (6.0.2)
76
+ danger (6.0.9)
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
- faraday-http-cache (~> 1.0)
82
+ faraday-http-cache (~> 2.0)
83
83
  git (~> 1.5)
84
84
  kramdown (~> 2.0)
85
85
  kramdown-parser-gfm (~> 1.0)
@@ -90,28 +90,28 @@ GEM
90
90
  escape (0.0.4)
91
91
  faraday (0.15.4)
92
92
  multipart-post (>= 1.2, < 3)
93
- faraday-http-cache (1.3.1)
93
+ faraday-http-cache (2.0.0)
94
94
  faraday (~> 0.8)
95
- ffi (1.10.0)
96
- fourflusher (2.0.1)
95
+ ffi (1.11.1)
96
+ fourflusher (2.3.1)
97
97
  fuzzy_match (2.0.4)
98
98
  gh_inspector (1.1.3)
99
99
  git (1.5.0)
100
- hashdiff (0.3.8)
100
+ hashdiff (0.4.0)
101
101
  i18n (0.9.5)
102
102
  concurrent-ruby (~> 1.0)
103
103
  kramdown (2.1.0)
104
- kramdown-parser-gfm (1.0.1)
104
+ kramdown-parser-gfm (1.1.0)
105
105
  kramdown (~> 2.0)
106
106
  liferaft (0.0.6)
107
107
  metaclass (0.0.4)
108
108
  minitest (5.11.3)
109
- mocha (1.8.0)
109
+ mocha (1.9.0)
110
110
  metaclass (~> 0.0.1)
111
111
  mocha-on-bacon (0.2.3)
112
112
  mocha (>= 0.13.0)
113
113
  molinillo (0.6.6)
114
- multipart-post (2.0.0)
114
+ multipart-post (2.1.1)
115
115
  mustache (1.1.0)
116
116
  nanaimo (0.2.6)
117
117
  nap (1.1.0)
@@ -121,12 +121,12 @@ GEM
121
121
  sawyer (~> 0.8.0, >= 0.5.3)
122
122
  open4 (1.3.4)
123
123
  parallel (1.17.0)
124
- parser (2.6.2.0)
124
+ parser (2.6.3.0)
125
125
  ast (~> 2.4.0)
126
126
  powerpack (0.1.2)
127
127
  prettybacon (0.0.2)
128
128
  bacon (~> 1.2)
129
- public_suffix (3.0.3)
129
+ public_suffix (3.1.0)
130
130
  rainbow (2.2.2)
131
131
  rake
132
132
  rake (10.5.0)
@@ -134,7 +134,7 @@ GEM
134
134
  rb-inotify (0.10.0)
135
135
  ffi (~> 1.0)
136
136
  redcarpet (3.4.0)
137
- rouge (3.3.0)
137
+ rouge (3.4.1)
138
138
  rubocop (0.49.0)
139
139
  parallel (~> 1.10)
140
140
  parser (>= 2.3.3.1, < 3.0)
@@ -143,30 +143,30 @@ GEM
143
143
  ruby-progressbar (~> 1.7)
144
144
  unicode-display_width (~> 1.0, >= 1.0.1)
145
145
  ruby-macho (1.4.0)
146
- ruby-progressbar (1.10.0)
146
+ ruby-progressbar (1.10.1)
147
147
  safe_yaml (1.0.5)
148
- sass (3.6.0)
148
+ sass (3.7.4)
149
149
  sass-listen (~> 4.0.0)
150
150
  sass-listen (4.0.0)
151
151
  rb-fsevent (~> 0.9, >= 0.9.4)
152
152
  rb-inotify (~> 0.9, >= 0.9.7)
153
- sawyer (0.8.1)
154
- addressable (>= 2.3.5, < 2.6)
155
- faraday (~> 0.8, < 1.0)
156
- sqlite3 (1.3.13)
153
+ sawyer (0.8.2)
154
+ addressable (>= 2.3.5)
155
+ faraday (> 0.8, < 2.0)
156
+ sqlite3 (1.4.1)
157
157
  terminal-table (1.8.0)
158
158
  unicode-display_width (~> 1.1, >= 1.1.1)
159
159
  thread_safe (0.3.6)
160
160
  tzinfo (1.2.5)
161
161
  thread_safe (~> 0.1)
162
- unicode-display_width (1.5.0)
163
- webmock (3.5.1)
162
+ unicode-display_width (1.6.0)
163
+ webmock (3.6.0)
164
164
  addressable (>= 2.3.6)
165
165
  crack (>= 0.3.2)
166
- hashdiff
166
+ hashdiff (>= 0.4.0, < 2.0.0)
167
167
  xcinvoke (0.3.0)
168
168
  liferaft (~> 0.0.6)
169
- xcodeproj (1.8.2)
169
+ xcodeproj (1.10.0)
170
170
  CFPropertyList (>= 2.3.3, < 4.0)
171
171
  atomos (~> 0.1.3)
172
172
  claide (>= 1.0.2, < 2.0)
data/README.md CHANGED
@@ -235,7 +235,7 @@ jazzy --swift-version 4.1.2
235
235
 
236
236
  ## Troubleshooting
237
237
 
238
- #### Swift
238
+ ### Swift
239
239
 
240
240
  **Only extensions are listed in the documentation?**
241
241
 
@@ -253,7 +253,7 @@ Check the `--min-acl` setting -- see [above](#controlling-what-is-documented).
253
253
  environment variable to point to the Xcode you want before running Jazzy
254
254
  without the `--swift-version` flag.
255
255
 
256
- #### Installation Problems
256
+ ### Installation Problems
257
257
 
258
258
  **Can't find header files / clang**
259
259
 
@@ -268,6 +268,14 @@ The path of your active Xcode installation must not contain spaces. So
268
268
  but `/Applications/Xcode 10.2.app/` is not. This restriction applies only
269
269
  when *installing* Jazzy, not running it.
270
270
 
271
+ ### MacOS Before 10.14.4
272
+
273
+ 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).
274
+
275
+ Alternatively, you can:
276
+ * Update to macOS 10.14.4 or later; or
277
+ * Install Xcode 10.2 or later at `/Applications/Xcode.app`.
278
+
271
279
  ## Development
272
280
 
273
281
  Please review jazzy's [contributing guidelines](https://github.com/realm/jazzy/blob/master/CONTRIBUTING.md) when submitting pull requests.
data/Rakefile CHANGED
@@ -104,7 +104,7 @@ begin
104
104
  task :sourcekitten do
105
105
  sk_dir = 'SourceKitten'
106
106
  Dir.chdir(sk_dir) do
107
- `swift build -c release -Xswiftc -static-stdlib`
107
+ `swift build -c release`
108
108
  end
109
109
  FileUtils.cp_r "#{sk_dir}/.build/release/sourcekitten", 'bin'
110
110
  end
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.5.3'
21
- spec.add_runtime_dependency 'mustache', '~> 1.1.0'
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.4.0'
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.6.0'
26
- spec.add_runtime_dependency 'sqlite3', '~> 1.3.13'
25
+ spec.add_runtime_dependency 'sass', '~> 3.6'
26
+ spec.add_runtime_dependency 'sqlite3', '~> 1.3'
27
27
  spec.add_runtime_dependency 'xcinvoke', '~> 0.3.0'
28
28
 
29
29
  spec.add_development_dependency 'bundler', '~> 1.7'
@@ -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
 
@@ -213,9 +212,16 @@ module Jazzy
213
212
 
214
213
  config_attr :version,
215
214
  command_line: '--module-version VERSION',
216
- description: 'module version. will be used when generating docset',
215
+ description: 'Version string to use as part of the the default docs '\
216
+ 'title and inside the docset.',
217
217
  default: '1.0'
218
218
 
219
+ config_attr :title,
220
+ command_line: '--title TITLE',
221
+ description: 'Title to display at the top of each page, overriding the '\
222
+ 'default generated from module name and version.',
223
+ default: ''
224
+
219
225
  config_attr :copyright,
220
226
  command_line: '--copyright COPYRIGHT_MARKDOWN',
221
227
  description: 'copyright markdown rendered at the bottom of the docs pages'
@@ -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,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.9.6'.freeze unless defined? Jazzy::VERSION
2
+ VERSION = '0.10.0'.freeze unless defined? Jazzy::VERSION
3
3
  end
@@ -18,7 +18,8 @@ module Jazzy
18
18
  Pod::Config.instance.with_changes(installation_root: installation_root,
19
19
  verbose: false) do
20
20
  sandbox = Pod::Sandbox.new(Pod::Config.instance.sandbox_root)
21
- installer = Pod::Installer.new(sandbox, podfile)
21
+ swift_version = compiler_swift_version(config.swift_version)
22
+ installer = Pod::Installer.new(sandbox, podfile(swift_version))
22
23
  installer.install!
23
24
  stdout = Dir.chdir(sandbox.root) do
24
25
  targets = installer.pod_targets
@@ -27,8 +28,6 @@ module Jazzy
27
28
 
28
29
  targets.map do |t|
29
30
  args = %W[doc --module-name #{podspec.module_name} -- -target #{t}]
30
- swift_version = compiler_swift_version(config.swift_version)
31
- args << "SWIFT_VERSION=#{swift_version}"
32
31
  SourceKitten.run_sourcekitten(args)
33
32
  end
34
33
  end
@@ -107,13 +106,24 @@ module Jazzy
107
106
  # Go from a full Swift version like 4.2.1 to
108
107
  # something valid for SWIFT_VERSION.
109
108
  def compiler_swift_version(user_version)
110
- return LATEST_SWIFT_VERSION unless user_version
109
+ unless user_version
110
+ return podspec_swift_version || LATEST_SWIFT_VERSION
111
+ end
111
112
 
112
113
  LONG_SWIFT_VERSIONS.select do |version|
113
114
  user_version.start_with?(version)
114
115
  end.last || "#{user_version[0]}.0"
115
116
  end
116
117
 
118
+ def podspec_swift_version
119
+ # `swift_versions` exists from CocoaPods 1.7
120
+ if podspec.respond_to?('swift_versions')
121
+ podspec.swift_versions.max
122
+ else
123
+ podspec.swift_version
124
+ end
125
+ end
126
+
117
127
  # @!group SourceKitten output helper methods
118
128
 
119
129
  def pod_path
@@ -124,7 +134,8 @@ module Jazzy
124
134
  end
125
135
  end
126
136
 
127
- def podfile
137
+ # rubocop:disable Metrics/MethodLength
138
+ def podfile(swift_version)
128
139
  podspec = @podspec
129
140
  path = pod_path
130
141
  @podfile ||= Pod::Podfile.new do
@@ -133,8 +144,7 @@ module Jazzy
133
144
  deterministic_uuids: false
134
145
 
135
146
  [podspec, *podspec.recursive_subspecs].each do |ss|
136
- # test_specification exists from CocoaPods 1.3.0
137
- next if ss.respond_to?('test_specification') && ss.test_specification
147
+ next if ss.test_specification
138
148
 
139
149
  ss.available_platforms.each do |p|
140
150
  # Travis builds take too long when building docs for all available
@@ -147,10 +157,12 @@ module Jazzy
147
157
  use_frameworks!
148
158
  platform p.name, p.deployment_target
149
159
  pod ss.name, path: path.realpath.to_s
160
+ current_target_definition.swift_version = swift_version
150
161
  end
151
162
  end
152
163
  end
153
164
  end
154
165
  end
166
+ # rubocop:enable Metrics/MethodLength
155
167
  end
156
168
  end
@@ -391,7 +391,8 @@ module Jazzy
391
391
  parsed &&
392
392
  (annotated.include?(' = default') || # SR-2608
393
393
  parsed.match('@autoclosure|@escaping') || # SR-6321
394
- parsed.include?("\n"))
394
+ parsed.include?("\n") ||
395
+ parsed.include?('extension '))
395
396
  end
396
397
 
397
398
  # Replace the fully qualified name of a type with its base name
@@ -337,6 +337,10 @@ header {
337
337
  padding-left: 3px;
338
338
  margin-left: 15px;
339
339
  font-size: 11.9px;
340
+ transition: all 300ms;
341
+ }
342
+ .token-open {
343
+ margin-left: 0px;
340
344
  }
341
345
  .discouraged {
342
346
  text-decoration: line-through;
@@ -8,29 +8,41 @@ if (navigator.userAgent.match(/xcode/i)) {
8
8
  window.jazzy.docset = true
9
9
  }
10
10
 
11
- // On doc load, toggle the URL hash discussion if present
12
- $(document).ready(function() {
13
- if (!window.jazzy.docset) {
14
- var linkToHash = $('a[href="' + window.location.hash +'"]');
15
- linkToHash.trigger("click");
11
+ function toggleItem($link, $content) {
12
+ var animationDuration = 300;
13
+ $link.toggleClass('token-open');
14
+ $content.slideToggle(animationDuration);
15
+ }
16
+
17
+ function itemLinkToContent($link) {
18
+ return $link.parent().parent().next();
19
+ }
20
+
21
+ // On doc load + hash-change, open any targetted item
22
+ function openCurrentItemIfClosed() {
23
+ if (window.jazzy.docset) {
24
+ return;
16
25
  }
17
- });
26
+ var $link = $(`.token[href="${location.hash}"]`);
27
+ $content = itemLinkToContent($link);
28
+ if ($content.is(':hidden')) {
29
+ toggleItem($link, $content);
30
+ }
31
+ }
18
32
 
19
- // On token click, toggle its discussion and animate token.marginLeft
20
- $(".token").click(function(event) {
33
+ $(openCurrentItemIfClosed);
34
+ $(window).on('hashchange', openCurrentItemIfClosed);
35
+
36
+ // On item link ('token') click, toggle its discussion
37
+ $('.token').on('click', function(event) {
21
38
  if (window.jazzy.docset) {
22
39
  return;
23
40
  }
24
- var link = $(this);
25
- var animationDuration = 300;
26
- var tokenOffset = "15px";
27
- var original = link.css('marginLeft') == tokenOffset;
28
- link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
29
- $content = link.parent().parent().next();
30
- $content.slideToggle(animationDuration);
41
+ var $link = $(this);
42
+ toggleItem($link, itemLinkToContent($link));
31
43
 
32
44
  // Keeps the document from jumping to the hash.
33
- var href = $(this).attr('href');
45
+ var href = $link.attr('href');
34
46
  if (history.pushState) {
35
47
  history.pushState({}, '', href);
36
48
  } else {
@@ -38,3 +50,10 @@ $(".token").click(function(event) {
38
50
  }
39
51
  event.preventDefault();
40
52
  });
53
+
54
+ // Clicks on links to the current, closed, item need to open the item
55
+ $("a:not('.token')").on('click', function() {
56
+ if (location == this.href) {
57
+ openCurrentItemIfClosed();
58
+ }
59
+ });
@@ -1,6 +1,6 @@
1
1
  <header>
2
2
  <div class="content-wrapper">
3
- <p><a href="{{path_to_root}}index.html">{{module_name}} Docs</a>{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}</p>
3
+ <p><a href="{{path_to_root}}index.html">{{docs_title}}</a>{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}</p>
4
4
  {{#github_url}}
5
5
  <p class="header-right"><a href="{{github_url}}"><img src="{{path_to_root}}img/gh.png"/>View on GitHub</a></p>
6
6
  {{/github_url}}
@@ -8,26 +8,41 @@ if (navigator.userAgent.match(/xcode/i)) {
8
8
  window.jazzy.docset = true
9
9
  }
10
10
 
11
- // On doc load, toggle the URL hash discussion if present
12
- $(document).ready(function() {
13
- if (!window.jazzy.docset) {
14
- var linkToHash = $('a[href="' + window.location.hash +'"]');
15
- linkToHash.trigger("click");
11
+ function toggleItem($link, $content) {
12
+ var animationDuration = 300;
13
+ $link.toggleClass('token-open');
14
+ $content.slideToggle(animationDuration);
15
+ }
16
+
17
+ function itemLinkToContent($link) {
18
+ return $link.parent().parent().next();
19
+ }
20
+
21
+ // On doc load + hash-change, open any targetted item
22
+ function openCurrentItemIfClosed() {
23
+ if (window.jazzy.docset) {
24
+ return;
16
25
  }
17
- });
26
+ var $link = $(`.token[href="${location.hash}"]`);
27
+ $content = itemLinkToContent($link);
28
+ if ($content.is(':hidden')) {
29
+ toggleItem($link, $content);
30
+ }
31
+ }
18
32
 
19
- // On token click, toggle its discussion and animate token.marginLeft
20
- $(".token").click(function(event) {
33
+ $(openCurrentItemIfClosed);
34
+ $(window).on('hashchange', openCurrentItemIfClosed);
35
+
36
+ // On item link ('token') click, toggle its discussion
37
+ $('.token').on('click', function(event) {
21
38
  if (window.jazzy.docset) {
22
39
  return;
23
40
  }
24
- var link = $(this);
25
- var animationDuration = 300;
26
- $content = link.parent().parent().next();
27
- $content.slideToggle(animationDuration);
41
+ var $link = $(this);
42
+ toggleItem($link, itemLinkToContent($link));
28
43
 
29
44
  // Keeps the document from jumping to the hash.
30
- var href = $(this).attr('href');
45
+ var href = $link.attr('href');
31
46
  if (history.pushState) {
32
47
  history.pushState({}, '', href);
33
48
  } else {
@@ -35,3 +50,10 @@ $(".token").click(function(event) {
35
50
  }
36
51
  event.preventDefault();
37
52
  });
53
+
54
+ // Clicks on links to the current, closed, item need to open the item
55
+ $("a:not('.token')").on('click', function() {
56
+ if (location == this.href) {
57
+ openCurrentItemIfClosed();
58
+ }
59
+ });
@@ -1,7 +1,7 @@
1
1
  <header class="header">
2
2
  <p class="header-col header-col--primary">
3
3
  <a class="header-link" href="{{path_to_root}}index.html">
4
- {{module_name}} Docs
4
+ {{docs_title}}
5
5
  </a>
6
6
  {{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}
7
7
  </p>
@@ -375,10 +375,14 @@ header {
375
375
  .token, .direct-link {
376
376
  padding-left: 3px;
377
377
  margin-left: 35px;
378
+ transition: all 300ms;
378
379
  }
379
380
  .discouraged {
380
381
  text-decoration: line-through;
381
382
  }
383
+ .token-open {
384
+ margin-left: 25px;
385
+ }
382
386
  .declaration-note {
383
387
  font-size: .85em;
384
388
  color: rgba(128,128,128,1);
@@ -8,30 +8,41 @@ if (navigator.userAgent.match(/xcode/i)) {
8
8
  window.jazzy.docset = true
9
9
  }
10
10
 
11
- // On doc load, toggle the URL hash discussion if present
12
- $(document).ready(function() {
13
- if (!window.jazzy.docset) {
14
- var linkToHash = $('a[href="' + window.location.hash +'"]');
15
- linkToHash.trigger("click");
11
+ function toggleItem($link, $content) {
12
+ var animationDuration = 300;
13
+ $link.toggleClass('token-open');
14
+ $content.slideToggle(animationDuration);
15
+ }
16
+
17
+ function itemLinkToContent($link) {
18
+ return $link.parent().parent().next();
19
+ }
20
+
21
+ // On doc load + hash-change, open any targetted item
22
+ function openCurrentItemIfClosed() {
23
+ if (window.jazzy.docset) {
24
+ return;
16
25
  }
17
- });
26
+ var $link = $(`.token[href="${location.hash}"]`);
27
+ $content = itemLinkToContent($link);
28
+ if ($content.is(':hidden')) {
29
+ toggleItem($link, $content);
30
+ }
31
+ }
18
32
 
19
- // On token click, toggle its discussion and animate token.marginLeft
20
- $(".token").click(function(event) {
33
+ $(openCurrentItemIfClosed);
34
+ $(window).on('hashchange', openCurrentItemIfClosed);
35
+
36
+ // On item link ('token') click, toggle its discussion
37
+ $('.token').on('click', function(event) {
21
38
  if (window.jazzy.docset) {
22
39
  return;
23
40
  }
24
- var link = $(this);
25
- var animationDuration = 300;
26
- var tokenOffset = "35px";
27
- var selectedOffset = "25px";
28
- var original = link.css('marginLeft') == tokenOffset;
29
- link.animate({'margin-left':original ? selectedOffset : tokenOffset}, animationDuration);
30
- $content = link.parent().parent().next();
31
- $content.slideToggle(animationDuration);
41
+ var $link = $(this);
42
+ toggleItem($link, itemLinkToContent($link));
32
43
 
33
44
  // Keeps the document from jumping to the hash.
34
- var href = $(this).attr('href');
45
+ var href = $link.attr('href');
35
46
  if (history.pushState) {
36
47
  history.pushState({}, '', href);
37
48
  } else {
@@ -39,3 +50,10 @@ $(".token").click(function(event) {
39
50
  }
40
51
  event.preventDefault();
41
52
  });
53
+
54
+ // Clicks on links to the current, closed, item need to open the item
55
+ $("a:not('.token')").on('click', function() {
56
+ if (location == this.href) {
57
+ openCurrentItemIfClosed();
58
+ }
59
+ });
@@ -1,7 +1,7 @@
1
1
  <header>
2
2
  <div class="content-wrapper">
3
3
  <p>
4
- <a href="{{path_to_root}}index.html">{{module_name}} Docs</a>
4
+ <a href="{{path_to_root}}index.html">{{docs_title}}</a>
5
5
  <span class="no-mobile">{{#doc_coverage}} ({{doc_coverage}}% documented){{/doc_coverage}}</span>
6
6
  </p>
7
7
 
@@ -103,6 +103,7 @@ describe_cli 'jazzy' do
103
103
  'JAZZY_FAKE_VERSION' => 'X.X.X',
104
104
  'COCOAPODS_SKIP_UPDATE_MESSAGE' => 'TRUE',
105
105
  'JAZZY_INTEGRATION_SPECS' => 'TRUE',
106
+ 'JAZZY_FAKE_MODULE_VERSION' => 'Y.Y.Y',
106
107
  }
107
108
  s.default_args = []
108
109
  s.replace_path ROOT.to_s, 'ROOT'
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.6
4
+ version: 0.10.0
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: 2019-04-03 00:00:00.000000000 Z
13
+ date: 2019-06-22 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.5.3
21
+ version: '1.5'
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.5.3
28
+ version: '1.5'
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: 1.1.0
35
+ version: '1.1'
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: 1.1.0
42
+ version: '1.1'
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.4.0
63
+ version: '3.4'
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.4.0
70
+ version: '3.4'
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.6.0
97
+ version: '3.6'
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.6.0
104
+ version: '3.6'
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.13
111
+ version: '1.3'
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.13
118
+ version: '1.3'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: xcinvoke
121
121
  requirement: !ruby/object:Gem::Requirement