utopia-project 0.4.0 → 0.5.0

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: eef5d39417b6da1e11cd8aeff16e645dbf6b1c0ae48ea93179b25410cecc69f4
4
- data.tar.gz: 1bf148454089d81f4273d7eb22984bd8893ea6298be2db2d154e0723dffd0152
3
+ metadata.gz: cf11019a91266f8e5a3bc28b2d122761ca40364112063261d7ef543c228c471c
4
+ data.tar.gz: 7b3a1f947c4040a315c1c549cc420d6d5844702d49aaf1596056b329bfdff6f8
5
5
  SHA512:
6
- metadata.gz: 9ddc7844454bcc5b7b0c311e2c4e56a17a3d8609502c115fc24ec27a2153824f0cb08080c4825a9271270ad2aff945ed40448674f0b66848e250c076f84050a3
7
- data.tar.gz: 4b2ed3f8b72cdab39c7a5dd9e75b62a7c1a2b47c56bfde0057881e2041b4ed10ff732bd8e71acf74df70b276e76e037cb4d61e67518e7c8d0902ee448fefc0d2
6
+ metadata.gz: 14804a71072ad2958b5b6b3e0db1e7b8c74f5f1822fe6e5fe42b33d62360e797be67b9cf363ff71bd2a943cf65bd665e6bed18bef38211998fab918ec1c51efc
7
+ data.tar.gz: e79643a8cb6126f359f629a9a422df5f5b19706841b6987faf2e806bbc8c173ea48d8316a3393919de97d2b4055dad6bcf87a81e8218c924579c2f2c1505cb87
@@ -137,8 +137,12 @@ module Utopia
137
137
  end
138
138
 
139
139
  # Compute a unique string which can be used as `id` attribute in the HTML output.
140
- def id_for(symbol)
141
- symbol.qualified_name
140
+ def id_for(symbol, suffix = nil)
141
+ if suffix
142
+ "#{symbol.qualified_name}-#{suffix}"
143
+ else
144
+ symbol.qualified_name
145
+ end
142
146
  end
143
147
 
144
148
  # Compute a link href to the given symbol for use within the HTML output.
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.4.0"
25
+ VERSION = "0.5.0"
26
26
  end
27
27
  end
@@ -44,7 +44,7 @@
44
44
  parameters = documentation.parameters.to_a
45
45
 
46
46
  if parameters.any?
47
- ?><dl><?r
47
+ ?><h4>Parameters</h4><dl><?r
48
48
  parameters.each do |parameter|
49
49
  ?>
50
50
  <dt><code class="syntax">#{parameter[:name]}</code> &mdash; #{base.linkify(parameter[:type], symbol)}</dt>
@@ -55,6 +55,17 @@
55
55
  end
56
56
  ?></dl><?r
57
57
  end
58
+
59
+ if symbol.multiline?
60
+ collapsible_id = base.id_for(symbol, :implementation)
61
+ ?><section class="collapsible">
62
+ <input type="checkbox" id="#{collapsible_id}"/>
63
+ <label for="#{collapsible_id}">
64
+ <h4>Implementation</h4>
65
+ </label>
66
+ <pre><code class="language-#{symbol.language.name}">#{symbol.text}</code></pre>
67
+ </section><?r
68
+ end
58
69
  end
59
70
  end
60
71
  end
@@ -142,3 +142,28 @@ footer {
142
142
  margin: 1rem;
143
143
  margin-top: 5rem;
144
144
  }
145
+
146
+ section.collapsible input[type=checkbox] {
147
+ display: none;
148
+ }
149
+
150
+ section.collapsible pre {
151
+ display: none;
152
+ }
153
+
154
+ section.collapsible input[type=checkbox]:checked ~ pre {
155
+ display: block;
156
+ }
157
+
158
+ section.collapsible > label {
159
+ cursor: pointer;
160
+ }
161
+
162
+ section.collapsible input[type=checkbox] ~ label > *:last-child:after {
163
+ content: '▸';
164
+ padding: 0 0.5rem;
165
+ }
166
+
167
+ section.collapsible input[type=checkbox]:checked ~ label > *:last-child:after {
168
+ content: '▾';
169
+ }
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  # spec.add_dependency "utopia-gallery"
21
21
 
22
22
  spec.add_dependency "kramdown"
23
- spec.add_dependency "decode"
23
+ spec.add_dependency "decode", "~> 0.9"
24
24
  spec.add_dependency "rackula"
25
25
  spec.add_dependency "falcon"
26
26
  spec.add_dependency "thread-local"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-04 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: utopia
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: decode
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '0.9'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rackula
57
57
  requirement: !ruby/object:Gem::Requirement