jazzy 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,5 +27,15 @@ module Jazzy
27
27
 
28
28
  self.name = mark_string[start_index..end_index]
29
29
  end
30
+
31
+ def empty?
32
+ !name && !has_start_dash && !has_end_dash
33
+ end
34
+
35
+ def copy(other)
36
+ self.name = other.name
37
+ self.has_start_dash = other.has_start_dash
38
+ self.has_end_dash = other.has_end_dash
39
+ end
30
40
  end
31
41
  end
@@ -3,6 +3,7 @@ require 'pathname'
3
3
  require 'shellwords'
4
4
  require 'xcinvoke'
5
5
  require 'cgi'
6
+ require 'rexml/document'
6
7
 
7
8
  require 'jazzy/config'
8
9
  require 'jazzy/executable'
@@ -43,6 +44,10 @@ class String
43
44
  end
44
45
  end
45
46
  end
47
+
48
+ def unindent(count)
49
+ gsub(/^#{' ' * count}/, '')
50
+ end
46
51
  end
47
52
 
48
53
  module Jazzy
@@ -304,17 +309,17 @@ module Jazzy
304
309
  end.reject { |param| param[:discussion].nil? }
305
310
  end
306
311
 
307
- # rubocop:disable Metrics/CyclomaticComplexity
308
312
  def self.make_doc_info(doc, declaration)
309
313
  return unless should_document?(doc)
310
314
 
311
- declaration.declaration = Highlighter.highlight(
312
- doc['key.parsed_declaration'] || doc['key.doc.declaration'],
313
- )
314
- if Config.instance.objc_mode && doc['key.swift_declaration']
315
- declaration.other_language_declaration = Highlighter.highlight(
316
- doc['key.swift_declaration'], 'swift'
317
- )
315
+ if Config.instance.objc_mode
316
+ declaration.declaration =
317
+ Highlighter.highlight(doc['key.parsed_declaration'])
318
+ declaration.other_language_declaration =
319
+ Highlighter.highlight(doc['key.swift_declaration'], 'swift')
320
+ else
321
+ declaration.declaration =
322
+ Highlighter.highlight(make_swift_declaration(doc, declaration))
318
323
  end
319
324
 
320
325
  unless doc['key.doc.full_as_xml']
@@ -329,7 +334,86 @@ module Jazzy
329
334
 
330
335
  @stats.add_documented
331
336
  end
332
- # rubocop:enable Metrics/CyclomaticComplexity
337
+
338
+ # Strip tags and convert entities
339
+ def self.xml_to_text(xml)
340
+ document = REXML::Document.new(xml)
341
+ REXML::XPath.match(document.root, '//text()').map(&:value).join
342
+ end
343
+
344
+ # Regexp to match an @attribute. Complex to handle @available().
345
+ def self.attribute_regexp(name)
346
+ qstring = /"(?:[^"\\]*|\\.)*"/
347
+ %r{@#{name} # @attr name
348
+ (?:\s*\( # optionally followed by spaces + parens,
349
+ (?: # containing any number of either..
350
+ [^")]*| # normal characters or...
351
+ #{qstring} # quoted strings.
352
+ )* # (end parens content)
353
+ \))? # (end optional parens)
354
+ }x
355
+ end
356
+
357
+ # Get all attributes of some name
358
+ def self.extract_attributes(declaration, name = '\w+')
359
+ attrs = declaration.scan(attribute_regexp(name))
360
+ # Rouge #806 workaround, use unicode lookalike for ')' inside attributes.
361
+ attrs.map { |str| str.gsub(/\)(?!\s*$)/, "\ufe5a") }
362
+ end
363
+
364
+ def self.extract_availability(declaration)
365
+ extract_attributes(declaration, 'available')
366
+ end
367
+
368
+ # Split leading attributes from a decl, returning both parts.
369
+ def self.split_decl_attributes(declaration)
370
+ declaration =~ /^((?:#{attribute_regexp('\w+')}\s*)*)(.*)$/m
371
+ Regexp.last_match.captures
372
+ end
373
+
374
+ def self.prefer_parsed_decl?(parsed, annotated)
375
+ parsed &&
376
+ (annotated.include?(' = default') || # SR-2608
377
+ parsed.match('@autoclosure|@escaping') || # SR-6321
378
+ parsed.include?("\n"))
379
+ end
380
+
381
+ # Replace the fully qualified name of a type with its base name
382
+ def self.unqualify_name(annotated_decl, declaration)
383
+ annotated_decl.gsub(declaration.fully_qualified_name_regexp,
384
+ declaration.name)
385
+ end
386
+
387
+ # Find the best Swift declaration
388
+ def self.make_swift_declaration(doc, declaration)
389
+ # From compiler 'quick help' style
390
+ annotated_decl_xml = doc['key.annotated_decl']
391
+
392
+ return nil unless annotated_decl_xml
393
+
394
+ annotated_decl_attrs, annotated_decl_body =
395
+ split_decl_attributes(xml_to_text(annotated_decl_xml))
396
+
397
+ # From source code
398
+ parsed_decl = doc['key.parsed_declaration']
399
+
400
+ decl =
401
+ if prefer_parsed_decl?(parsed_decl, annotated_decl_body)
402
+ # Strip any attrs captured by parsed version
403
+ inline_attrs, parsed_decl_body = split_decl_attributes(parsed_decl)
404
+ parsed_decl_body.unindent(inline_attrs.length)
405
+ else
406
+ # Strip ugly references to decl type name
407
+ unqualify_name(annotated_decl_body, declaration)
408
+ end
409
+
410
+ # @available attrs only in compiler 'interface' style
411
+ available_attrs = extract_availability(doc['key.doc.declaration'] || '')
412
+
413
+ available_attrs.concat(extract_attributes(annotated_decl_attrs))
414
+ .push(decl)
415
+ .join("\n")
416
+ end
333
417
 
334
418
  def self.make_substructure(doc, declaration)
335
419
  declaration.children = if doc['key.substructure']
@@ -345,9 +429,9 @@ module Jazzy
345
429
  # rubocop:disable Metrics/MethodLength
346
430
  # rubocop:disable Metrics/CyclomaticComplexity
347
431
  # rubocop:disable Metrics/PerceivedComplexity
348
- def self.make_source_declarations(docs, parent = nil)
432
+ def self.make_source_declarations(docs, parent = nil, mark = SourceMark.new)
349
433
  declarations = []
350
- current_mark = SourceMark.new
434
+ current_mark = mark
351
435
  Array(docs).each do |doc|
352
436
  if doc.key?('key.diagnostic_stage')
353
437
  declarations += make_source_declarations(
@@ -366,11 +450,13 @@ module Jazzy
366
450
  else
367
451
  declaration.objc_name
368
452
  end
369
- current_mark = SourceMark.new(documented_name) if declaration.type.mark?
453
+ if declaration.type.task_mark?(documented_name)
454
+ current_mark = SourceMark.new(documented_name)
455
+ end
370
456
  if declaration.type.swift_enum_case?
371
457
  # Enum "cases" are thin wrappers around enum "elements".
372
458
  declarations += make_source_declarations(
373
- doc['key.substructure'], parent
459
+ doc['key.substructure'], parent, current_mark
374
460
  )
375
461
  next
376
462
  end
@@ -484,17 +570,14 @@ module Jazzy
484
570
  end
485
571
  typedecl = typedecls.first
486
572
 
487
- if typedecl && typedecl.type.swift_protocol?
488
- merge_default_implementations_into_protocol(typedecl, extensions)
489
- mark_members_from_protocol_extension(extensions)
490
- extensions.reject! { |ext| ext.children.empty? }
491
- elsif typedecl && typedecl.type.objc_class?
492
- # Mark children merged from categories with the name of category
493
- # (unless they already have a mark)
494
- extensions.each do |ext|
495
- _, category_name = ext.objc_category_name
496
- ext.children.each { |c| c.mark.name ||= category_name }
573
+ if typedecl
574
+ if typedecl.type.swift_protocol?
575
+ merge_default_implementations_into_protocol(typedecl, extensions)
576
+ mark_members_from_protocol_extension(extensions)
577
+ extensions.reject! { |ext| ext.children.empty? }
497
578
  end
579
+
580
+ merge_declaration_marks(typedecl, extensions)
498
581
  end
499
582
 
500
583
  decls = typedecls + extensions
@@ -538,11 +621,54 @@ module Jazzy
538
621
  end
539
622
  end
540
623
 
624
+ # Customize marks associated with to-be-merged declarations
625
+ def self.merge_declaration_marks(typedecl, extensions)
626
+ if typedecl.type.objc_class?
627
+ # Mark children merged from categories with the name of category
628
+ # (unless they already have a mark)
629
+ extensions.each do |ext|
630
+ _, category_name = ext.objc_category_name
631
+ ext.children.each { |c| c.mark.name ||= category_name }
632
+ end
633
+ else
634
+ # If the Swift extension has a mark and the first child doesn't
635
+ # then copy the mark contents down so it still shows up.
636
+ extensions.each do |ext|
637
+ child = ext.children.first
638
+ if child && child.mark.empty?
639
+ child.mark.copy(ext.mark)
640
+ end
641
+ end
642
+ end
643
+ end
644
+
645
+ # Apply filtering based on the "included" and "excluded" flags.
646
+ def self.filter_files(json)
647
+ json = filter_included_files(json) if Config.instance.included_files.any?
648
+ json = filter_excluded_files(json) if Config.instance.excluded_files.any?
649
+ json.map do |doc|
650
+ key = doc.keys.first
651
+ doc[key]
652
+ end.compact
653
+ end
654
+
655
+ # Filter based on the "included" flag.
656
+ def self.filter_included_files(json)
657
+ included_files = Config.instance.included_files
658
+ json.map do |doc|
659
+ key = doc.keys.first
660
+ doc if included_files.detect do |include|
661
+ File.fnmatch?(include, key)
662
+ end
663
+ end.compact
664
+ end
665
+
666
+ # Filter based on the "excluded" flag.
541
667
  def self.filter_excluded_files(json)
542
668
  excluded_files = Config.instance.excluded_files
543
669
  json.map do |doc|
544
670
  key = doc.keys.first
545
- doc[key] unless excluded_files.detect do |exclude|
671
+ doc unless excluded_files.detect do |exclude|
546
672
  File.fnmatch?(exclude, key)
547
673
  end
548
674
  end.compact
@@ -665,7 +791,7 @@ module Jazzy
665
791
  @min_acl = min_acl
666
792
  @skip_undocumented = skip_undocumented
667
793
  @stats = Stats.new
668
- sourcekitten_json = filter_excluded_files(JSON.parse(sourcekitten_output))
794
+ sourcekitten_json = filter_files(JSON.parse(sourcekitten_output))
669
795
  docs = make_source_declarations(sourcekitten_json).concat inject_docs
670
796
  docs = expand_extensions(docs)
671
797
  docs = deduplicate_declarations(docs)
@@ -0,0 +1,63 @@
1
+ /* Credit to https://gist.github.com/wataru420/2048287 */
2
+
3
+ .highlight {
4
+ .c { color: #999988; font-style: italic } /* Comment */
5
+ .err { color: #a61717; background-color: #e3d2d2 } /* Error */
6
+ .k { color: #000000; font-weight: bold } /* Keyword */
7
+ .o { color: #000000; font-weight: bold } /* Operator */
8
+ .cm { color: #999988; font-style: italic } /* Comment.Multiline */
9
+ .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
10
+ .c1 { color: #999988; font-style: italic } /* Comment.Single */
11
+ .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
12
+ .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
13
+ .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
14
+ .ge { color: #000000; font-style: italic } /* Generic.Emph */
15
+ .gr { color: #aa0000 } /* Generic.Error */
16
+ .gh { color: #999999 } /* Generic.Heading */
17
+ .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
18
+ .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
19
+ .go { color: #888888 } /* Generic.Output */
20
+ .gp { color: #555555 } /* Generic.Prompt */
21
+ .gs { font-weight: bold } /* Generic.Strong */
22
+ .gu { color: #aaaaaa } /* Generic.Subheading */
23
+ .gt { color: #aa0000 } /* Generic.Traceback */
24
+ .kc { color: #000000; font-weight: bold } /* Keyword.Constant */
25
+ .kd { color: #000000; font-weight: bold } /* Keyword.Declaration */
26
+ .kp { color: #000000; font-weight: bold } /* Keyword.Pseudo */
27
+ .kr { color: #000000; font-weight: bold } /* Keyword.Reserved */
28
+ .kt { color: #445588; } /* Keyword.Type */
29
+ .m { color: #009999 } /* Literal.Number */
30
+ .s { color: #d14 } /* Literal.String */
31
+ .na { color: #008080 } /* Name.Attribute */
32
+ .nb { color: #0086B3 } /* Name.Builtin */
33
+ .nc { color: #445588; font-weight: bold } /* Name.Class */
34
+ .no { color: #008080 } /* Name.Constant */
35
+ .ni { color: #800080 } /* Name.Entity */
36
+ .ne { color: #990000; font-weight: bold } /* Name.Exception */
37
+ .nf { color: #990000; } /* Name.Function */
38
+ .nn { color: #555555 } /* Name.Namespace */
39
+ .nt { color: #000080 } /* Name.Tag */
40
+ .nv { color: #008080 } /* Name.Variable */
41
+ .ow { color: #000000; font-weight: bold } /* Operator.Word */
42
+ .w { color: #bbbbbb } /* Text.Whitespace */
43
+ .mf { color: #009999 } /* Literal.Number.Float */
44
+ .mh { color: #009999 } /* Literal.Number.Hex */
45
+ .mi { color: #009999 } /* Literal.Number.Integer */
46
+ .mo { color: #009999 } /* Literal.Number.Oct */
47
+ .sb { color: #d14 } /* Literal.String.Backtick */
48
+ .sc { color: #d14 } /* Literal.String.Char */
49
+ .sd { color: #d14 } /* Literal.String.Doc */
50
+ .s2 { color: #d14 } /* Literal.String.Double */
51
+ .se { color: #d14 } /* Literal.String.Escape */
52
+ .sh { color: #d14 } /* Literal.String.Heredoc */
53
+ .si { color: #d14 } /* Literal.String.Interpol */
54
+ .sx { color: #d14 } /* Literal.String.Other */
55
+ .sr { color: #009926 } /* Literal.String.Regex */
56
+ .s1 { color: #d14 } /* Literal.String.Single */
57
+ .ss { color: #990073 } /* Literal.String.Symbol */
58
+ .bp { color: #999999 } /* Name.Builtin.Pseudo */
59
+ .vc { color: #008080 } /* Name.Variable.Class */
60
+ .vg { color: #008080 } /* Name.Variable.Global */
61
+ .vi { color: #008080 } /* Name.Variable.Instance */
62
+ .il { color: #009999 } /* Literal.Number.Integer.Long */
63
+ }
@@ -0,0 +1,534 @@
1
+ ////////////////////////////////
2
+ // Constants
3
+ ////////////////////////////////
4
+
5
+ $bg_color: #2C2C2C;
6
+ $doc_coverage_color: #999;
7
+ $code_color: #777;
8
+ $code_bg_color: #eee;
9
+ $link_color: #0088cc;
10
+ $white_color: #fff;
11
+ $light_gray_bg_color: #fafafa;
12
+ $normal_gray_bg_color: #f2f2f2;
13
+ $declaration_bg_color: #f9f9f9;
14
+ $declaration_title_language_color: #4b8afb;
15
+
16
+ $content_wrapper_width: calc(100% - 32px);
17
+ $content_wrapper_max_width: 980px;
18
+ $article_max_width: 750px;
19
+
20
+ $mobile_breakpoint: 767px;
21
+ $content_top_offset: 87px;
22
+ $header_height: 48px;
23
+ $breadcrumb_padding: 10px;
24
+
25
+ $code_font: 'SF Mono', Menlo, monospace;
26
+
27
+ $gray_border: 1px solid #e2e2e2;
28
+ $declaration_language_border: 5px solid #cde9f4;
29
+
30
+ $aside_color: #aaa;
31
+ $aside_border: 5px solid lighten($aside_color, 20%);
32
+ $aside_warning_color: #ff0000;
33
+ $aside_warning_border: 5px solid lighten($aside_warning_color, 20%);
34
+
35
+ ////////////////////////////////
36
+ // Reset
37
+ ////////////////////////////////
38
+
39
+ html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
40
+ background: transparent;
41
+ border: 0;
42
+ margin: 0;
43
+ outline: 0;
44
+ padding: 0;
45
+ vertical-align: baseline;
46
+ }
47
+
48
+ ////////////////////////////////
49
+ // Global
50
+ ////////////////////////////////
51
+
52
+ body {
53
+ background-color: $white_color;
54
+ font-family: -apple-system, Helvetica, freesans, Arial, sans-serif;
55
+ font-size: 16px;
56
+ line-height: 1.6;
57
+ -webkit-font-smoothing: subpixel-antialiased;
58
+ word-wrap: break-word;
59
+ min-height: 100vh;
60
+ }
61
+
62
+ // Headers
63
+
64
+ h1, h2, h3 {
65
+ margin-top: 0.8em;
66
+ margin-bottom: 0.3em;
67
+ font-weight: 400;
68
+ color: black;
69
+ }
70
+ h1 {
71
+ font-size: 2.5em;
72
+ }
73
+ h2 {
74
+ font-size: 2em;
75
+ border-bottom: $gray_border;
76
+ }
77
+ h4 {
78
+ font-size: 13px;
79
+ line-height: 1.5;
80
+ margin-top: 21px;
81
+ }
82
+ h5 {
83
+ font-size: 1.1em;
84
+ }
85
+ h6 {
86
+ font-size: 1.1em;
87
+ color: $code_color;
88
+ }
89
+
90
+ @media screen and (max-width: $mobile_breakpoint) {
91
+ h1 { font-size: 1.75em; }
92
+ h2 { font-size: 1.4em; }
93
+ }
94
+
95
+ // Code
96
+
97
+ pre, code {
98
+ font-family: $code_font;
99
+ font-size: 0.95em;
100
+ color: $code_color;
101
+ word-wrap: normal;
102
+ }
103
+
104
+ // Links
105
+
106
+ a {
107
+ color: $link_color;
108
+ text-decoration: none;
109
+ }
110
+
111
+ // Lists
112
+
113
+ ul {
114
+ padding-left: 15px;
115
+ }
116
+ li {
117
+ line-height: 1.8em;
118
+ }
119
+
120
+ // Images
121
+
122
+ img {
123
+ max-width: 100%;
124
+ }
125
+
126
+ // Blockquotes
127
+
128
+ blockquote {
129
+ margin-left: 0;
130
+ padding: 0 10px;
131
+ border-left: 4px solid #ccc;
132
+ }
133
+
134
+ // General Content Wrapper
135
+
136
+ .content-wrapper {
137
+ margin: 0 auto;
138
+ width: $content_wrapper_width;
139
+ max-width: $content_wrapper_max_width;
140
+ }
141
+
142
+
143
+ ////////////////////////////////
144
+ // Content Wrappers
145
+ ////////////////////////////////
146
+
147
+ .wrapper {
148
+ display: flex;
149
+ flex-direction: column;
150
+ min-height: inherit;
151
+ overflow: auto;
152
+ }
153
+
154
+ .article-wrapper > *,
155
+ .nav-wrapper > *,
156
+ .footer-wrapper > * {
157
+ margin: 0 auto;
158
+ width: $content_wrapper_width;
159
+ max-width: $content_wrapper_max_width;
160
+ }
161
+
162
+ .article-wrapper {
163
+ flex: 1;
164
+ background-color: $white_color;
165
+ }
166
+
167
+ .nav-wrapper {
168
+ background-color: $light_gray_bg_color;
169
+ }
170
+
171
+ .footer-wrapper {
172
+ background-color: $normal_gray_bg_color;
173
+ }
174
+
175
+ ////////////////////////////////
176
+ // Header & Top Breadcrumbs
177
+ ////////////////////////////////
178
+
179
+ header {
180
+ // font-size: 0.85em;
181
+ line-height: $header_height;
182
+ background-color: $bg_color;
183
+ position: fixed;
184
+ width: 100%;
185
+ z-index: 2;
186
+ img {
187
+ padding-right: 6px;
188
+ vertical-align: -4px;
189
+ height: 16px;
190
+ }
191
+ a {
192
+ color: $white_color;
193
+ }
194
+ p {
195
+ float: left;
196
+ color: $doc_coverage_color;
197
+ }
198
+ .header-right {
199
+ float: right;
200
+ margin-left: 16px;
201
+ }
202
+ }
203
+
204
+ #breadcrumbs-container {
205
+ background-color: $bg_color;
206
+ position: fixed;
207
+ z-index: 1;
208
+ width: 100%;
209
+ }
210
+
211
+ #breadcrumbs {
212
+ color: rgba(255, 255, 255, 0.6);
213
+ height: $content_top_offset - $header_height - $breadcrumb_padding;
214
+ padding-bottom: $breadcrumb_padding;
215
+ width: 100%;
216
+ margin-top: $header_height;
217
+ white-space: nowrap;
218
+ overflow-x: scroll;
219
+ #carat {
220
+ height: 10px;
221
+ margin: 0 5px;
222
+ }
223
+ a {
224
+ color: white;
225
+ }
226
+ }
227
+
228
+ @media screen and (max-width: $mobile_breakpoint) {
229
+ #breadcrumbs {
230
+ color: white;
231
+ }
232
+ }
233
+
234
+ ////////////////////////////////
235
+ // Navigation
236
+ ////////////////////////////////
237
+
238
+ .nav-groups {
239
+ list-style-type: none;
240
+ padding-left: 0;
241
+ }
242
+
243
+ .nav-group-name {
244
+ font-size: 1.5rem;
245
+ font-weight: 500;
246
+ padding: 20px 0;
247
+ &:not(:last-child) {
248
+ border-bottom: $gray_border;
249
+ }
250
+ > a {
251
+ color: #333;
252
+ }
253
+ }
254
+
255
+ .nav-group-tasks {
256
+ column-count: 2;
257
+ list-style: none;
258
+ padding: 0;
259
+ margin-top: 5px;
260
+ }
261
+
262
+ .nav-group-task {
263
+ font-size: 1.1rem;
264
+ font-weight: 400;
265
+ a {
266
+ color: #888;
267
+ }
268
+ }
269
+
270
+ @media screen and (max-width: $mobile_breakpoint) {
271
+ .nav-group-tasks {
272
+ column-count: 1;
273
+ }
274
+ }
275
+
276
+ ////////////////////////////////
277
+ // Main Content
278
+ ////////////////////////////////
279
+
280
+ .main-content {
281
+ overflow: hidden;
282
+ padding-bottom: 60px;
283
+ margin-top: $content_top_offset;
284
+ p, a, code, em, ul, table, blockquote {
285
+ margin-bottom: 1em;
286
+ }
287
+ p {
288
+ line-height: 1.5;
289
+ }
290
+ section {
291
+ max-width: $article_max_width;
292
+
293
+ .section:first-child {
294
+ margin-top: 0;
295
+ padding-top: 0;
296
+ }
297
+
298
+ .task-group-section .task-group:first-of-type {
299
+ padding-top: 10px;
300
+
301
+ .section-name {
302
+ padding-top: 15px;
303
+ }
304
+ }
305
+
306
+ .heading:before {
307
+ content: "";
308
+ display: block;
309
+ padding-top: $content_top_offset;
310
+ margin: -$content_top_offset 0 0;
311
+ }
312
+ }
313
+ }
314
+
315
+ .highlight {
316
+ background-color: $code_bg_color;
317
+ padding: 10px 12px;
318
+ border: $gray_border;
319
+ border-radius: 4px;
320
+ overflow-x: auto;
321
+ }
322
+
323
+ .declaration .highlight {
324
+ overflow-x: initial; // This allows the scrollbar to show up inside declarations
325
+ padding: 0 40px 40px 0;
326
+ margin-bottom: -25px;
327
+ background-color: transparent;
328
+ border: none;
329
+ }
330
+
331
+ .section-name {
332
+ font-size: 1.5rem;
333
+ font-weight: 500;
334
+ margin: 0;
335
+ }
336
+
337
+ .task-group-section {
338
+ border-top: $gray_border;
339
+ }
340
+
341
+ .task-group {
342
+ padding-top: 0px;
343
+ > ul {
344
+ padding-left: 0;
345
+ }
346
+ }
347
+
348
+ .task-name-container {
349
+ a[name] {
350
+ &:before {
351
+ content: "";
352
+ display: block;
353
+ padding-top: $content_top_offset;
354
+ margin: -$content_top_offset 0 0;
355
+ }
356
+ }
357
+ }
358
+
359
+ .item {
360
+ padding-top: 8px;
361
+ width: 100%;
362
+ list-style-type: none;
363
+ a[name] {
364
+ &:before {
365
+ content: "";
366
+ display: block;
367
+ padding-top: $content_top_offset;
368
+ margin: -$content_top_offset 0 0;
369
+ }
370
+ }
371
+ code {
372
+ background-color: transparent;
373
+ padding: 0;
374
+ }
375
+ .token {
376
+ padding-left: 3px;
377
+ margin-left: 35px;
378
+ }
379
+ .declaration-note {
380
+ font-size: .85em;
381
+ color: rgba(128,128,128,1);
382
+ font-style: italic;
383
+ }
384
+ }
385
+
386
+ .pointer-container {
387
+ left: -23px;
388
+ padding-bottom: 13px;
389
+ position: relative;
390
+ width: 110%;
391
+ }
392
+
393
+ .pointer {
394
+ background: $declaration_bg_color;
395
+ border-left: $gray_border;
396
+ border-top: $gray_border;
397
+ height: 12px;
398
+ left: 21px;
399
+ top: -7px;
400
+ -webkit-transform: rotate(45deg);
401
+ -moz-transform: rotate(45deg);
402
+ -o-transform: rotate(45deg);
403
+ transform: rotate(45deg);
404
+ position: absolute;
405
+ width: 12px;
406
+ }
407
+
408
+ .height-container {
409
+ display: none;
410
+ position: relative;
411
+ width: 100%;
412
+ overflow: hidden;
413
+ .section {
414
+ position: relative;
415
+ background: $declaration_bg_color;
416
+ width: 100%;
417
+ padding: 10px 25px;
418
+ border: $gray_border;
419
+ border-radius: 8px;
420
+ box-sizing: border-box;
421
+ }
422
+ }
423
+
424
+ .aside, .language {
425
+ padding: 6px 12px;
426
+ margin: 12px 0;
427
+ border-left: $aside_border;
428
+ overflow-y: hidden;
429
+ .aside-title {
430
+ font-size: 12px;
431
+ font-weight: 600;
432
+ letter-spacing: 2px;
433
+ text-transform: uppercase;
434
+ padding-bottom: 0;
435
+ margin: 0;
436
+ color: $aside_color;
437
+ -webkit-user-select: none;
438
+ }
439
+ p:last-child {
440
+ margin-bottom: 0;
441
+ }
442
+ }
443
+
444
+ .language {
445
+ border-left: $declaration_language_border;
446
+ .aside-title {
447
+ color: $declaration_title_language_color;
448
+ }
449
+ }
450
+
451
+ .aside-warning {
452
+ border-left: $aside_warning_border;
453
+ .aside-title {
454
+ color: $aside_warning_color;
455
+ }
456
+ }
457
+
458
+ .graybox {
459
+ border-collapse: collapse;
460
+ width: 100%;
461
+ p {
462
+ margin: 0;
463
+ word-break: break-word;
464
+ min-width: 50px;
465
+ }
466
+ td {
467
+ border: $gray_border;
468
+ padding: 5px 25px 5px 10px;
469
+ vertical-align: middle;
470
+ }
471
+ tr td:first-of-type {
472
+ text-align: right;
473
+ padding: 7px;
474
+ vertical-align: top;
475
+ word-break: normal;
476
+ width: 40px;
477
+ }
478
+ }
479
+
480
+ .slightly-smaller {
481
+ font-size: 0.9em;
482
+ }
483
+
484
+ #footer {
485
+ padding: 25px 0;
486
+ box-sizing: border-box;
487
+
488
+ p {
489
+ margin: 0;
490
+ color: #aaa;
491
+ font-size: 0.8em;
492
+ }
493
+ }
494
+
495
+ ////////////////////////////////
496
+ // Dash
497
+ ////////////////////////////////
498
+
499
+ html.dash {
500
+ header, #breadcrumbs {
501
+ display: none;
502
+ }
503
+ .main-content {
504
+ width: $content_wrapper_width;
505
+ max-width: $content_wrapper_max_width;
506
+ margin-left: 0;
507
+ border: none;
508
+ width: 100%;
509
+ top: 0;
510
+ padding-bottom: 0;
511
+ }
512
+ .height-container {
513
+ display: block;
514
+ }
515
+ .item .token {
516
+ margin-left: 0;
517
+ }
518
+ .content-wrapper {
519
+ width: auto;
520
+ }
521
+ #footer {
522
+ position: static;
523
+ }
524
+ }
525
+
526
+ ////////////////////////////////
527
+ // Responsive design
528
+ ////////////////////////////////
529
+
530
+ @media screen and (max-width: $mobile_breakpoint) {
531
+ .no-mobile {
532
+ display: none;
533
+ }
534
+ }