utopia-project 0.5.1 → 0.6.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: 8332a30e284e63d750d468fad7370980c7a8fa2951fa963e183312c03c3d48bf
4
- data.tar.gz: 9fa9cd594dfba88b7c3b2bfadd48b57a7797ed61911b1fbd3dece04af27cfc46
3
+ metadata.gz: 10d660d9b1d9caeaeb9c8ac952452a089c9474f892949332f6b6d8b51d463082
4
+ data.tar.gz: 79c655bd3e3155588e22e9e0f341a6b3259f0b3ee46575e9c96919141d82f370
5
5
  SHA512:
6
- metadata.gz: '09f4ba9187a4646655e1f244d2121873c50ff93e8b990797f12c232df9b4665117b9813cbf05aa2a271e56a195216b6f4f47da5d2a12c1e01dc59786fa6ac6fe'
7
- data.tar.gz: a9312ead00722f681084f8179d0a7e95c1477de4b03576d215a003dae2fd02b8afed621878421352ee85df9b6855df4b791affacc2127957cf2661488b01b0fb
6
+ metadata.gz: 19e4d74ff5865a79d22df992932e62d3b87b93f75fa1d0474c2764417290df8d3c06cfe1ddb094472adbaf9ebe1d6f908a8f8e51849ab2b637030ce583e28476
7
+ data.tar.gz: b08734a0d3ee5b201f76928d696417dd98b5ac221f8e8113a4a733ff67a866fa4ee344641bfcb3f583f31838cf17fab67ee8ee7eb5bb4fabf8fc5fab4fe1aad5
@@ -8,14 +8,30 @@ def create
8
8
  end
9
9
  end
10
10
 
11
- # Serve the project locally.
12
- def serve
11
+ # Serve the project using a web server.
12
+ # Binds to `https://localhost:9292` by default.
13
+ #
14
+ # @param port [Integer] The port to bind to.
15
+ # @param bind [String] The URL to bind to, e.g. `http://localhost:80`.
16
+ def serve(port: nil, bind: nil)
13
17
  config_path = File.expand_path("../../template/config.ru", __dir__)
14
18
  preload_path = File.expand_path("../../template/preload.rb", __dir__)
15
19
 
16
- system("falcon", "serve", "--config", config_path, "--preload", preload_path)
20
+ options = []
21
+
22
+ if bind
23
+ options << "--bind" << bind
24
+ end
25
+
26
+ if port
27
+ opttions << "--port" << port
28
+ end
29
+
30
+ system("falcon", "serve", "--config", config_path, "--preload", preload_path, *options)
17
31
  end
18
32
 
33
+ # Generate a static copy of the site.
34
+ # @param output_path [String] The output path for the static site.
19
35
  def static(output_path: "docs")
20
36
  require 'rackula/command'
21
37
 
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.5.1"
25
+ VERSION = "0.6.0"
26
26
  end
27
27
  end
data/pages/_page.xnode CHANGED
@@ -10,6 +10,7 @@
10
10
  <?r end ?>
11
11
 
12
12
  <meta charset="UTF-8" />
13
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
13
14
 
14
15
  <link rel="icon" type="image/png" href="/_static/icon.png" />
15
16
  <link rel="stylesheet" href="/_static/site.css" type="text/css" media="screen" />
data/pages/index.xnode CHANGED
@@ -19,12 +19,12 @@
19
19
  ?><content:heading>Project</content:heading><?r
20
20
  end
21
21
 
22
- ?>#{MarkupString.raw document.to_html}<?r
22
+ ?><main>#{MarkupString.raw document.to_html}</main><?r
23
23
  else
24
24
  ?>
25
25
  <content:heading>Project</content:heading>
26
26
 
27
- <p>This project does not have a README.md file.</p>
27
+ <main><p>This project does not have a README.md file.</p></main>
28
28
  <?r
29
29
  end
30
30
  ?>
@@ -7,7 +7,6 @@
7
7
  index = base.index
8
8
 
9
9
  index.trie.traverse do |path, node, descend|
10
- ?><ul class="index"><?r
11
10
  if symbols = node.values
12
11
  symbol = base.best(symbols)
13
12
 
@@ -20,14 +19,17 @@
20
19
  <?r end ?>
21
20
 
22
21
  <?r if symbol.container?
22
+ ?><ul class="index"><?r
23
23
  descend.call
24
+ ?></ul><?r
24
25
  end ?>
25
26
  </li><?r
26
27
  end
27
28
  else
29
+ ?><ul class="index"><?r
28
30
  descend.call
31
+ ?></ul><?r
29
32
  end
30
- ?></ul><?r
31
33
  end
32
34
  ?>
33
35
  </main>
@@ -44,27 +44,26 @@
44
44
  parameters = documentation.parameters.to_a
45
45
 
46
46
  if parameters.any?
