utopia-project 0.15.0 → 0.15.4

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: c0e365f1d79016583ca1eca558712eb3e314953bc74bd6404a399628972b3168
4
- data.tar.gz: a06103edc45d87120f2c531252f5399884eee051efb7f7b0b7fd6edac4de4d90
3
+ metadata.gz: 2b57a18176afa9434511f28f02302fee700be285f2b758619354753af53577a3
4
+ data.tar.gz: 6ae9b2ef4860fcf69a94fa374f45e593398888e14410b0dc646e0823f9b4feee
5
5
  SHA512:
6
- metadata.gz: bb1887c856a24b2360c1101b1c377eff4c15d7bb3322f8318057815a3ff056c712427a2c70164337987905b58b0bdcaad134cdad4c44ef3baedca4be0fcba85e
7
- data.tar.gz: 00a55cfb9f18fd62e3e178c3fb183375d5640eedcac3f204957f6582b84a07875b458c8022ebe3bfde8ead2d9791a2905eae8fa6f2554e8d938378ad501e7f20
6
+ metadata.gz: 63d9424f566e31010506ab7cef1dacd28495967d86ac08c29dec93bb11158c4c43fd7751e3adb920e4df1f4d14d3e941d9dce612530dc62ba37640098d520dd4
7
+ data.tar.gz: cca320d9ebdb86b78e6b8f655028ef0e3978776f2df6f300dd4f693b0225e447a81a28c3eb1f1601fae58eef2962afcde674b13b3bb4de899a2a36d53c1d94d1
@@ -133,7 +133,7 @@ module Utopia
133
133
  # Format the given text in the context of the given definition and language.
134
134
  # See {document} for details.
135
135
  # @returns [Trenni::MarkupString]
136
- def format(text, definition = nil, language: definition&.language)
136
+ def format(text, definition = nil, language: definition&.language, **options)
137
137
  case text
138
138
  when Enumerable
139
139
  text = text.to_a.join("\n")
@@ -143,7 +143,7 @@ module Utopia
143
143
 
144
144
  if document = self.document(text, definition, language: language)
145
145
  return Trenni::MarkupString.raw(
146
- document.to_html
146
+ document.to_html(**options)
147
147
  )
148
148
  end
149
149
  end
@@ -68,8 +68,8 @@ module Utopia
68
68
  end
69
69
  end
70
70
 
71
- def to_html(node = self.root)
72
- renderer = Markly::HTMLRenderer.new(ids: true, flags: Markly::UNSAFE)
71
+ def to_html(node = self.root, **options)
72
+ renderer = Markly::HTMLRenderer.new(ids: true, flags: Markly::UNSAFE, **options)
73
73
  Trenni::MarkupString.raw(renderer.render(node))
74
74
  end
75
75
 
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.15.0"
25
+ VERSION = "0.15.4"
26
26
  end
27
27
  end
data/pages/_header.xnode CHANGED
@@ -1,4 +1,4 @@
1
- <header><label for="toggle">☰</label> <?r
1
+ <header><?r
2
2
  page_path = first.node.uri_path.dirname
3
3
 
4
4
  Utopia::Path[page_path].descend do |path|
data/pages/index.xnode CHANGED
@@ -14,7 +14,11 @@
14
14
  when :image
15
15
  self.document.attributes[:title] ||= title.to_plaintext
16
16
 
17
- ?><h1><img src="#{title.url}" /></h1><?r
17
+ if title.url =~ /\.svg/
18
+ ?><h1 style="text-align: center"><object type="image/svg+xml" data="#{title.url}"></object></h1><?r
19
+ else
20
+ ?><h1 style="text-align: center"><img src="#{title.url}" /></h1><?r
21
+ end
18
22
  else
19
23
  ?><content:heading>Project</content:heading><?r
20
24
  end
