jazzy 0.13.4 → 0.13.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
  SHA256:
3
- metadata.gz: e6614bb5a4465f50a9f0188ec56ad872d82963245f790c1815b650452be8d652
4
- data.tar.gz: d807b40f914ca121eeaf8ff72016300f9da340f54aeeab310319a40c1bb90d3b
3
+ metadata.gz: 9b896e2cc19ed17de08bbaf77655ce4cc28ba3b086c4b324c6f3c15d3f61c5c2
4
+ data.tar.gz: 6dda6fa99cc9c4282f3818f405f218b23d22e57b6869be208082e36b25873dd0
5
5
  SHA512:
6
- metadata.gz: cedba7374e64a603835c5270b1dcd57d79b79536fd9bc434995e35c223f55c6b100628296233e7370c7b8ebf4fba545475c7aac2f51510d8437dcb8a86aa3230
7
- data.tar.gz: 6260815f7523b409fc6af6e4ce15a543f101e8bb85cf196a5dc4c0e6125efc77241e422de8a44f5925d587b83d825e076eb209d24fea04311f57b120b218ef89
6
+ metadata.gz: 7d3a45bc3b94976166452b9ddf2c411dff01acedd555ba7b124f5eb66c078f5cdab652958a83017e1a253384b874316bf25e523a6eb6f814eb8c04b282063ee5
7
+ data.tar.gz: e7816087c597af5c4811f7c1155160242268b6beb25c610d93f571e749bc2c92edc7633712eed492d882d23f9576af98637ef46e8857ed4f547608ede6387439
@@ -1,3 +1,30 @@
1
+ ## 0.13.5
2
+
3
+ ##### Breaking
4
+
5
+ * None.
6
+
7
+ ##### Enhancements
8
+
9
+ * Add search function to `apple` theme.
10
+ [Giles Payne](https://github.com/komakai)
11
+ [#726](https://github.com/realm/jazzy/issues/726)
12
+
13
+ * Add option `--[no-]separate-global-declarations` to always create separate
14
+ documentation pages for top-level declarations as well as classes,
15
+ structures, enums etc. even if they don't have members. As part of this,
16
+ improve the main page declaration in all modes.
17
+ [Nikolay Volosatov](https://github.com/bamx23)
18
+ [John Fairhurst](https://github.com/johnfairh)
19
+
20
+ ##### Bug Fixes
21
+
22
+ * Style fixes for `apple` and `jony` themes to codeblocks inside lists and
23
+ links.
24
+ [John Fairhurst](https://github.com/johnfairh)
25
+ [#818](https://github.com/realm/jazzy/issues/818)
26
+ [#1177](https://github.com/realm/jazzy/issues/1177)
27
+
1
28
  ## 0.13.4
2
29
 
3
30
  ##### Breaking
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jazzy (0.13.4)
4
+ jazzy (0.13.5)
5
5
  cocoapods (~> 1.5)
6
6
  mustache (~> 1.1)
7
7
  open4
@@ -22,10 +22,10 @@ GEM
22
22
  tzinfo (~> 1.1)
23
23
  addressable (2.7.0)
24
24
  public_suffix (>= 2.0.2, < 5.0)
25
- algoliasearch (1.27.2)
25
+ algoliasearch (1.27.3)
26
26
  httpclient (~> 2.8, >= 2.8.3)
27
27
  json (>= 1.5.1)
28
- ast (2.4.0)
28
+ ast (2.4.1)
29
29
  atomos (0.1.3)
30
30
  bacon (1.2.0)
31
31
  claide (1.0.3)
@@ -80,7 +80,7 @@ GEM
80
80
  colored2 (~> 3.1)
81
81
  crack (0.4.3)
82
82
  safe_yaml (~> 1.0.0)
83
- danger (8.0.0)
83
+ danger (8.0.2)
84
84
  claide (~> 1.0)
85
85
  claide-plugins (>= 0.9.2)
86
86
  colored2 (~> 3.1)
@@ -101,7 +101,7 @@ GEM
101
101
  multipart-post (>= 1.2, < 3)
102
102
  faraday-http-cache (2.2.0)
103
103
  faraday (>= 0.8)
104
- ffi (1.12.2)
104
+ ffi (1.13.1)
105
105
  fourflusher (2.3.1)
106
106
  fuzzy_match (2.0.4)
107
107
  gh_inspector (1.1.3)
@@ -111,8 +111,8 @@ GEM
111
111
  httpclient (2.8.3)
112
112
  i18n (0.9.5)
113
113
  concurrent-ruby (~> 1.0)
114
- json (2.3.0)
115
- kramdown (2.2.1)
114
+ json (2.3.1)
115
+ kramdown (2.3.0)
116
116
  rexml
117
117
  kramdown-parser-gfm (1.1.0)
118
118
  kramdown (~> 2.0)
@@ -132,9 +132,9 @@ GEM
132
132
  faraday (>= 0.9)
133
133
  sawyer (~> 0.8.0, >= 0.5.3)
134
134
  open4 (1.3.4)
135
- parallel (1.19.1)
136
- parser (2.7.1.3)
137
- ast (~> 2.4.0)
135
+ parallel (1.19.2)
136
+ parser (2.7.1.4)
137
+ ast (~> 2.4.1)
138
138
  powerpack (0.1.2)
139
139
  prettybacon (0.0.2)
140
140
  bacon (~> 1.2)
@@ -145,7 +145,7 @@ GEM
145
145
  rchardet (1.8.0)
146
146
  redcarpet (3.5.0)
147
147
  rexml (3.2.4)
148
- rouge (3.19.0)
148
+ rouge (3.20.0)
149
149
  rubocop (0.49.0)
150
150
  parallel (~> 1.10)
151
151
  parser (>= 2.3.3.1, < 3.0)
@@ -156,7 +156,7 @@ GEM
156
156
  ruby-macho (1.4.0)
157
157
  ruby-progressbar (1.10.1)
158
158
  safe_yaml (1.0.5)
159
- sassc (2.3.0)
159
+ sassc (2.4.0)
160
160
  ffi (~> 1.9)
161
161
  sawyer (0.8.2)
162
162
  addressable (>= 2.3.5)
@@ -176,7 +176,7 @@ GEM
176
176
  hashdiff (>= 0.4.0, < 2.0.0)
177
177
  xcinvoke (0.3.0)
178
178
  liferaft (~> 0.0.6)
179
- xcodeproj (1.16.0)
179
+ xcodeproj (1.17.0)
180
180
  CFPropertyList (>= 2.3.3, < 4.0)
181
181
  atomos (~> 0.1.3)
182
182
  claide (>= 1.0.2, < 2.0)
data/README.md CHANGED
@@ -281,6 +281,13 @@ Note that the `--include` option is applied before the `--exclude` option. For e
281
281
  Declarations with a documentation comment containing `:nodoc:` are excluded from the
282
282
  documentation.
283
283
 
284
+ ### Documentation structure
285
+
286
+ By default Jazzy does not create separate web pages for declarations that do
287
+ not have any members: instead they are nested into some parent page. Use the
288
+ `--separate-global-declarations` flag to change this and always create pages
289
+ for declarations that can be directly accessed from client code.
290
+
284
291
  ### Choosing the Swift language version
285
292
 
286
293
  Jazzy normally uses the Swift compiler from the Xcode currently configured by
data/Rakefile CHANGED
@@ -117,9 +117,14 @@ begin
117
117
  'themes/fullwidth/assets/js',
118
118
  'themes/jony/assets/js'
119
119
  ],
120
- 'lunr/lunr.min.js' => ['themes/fullwidth/assets/js'],
121
- 'corejs-typeahead/dist/typeahead.jquery.js' =>
122
- ['themes/fullwidth/assets/js'],
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
+ ],
123
128
  'katex/dist/katex.min.css' => ['extensions/katex/css'],
124
129
  'katex/dist/fonts' => ['extensions/katex/css'],
125
130
  'katex/dist/katex.min.js' => ['extensions/katex/js']
@@ -437,6 +437,13 @@ module Jazzy
437
437
  'is "Undocumented", put "" if no text is required',
438
438
  default: 'Undocumented'
439
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
+
440
447
  # rubocop:enable Style/AlignParameter
441
448
 
442
449
  def initialize
@@ -432,12 +432,18 @@ module Jazzy
432
432
  doc[:kind] = doc_model.type.name
433
433
  doc[:dash_type] = doc_model.type.dash_type
434
434
  doc[:declaration] = doc_model.display_declaration
435
+ doc[:language] = doc_model.display_language
436
+ doc[:other_language_declaration] =
437
+ doc_model.display_other_language_declaration
435
438
  doc[:overview] = overview
439
+ doc[:parameters] = doc_model.parameters
440
+ doc[:return] = doc_model.return
436
441
  doc[:structure] = source_module.doc_structure
437
442
  doc[:tasks] = render_tasks(source_module, doc_model.children)
438
443
  doc[:module_name] = source_module.name
439
444
  doc[:author_name] = source_module.author_name
440
445
  doc[:github_url] = source_module.github_url
446
+ doc[:github_token_url] = gh_token_url(doc_model, source_module)
441
447
  doc[:dash_url] = source_module.dash_url
442
448
  doc[:path_to_root] = path_to_root
443
449
  doc[:deprecation_message] = doc_model.deprecation_message
@@ -1,3 +1,3 @@
1
1
  module Jazzy
2
- VERSION = '0.13.4'.freeze unless defined? Jazzy::VERSION
2
+ VERSION = '0.13.5'.freeze unless defined? Jazzy::VERSION
3
3
  end
@@ -11,7 +11,9 @@ module Jazzy
11
11
 
12
12
  # Give the item its own page or just inline into parent?
13
13
  def render_as_page?
14
- children.any?
14
+ children.any? ||
15
+ (Config.instance.separate_global_declarations &&
16
+ type.global?)
15
17
  end
16
18
 
17
19
  def swift?
@@ -25,7 +27,8 @@ module Jazzy
25
27
  # When referencing this item from its parent category,
26
28
  # include the content or just link to it directly?
27
29
  def omit_content_from_parent?
28
- false
30
+ Config.instance.separate_global_declarations &&
31
+ render_as_page?
29
32
  end
30
33
 
31
34
  # Element containing this declaration in the code
@@ -108,6 +111,7 @@ module Jazzy
108
111
  attr_accessor :line
109
112
  attr_accessor :column
110
113
  attr_accessor :usr
114
+ attr_accessor :type_usr
111
115
  attr_accessor :modulename
112
116
  attr_accessor :name
113
117
  attr_accessor :objc_name
@@ -141,6 +145,15 @@ module Jazzy
141
145
  CGI.unescape(url)
142
146
  end
143
147
 
148
+ # Base filename (no extension) for the item
149
+ def docs_filename
150
+ result = url_name || name
151
+ # Workaround functions sharing names with
152
+ # different argument types (f(a:Int) vs. f(a:String))
153
+ return result unless type.swift_global_function?
154
+ result + "_#{type_usr}"
155
+ end
156
+
144
157
  def constrained_extension?
145
158
  type.swift_extension? &&
146
159
  generic_requirements
@@ -23,6 +23,12 @@ module Jazzy
23
23
  @type && @type[:jazzy]
24
24
  end
25
25
 
26
+ # kinds that are 'global' and should get their own pages
27
+ # with --separate-global-declarations
28
+ def global?
29
+ @type && @type[:global]
30
+ end
31
+
26
32
  # name to use for type subdirectory in URLs for back-compatibility
27
33
  def url_name
28
34
  @type && (@type[:url] || @type[:jazzy])
@@ -118,6 +124,10 @@ module Jazzy
118
124
  kind == 'source.lang.swift.decl.typealias'
119
125
  end
120
126
 
127
+ def swift_global_function?
128
+ kind == 'source.lang.swift.decl.function.free'
129
+ end
130
+
121
131
  def param?
122
132
  # SourceKit strangely categorizes initializer parameters as local
123
133
  # variables, so both kinds represent a parameter in jazzy.
@@ -180,19 +190,23 @@ module Jazzy
180
190
  'sourcekitten.source.lang.objc.decl.category' => {
181
191
  jazzy: 'Category',
182
192
  dash: 'Extension',
193
+ global: true,
183
194
  }.freeze,
184
195
  'sourcekitten.source.lang.objc.decl.class' => {
185
196
  jazzy: 'Class',
186
197
  dash: 'Class',
198
+ global: true,
187
199
  }.freeze,
188
200
  'sourcekitten.source.lang.objc.decl.constant' => {
189
201
  jazzy: 'Constant',
190
202
  dash: 'Constant',
203
+ global: true,
191
204
  }.freeze,
192
205
  'sourcekitten.source.lang.objc.decl.enum' => {
193
206
  jazzy: 'Enumeration',
194
207
  url: 'Enum',
195
208
  dash: 'Enum',
209
+ global: true,
196
210
  }.freeze,
197
211
  'sourcekitten.source.lang.objc.decl.enumcase' => {
198
212
  jazzy: 'Enumeration Case',
@@ -217,10 +231,12 @@ module Jazzy
217
231
  'sourcekitten.source.lang.objc.decl.protocol' => {
218
232
  jazzy: 'Protocol',
219
233
  dash: 'Protocol',
234
+ global: true,
220
235
  }.freeze,
221
236
  'sourcekitten.source.lang.objc.decl.typedef' => {
222
237
  jazzy: 'Type Definition',
223
238
  dash: 'Type',
239
+ global: true,
224
240
  }.freeze,
225
241
  'sourcekitten.source.lang.objc.mark' => {
226
242
  jazzy: 'Mark',
@@ -229,11 +245,13 @@ module Jazzy
229
245
  'sourcekitten.source.lang.objc.decl.function' => {
230
246
  jazzy: 'Function',
231
247
  dash: 'Function',
248
+ global: true,
232
249
  }.freeze,
233
250
  'sourcekitten.source.lang.objc.decl.struct' => {
234
251
  jazzy: 'Structure',
235
252
  url: 'Struct',
236
253
  dash: 'Struct',
254
+ global: true,
237
255
  }.freeze,
238
256
  'sourcekitten.source.lang.objc.decl.field' => {
239
257
  jazzy: 'Field',
@@ -300,6 +318,7 @@ module Jazzy
300
318
  'source.lang.swift.decl.class' => {
301
319
  jazzy: 'Class',
302
320
  dash: 'Class',
321
+ global: true,
303
322
  }.freeze,
304
323
  'source.lang.swift.decl.function.constructor' => {
305
324
  jazzy: 'Initializer',
@@ -312,6 +331,7 @@ module Jazzy
312
331
  'source.lang.swift.decl.var.global' => {
313
332
  jazzy: 'Global Variable',
314
333
  dash: 'Global',
334
+ global: true,
315
335
  }.freeze,
316
336
  'source.lang.swift.decl.enumcase' => {
317
337
  jazzy: 'Enumeration Case',
@@ -325,30 +345,37 @@ module Jazzy
325
345
  jazzy: 'Enumeration',
326
346
  url: 'Enum',
327
347
  dash: 'Enum',
348
+ global: true,
328
349
  }.freeze,
329
350
  'source.lang.swift.decl.extension' => {
330
351
  jazzy: 'Extension',
331
352
  dash: 'Extension',
353
+ global: true,
332
354
  }.freeze,
333
355
  'source.lang.swift.decl.extension.class' => {
334
356
  jazzy: 'Class Extension',
335
357
  dash: 'Extension',
358
+ global: true,
336
359
  }.freeze,
337
360
  'source.lang.swift.decl.extension.enum' => {
338
361
  jazzy: 'Enumeration Extension',
339
362
  dash: 'Extension',
363
+ global: true,
340
364
  }.freeze,
341
365
  'source.lang.swift.decl.extension.protocol' => {
342
366
  jazzy: 'Protocol Extension',
343
367
  dash: 'Extension',
368
+ global: true,
344
369
  }.freeze,
345
370
  'source.lang.swift.decl.extension.struct' => {
346
371
  jazzy: 'Structure Extension',
347
372
  dash: 'Extension',
373
+ global: true,
348
374
  }.freeze,
349
375
  'source.lang.swift.decl.function.free' => {
350
376
  jazzy: 'Function',
351
377
  dash: 'Function',
378
+ global: true,
352
379
  }.freeze,
353
380
  'source.lang.swift.decl.function.method.instance' => {
354
381
  jazzy: 'Instance Method',
@@ -369,6 +396,7 @@ module Jazzy
369
396
  'source.lang.swift.decl.protocol' => {
370
397
  jazzy: 'Protocol',
371
398
  dash: 'Protocol',
399
+ global: true,
372
400
  }.freeze,
373
401
  'source.lang.swift.decl.function.method.static' => {
374
402
  jazzy: 'Static Method',
@@ -382,6 +410,7 @@ module Jazzy
382
410
  jazzy: 'Structure',
383
411
  url: 'Struct',
384
412
  dash: 'Struct',
413
+ global: true,
385
414
  }.freeze,
386
415
  'source.lang.swift.decl.function.subscript' => {
387
416
  jazzy: 'Subscript',
@@ -391,6 +420,7 @@ module Jazzy
391
420
  jazzy: 'Type Alias',
392
421
  url: 'Typealias',
393
422
  dash: 'Alias',
423
+ global: true,
394
424
  }.freeze,
395
425
  'source.lang.swift.decl.generic_type_param' => {
396
426
  jazzy: 'Generic Type Parameter',
@@ -138,7 +138,7 @@ module Jazzy
138
138
  end
139
139
 
140
140
  def self.sanitize_filename(doc)
141
- unsafe_filename = doc.url_name || doc.name
141
+ unsafe_filename = doc.docs_filename
142
142
  sanitzation_enabled = Config.instance.use_safe_filenames
143
143
  if sanitzation_enabled && !doc.type.name_controlled_manually?
144
144
  return CGI.escape(unsafe_filename).gsub('_', '%5F').tr('%', '_')
@@ -565,6 +565,7 @@ module Jazzy
565
565
 
566
566
  declaration.file = Pathname(doc['key.filepath']) if doc['key.filepath']
567
567
  declaration.usr = doc['key.usr']
568
+ declaration.type_usr = doc['key.typeusr']
568
569
  declaration.modulename = doc['key.modulename']
569
570
  declaration.name = documented_name
570
571
  declaration.mark = current_mark
@@ -18,7 +18,7 @@ $content_wrapper_width: 980px;
18
18
  $content_top_offset: 70px;
19
19
  $content_body_margin: 16px;
20
20
  $content_body_left_offset: $sidebar_width + $content_body_margin;
21
- $header_height: 26px;
21
+ $header_height: 32px;
22
22
  $breadcrumb_padding_top: 17px;
23
23
 
24
24
  $code_font: 0.95em Menlo, monospace;
@@ -104,12 +104,18 @@ p code, li code {
104
104
  padding: 2px 4px;
105
105
  border-radius: 4px;
106
106
  }
107
+ pre > code {
108
+ padding: 0;
109
+ }
107
110
 
108
111
  // Links
109
112
 
110
113
  a {
111
114
  color: $link_color;
112
115
  text-decoration: none;
116
+ code {
117
+ color: inherit;
118
+ }
113
119
  }
114
120
 
115
121
  // Lists
@@ -152,7 +158,7 @@ header {
152
158
  background-color: $bg_color;
153
159
  position: fixed;
154
160
  width: 100%;
155
- z-index: 2;
161
+ z-index: 3;
156
162
  img {
157
163
  padding-right: 6px;
158
164
  vertical-align: -4px;
@@ -309,6 +315,7 @@ header {
309
315
  }
310
316
 
311
317
  .task-group-section {
318
+ margin-top: 10px;
312
319
  padding-left: 6px;
313
320
  border-top: $gray_border;
314
321
  }
@@ -529,3 +536,69 @@ html.dash {
529
536
  position: static;
530
537
  }
531
538
  }
539
+
540
+ // ===========================================================================
541
+ //
542
+ // Search
543
+ //
544
+ // ===========================================================================
545
+ form[role=search] {
546
+ float: right;
547
+
548
+ input {
549
+ font: Helvetica, freesans, Arial, sans-serif;
550
+ margin-top: 6px;
551
+ font-size: 13px;
552
+ line-height: 20px;
553
+ padding: 0px 10px;
554
+ border: none;
555
+ border-radius: 1em;
556
+ .loading & {
557
+ background: white url(../img/spinner.gif) center right 4px no-repeat;
558
+ }
559
+ }
560
+
561
+ // Typeahead elements
562
+
563
+ .tt-menu {
564
+ margin: 0;
565
+ min-width: 300px;
566
+ background: $white_color;
567
+ color: #333;
568
+ border: $gray_border;
569
+ z-index: 4;
570
+ }
571
+
572
+ .tt-highlight {
573
+ font-weight: bold;
574
+ }
575
+
576
+ .tt-suggestion {
577
+ font: Helvetica, freesans, Arial, sans-serif;
578
+ font-size: 14px;
579
+ padding: 0 8px;
580
+ span {
581
+ display: table-cell;
582
+ white-space: nowrap;
583
+ }
584
+ .doc-parent-name {
585
+ width: 100%;
586
+ text-align: right;
587
+ font-weight: normal;
588
+ font-size: 0.9em;
589
+ padding-left: 16px;
590
+ }
591
+ }
592
+
593
+ .tt-suggestion:hover,
594
+ .tt-suggestion.tt-cursor {
595
+ cursor: pointer;
596
+ background-color: #4183c4;
597
+ color: #fff;
598
+ }
599
+
600
+ .tt-suggestion:hover .doc-parent-name,
601
+ .tt-suggestion.tt-cursor .doc-parent-name {
602
+ color: #fff;
603
+ }
604
+ }