47
- ?><h4>Parameters</h4><dl><?r
48
- parameters.each do |parameter|
49
- ?>
50
- <dt><code class="syntax">#{parameter[:name]}</code> &mdash; #{base.linkify(parameter[:type], symbol)}</dt>
51
- <?r if details = parameter[:details] ?>
52
- <dd>#{base.format(parameter[:details], symbol)}</dd>
53
- <?r end ?>
54
- <?r
55
- end
56
- ?></dl><?r
47
+ ?><details open>
48
+ <summary><h4>Parameters</h4></summary>
49
+ <dl><?r
50
+ parameters.each do |parameter|
51
+ ?>
52
+ <dt><code class="syntax">#{parameter[:name]}</code> &mdash; #{base.linkify(parameter[:type], symbol)}</dt>
53
+ <?r if details = parameter[:details] ?>
54
+ <dd>#{base.format(parameter[:details], symbol)}</dd>
55
+ <?r end ?>
56
+ <?r
57
+ end
58
+ ?></dl>
59
+ </details><?r
57
60
  end
58
61
 
59
62
  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>
63
+ ?><details>
64
+ <summary><h4>Implementation</h4></summary>
66
65
  <pre><code class="language-#{symbol.language.name}">#{symbol.text}</code></pre>
67
- </section><?r
66
+ </details><?r
68
67
  end
69
68
  end
70
69
  end
@@ -60,6 +60,11 @@ html {
60
60
  }
61
61
  }
62
62
 
63
+ html {
64
+ color: var(--main-color);
65
+ background-color: var(--main-background-color);
66
+ }
67
+
63
68
  body {
64
69
  margin: 0 0;
65
70
  padding: 0;
@@ -67,18 +72,23 @@ body {
67
72
  /* Force the element to contain margins */
68
73
  display: flow-root;
69
74
  min-height: 100vh;
70
-
71
- color: var(--main-color);
72
- background-color: var(--main-background-color);
73
-
75
+
74
76
  max-width: 48rem;
75
77
  margin: 0 auto;
76
78
  }
77
79
 
78
- header, h1, h2, h3, h4, h5, h6, p, ul, dl, ol {
80
+ header, h1, h2, h3, h4, h5, h6, p, pre, ul, dl, ol {
79
81
  margin: 1rem;
80
82
  }
81
83
 
84
+ h1 span {
85
+ display: inline-block;
86
+ }
87
+
88
+ main > pre {
89
+ padding: 1rem 2rem;
90
+ }
91
+
82
92
  header img {
83
93
  max-height: 50vh;
84
94
  }
@@ -90,19 +100,17 @@ nav {
90
100
  }
91
101
 
92
102
  li {
93
- margin: 0.8rem;
103
+ margin: 0.5rem 0;
94
104
  }
95
105
 
96
106
  ul.index {
97
107
  padding: 0;
98
- padding-left: 0.5rem;
99
- margin: 0.5rem;
100
- margin-bottom: 1rem;
101
108
  list-style: none;
102
109
  }
103
110
 
104
- li > ul, li > ol {
111
+ li ul, li ol {
105
112
  margin: 0;
113
+ margin-left: 0.5rem;
106
114
  }
107
115
 
108
116
  h1 {
@@ -136,38 +144,40 @@ a:hover {
136
144
 
137
145
  pre {
138
146
  overflow: auto;
139
- padding: 1rem 2rem;
140
147
  }
141
148
 
142
149
  footer {
143
150
  text-align: right;
144
- font-size: 0.65rem;
151
+ font-size: 0.8rem;
145
152
 
146
153
  margin: 1rem;
147
154
  margin-top: 5rem;
148
155
  }
149
156
 
150
- section.collapsible input[type=checkbox] {
151
- display: none;
152
- }
153
-
154
- section.collapsible pre {
155
- display: none;
157
+ details {
158
+ margin: 1rem;
159
+ border: 1px solid #aaa;
160
+ border-radius: 0.5rem;
161
+
162
+ padding: .5em .5em 0;
156
163
  }
157
164
 
158
- section.collapsible input[type=checkbox]:checked ~ pre {
159
- display: block;
165
+ summary > * {
166
+ margin: 0;
167
+ display: inline-block;
160
168
  }
161
169
 
162
- section.collapsible > label {
163
- cursor: pointer;
170
+ summary {
171
+ font-weight: bold;
172
+ margin: -.5rem -.5rem 0;
173
+ padding: .5rem;
164
174
  }
165
175
 
166
- section.collapsible input[type=checkbox] ~ label > *:last-child:after {
167
- content: '▸';
168
- padding: 0 0.5rem;
176
+ details[open] {
177
+ /* padding: .5rem; */
169
178
  }
170
179
 
171
- section.collapsible input[type=checkbox]:checked ~ label > *:last-child:after {
172
- content: '▾';
180
+ details[open] summary {
181
+ border-bottom: 1px solid #aaa;
182
+ /* margin-bottom: .5rem; */
173
183
  }
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.5.1
4
+ version: 0.6.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-05 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: utopia