@@ -0,0 +1,17 @@
1
+ <?r
2
+ base = self[:base]
3
+
4
+ symbol = attributes[:symbol]
5
+ documentation = symbol.documentation
6
+
7
+ pragmas = documentation&.filter(Decode::Comment::Pragma).to_a
8
+
9
+ if pragmas&.any? ?>
10
+ <ul class="pragmas #{attributes[:class]}">
11
+ <?r pragmas.each do |pragma| ?>
12
+ <li class="pragma #{pragma.directive}">
13
+ <span class="directive">#{pragma.directive}</span>
14
+ </li>
15
+ <?r end ?>
16
+ </ul>
17
+ <?r end ?>
@@ -1,5 +1,5 @@
1
1
  <content:page>
2
- <content:heading>Source</content:heading>
2
+ <content:heading>Overview</content:heading>
3
3
 
4
4
  <?r
5
5
  base = controller[:base]
@@ -11,10 +11,14 @@
11
11
 
12
12
  if documentation = symbol.documentation or symbol.container?
13
13
  ?><li>
14
- <a href="#{base.link_for(symbol)}"><code class="language-#{symbol.language.name}">#{symbol.long_form}</code></a>
15
-
16
- <?r if documentation and text = documentation.text ?>
17
- #{base.format(text.first, symbol)}
14
+ <?r if symbol.container? ?>
15
+ <a href="#{base.link_for(symbol)}"><code class="language-#{symbol.language.name}">#{symbol.long_form}</code></a>
16
+
17
+ #{partial 'content:pragmas', symbol: symbol, class: 'inline'}
18
+
19
+ <?r if documentation and text = documentation.text ?>
20
+ #{base.format(text.first, symbol)}
21
+ <?r end ?>
18
22
  <?r end ?>
19
23
 
20
24
  <?r if symbol.container?
@@ -6,6 +6,8 @@
6
6
  ?>
7
7
  <content:heading><code class="language-#{symbol.language.name}">#{symbol.qualified_name}</code></content:heading>
8
8
 
9
+ #{partial 'content:signature', symbol: symbol}
10
+
9
11
  <?r
10
12
  if document = base.document_for(symbol)
11
13
  ?>#{document.to_html}<?r
@@ -42,6 +44,7 @@
42
44
  ?><section id="#{base.id_for(symbol)}"><h3><code class="language-#{symbol.language.name}">#{symbol.long_form}</code></h3><?r
43
45
 
44
46
  if documentation = symbol.documentation
47
+ ?>#{partial 'content:pragmas', symbol: symbol}<?r
45
48
  ?>#{base.format(documentation.text, symbol)}<?r
46
49
  ?>#{partial 'content:signature', symbol: symbol}<?r
47
50
  end
data/public/.nojekyll ADDED
File without changes
@@ -6,11 +6,11 @@ jQuery(function() {
6
6
  document.createTextNode("¶")
7
7
  );
8
8
 
9
- anchor.title = element.innerText;
10
9
  anchor.href = "#" + element.id;
11
10
  anchor.className = "self";
12
11
 
13
12
  let heading = element.firstChild;
13
+ anchor.title = heading.innerText;
14
14
 
15
15
  heading.appendChild(
16
16
  document.createTextNode(' ')
@@ -6,6 +6,8 @@ html {
6
6
  /* Fix odd text-size in `display: flex` elements on Safari iOS */
7
7
  text-size-adjust: 100%;
8
8
  -webkit-text-size-adjust: 100%;
9
+
10
+ line-height: 1.5;
9
11
  }
10
12
 
11
13
  @media (min-width: 40em) {
@@ -257,3 +259,53 @@ table thead {
257
259
  table tr:hover {
258
260
  background-color: var(--header-color);
259
261
  }
262
+
263
+ ul.pragmas {
264
+ margin: 0 1rem;
265
+ padding: 0;
266
+
267
+ font-size: 80%;
268
+ }
269
+
270
+ ul.pragmas.inline {
271
+ display: inline;
272
+ }
273
+
274
+ ul.pragmas .directive {
275
+ font-weight: bold;
276
+ }
277
+
278
+ ul.pragmas li {
279
+ list-style: none;
280
+
281
+ border: 1px solid #ccf;
282
+ border-radius: 0.5em;
283
+
284
+ box-shadow: 0 0 2px #eee;
285
+ padding: 0.1rem 0.2rem;
286
+
287
+ display: inline-block;
288
+ }
289
+
290
+ ul.pragmas li + li {
291
+ margin-left: 0.5rem;
292
+ }
293
+
294
+ ul.pragmas li.public {
295
+ border-color: #8CFF00;
296
+ box-shadow: 0 0 0.3rem #8CFF00;
297
+ color: #8CFF00;
298
+ }
299
+
300
+ ul.pragmas li.private,
301
+ ul.pragmas li.deprecated {
302
+ border-color: #FF8C00;
303
+ box-shadow: 0 0 0.3rem #FF8C00;
304
+ color: #FF8C00;
305
+ }
306
+
307
+ ul.pragmas li.asynchronous {
308
+ border-color: #8C00FF;
309
+ box-shadow: 0 0 0.3rem #8C00FF;
310
+ color: #8C00FF;
311
+ }
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.4
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-08-10 00:00:00.000000000 Z
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: utopia
14
+ name: decode
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.14'
19
+ version: '0.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.14'
26
+ version: '0.17'
27
27
  - !ruby/object:Gem::Dependency
28
- name: markly
28
+ name: falcon
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0.5'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0.5'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: decode
42
+ name: markly
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.13'
47
+ version: '0.6'
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.13'
54
+ version: '0.6'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rackula
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: falcon
70
+ name: thread-local
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: thread-local
84
+ name: utopia
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '2.14'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '2.14'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: async-rspec
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rack-test
112
+ name: bundler
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: bundler
140
+ name: rack-test
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -164,23 +164,8 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: bake-bundler
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - ">="
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - ">="
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
167
  description:
182
168
  email:
183
- - samuel.williams@oriontransfer.co.nz
184
169
  executables: []
185
170
  extensions: []
186
171
  extra_rdoc_files: []
@@ -208,10 +193,12 @@ files:
208
193
  - pages/guides/show.xnode
209
194
  - pages/index.xnode
210
195
  - pages/links.yaml
196
+ - pages/source/_pragmas.xnode
211
197
  - pages/source/_signature.xnode
212
198
  - pages/source/controller.rb
213
199
  - pages/source/index.xnode
214
200
  - pages/source/show.xnode
201
+ - public/.nojekyll
215
202
  - public/_components/jquery-litebox/jquery.litebox.css
216
203
  - public/_components/jquery-litebox/jquery.litebox.gallery.css
217
204
  - public/_components/jquery-litebox/jquery.litebox.js
@@ -295,15 +282,15 @@ homepage: https://socketry.github.io/utopia-project/
295
282
  licenses:
296
283
  - MIT
297
284
  metadata:
298
- source_code_uri: https://github.com/socketry/utopia-project/
299
285
  funding_uri: https://github.com/sponsors/ioquatix/
286
+ source_code_uri: https://github.com/socketry/utopia-project/
300
287
  post_install_message:
301
288
  rdoc_options: []
302
289
  require_paths:
303
290
  - lib
304
291
  required_ruby_version: !ruby/object:Gem::Requirement
305
292
  requirements:
306
- - - "~>"
293
+ - - ">="
307
294
  - !ruby/object:Gem::Version
308
295
  version: '2.5'
309
296
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -312,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
299
  - !ruby/object:Gem::Version
313
300
  version: '0'
314
301
  requirements: []
315
- rubygems_version: 3.1.2
302
+ rubygems_version: 3.2.22
316
303
  signing_key:
317
304
  specification_version: 4
318
305
  summary: A project documentation tool based on Utopia.