utopia-project 0.17.2 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/utopia/project/document.rb +2 -2
- data/lib/utopia/project/renderer.rb +46 -0
- data/lib/utopia/project/version.rb +1 -1
- data/pages/_page.xnode +8 -1
- data/pages/source/_pragmas.xnode +2 -2
- data/pages/source/show.xnode +3 -3
- data/public/.DS_Store +0 -0
- data/public/_components/.DS_Store +0 -0
- data/public/_components/jquery-syntax/.DS_Store +0 -0
- data/public/_components/mermaid/.DS_Store +0 -0
- data/public/_components/mermaid/mermaid.min.js +3 -0
- data/public/_components/mermaid/mermaid.min.js.LICENSE.txt +32 -0
- data/public/_static/site.css +5 -0
- data.tar.gz.sig +0 -0
- metadata +12 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d59b43aec217ee84beb050d7d6e151d46aa441cbee39b73b9e664fdf773432f
|
4
|
+
data.tar.gz: 4e76c51906d87652a1f0e8242ef4ae8bc28994ff2e6330e5269f8c1a4387dcd5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e849c822aed4c2591a1116bc4ed36d45c3ede9836b51b1cf2e42fbba2fddf4a79227991dfceb73b9d3810b1ca347402bc7966f4134634a2fdd7840c9c7d9f49c
|
7
|
+
data.tar.gz: 06fb199a979a521f6ea11ddc419aeaf616e82d478019122b3fe41fcc6a8de68a6991d688499381b0fda0c30861faf07860c764f9075f19cf4b67760f51b5637a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -20,7 +20,7 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
21
|
# THE SOFTWARE.
|
22
22
|
|
23
|
-
|
23
|
+
require_relative 'renderer'
|
24
24
|
|
25
25
|
module Utopia
|
26
26
|
module Project
|
@@ -69,7 +69,7 @@ module Utopia
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def to_html(node = self.root, **options)
|
72
|
-
renderer =
|
72
|
+
renderer = Renderer.new(ids: true, flags: Markly::UNSAFE, **options)
|
73
73
|
Trenni::MarkupString.raw(renderer.render(node))
|
74
74
|
end
|
75
75
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in
|
13
|
+
# all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
# THE SOFTWARE.
|
22
|
+
|
23
|
+
require 'markly'
|
24
|
+
require 'markly/renderer/html'
|
25
|
+
|
26
|
+
module Utopia
|
27
|
+
module Project
|
28
|
+
class Renderer < Markly::Renderer::HTML
|
29
|
+
def code_block(node)
|
30
|
+
language, _ = node.fence_info.split(/\s+/, 2)
|
31
|
+
|
32
|
+
if language == "mermaid"
|
33
|
+
block do
|
34
|
+
out(
|
35
|
+
"<div#{source_position(node)} class=\"mermaid\">",
|
36
|
+
escape_html(node.string_content),
|
37
|
+
"</div>"
|
38
|
+
)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
super
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/pages/_page.xnode
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
|
18
18
|
<script src="/_components/jquery/jquery.min.js"></script>
|
19
19
|
<script src="/_components/jquery-syntax/jquery.syntax.min.js"></script>
|
20
|
+
<script src="/_components/mermaid/mermaid.min.js"></script>
|
20
21
|
|
21
22
|
<script src="/_static/links.js"></script>
|
22
23
|
|
@@ -25,6 +26,12 @@
|
|
25
26
|
jQuery(function($) {
|
26
27
|
$.syntax();
|
27
28
|
});
|
29
|
+
|
30
|
+
let isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
31
|
+
let config = {theme: 'light'};
|
32
|
+
if (isDarkMode) config.theme = 'dark';
|
33
|
+
else config.theme = 'forest';
|
34
|
+
mermaid.initialize(config);
|
28
35
|
//]]>
|
29
36
|
</script>
|
30
37
|
</head>
|
@@ -38,4 +45,4 @@
|
|
38
45
|
<footer>Documentation generated by <a href="https://github.com/socketry/utopia-project">Utopia::Project</a>.</footer>
|
39
46
|
</main>
|
40
47
|
</body>
|
41
|
-
</html>
|
48
|
+
</html>
|
data/pages/source/_pragmas.xnode
CHANGED
@@ -9,9 +9,9 @@ pragmas = documentation&.filter(Decode::Comment::Pragma).to_a
|
|
9
9
|
if pragmas&.any? ?>
|
10
10
|
<ul class="pragmas #{attributes[:class]}">
|
11
11
|
<?r pragmas.each do |pragma| ?>
|
12
|
-
<li class="pragma #{pragma.directive}" title="#{pragma.text
|
12
|
+
<li class="pragma #{pragma.directive}" title="#{pragma.text&.first}">
|
13
13
|
#{pragma.directive}
|
14
14
|
</li>
|
15
15
|
<?r end ?>
|
16
16
|
</ul>
|
17
|
-
<?r end ?>
|
17
|
+
<?r end ?>
|
data/pages/source/show.xnode
CHANGED
@@ -9,8 +9,8 @@
|
|
9
9
|
<?r
|
10
10
|
if document = base.document_for(symbol)
|
11
11
|
?>#{document.to_html}<?r
|
12
|
-
elsif
|
13
|
-
?>#{base.format(
|
12
|
+
elsif text = symbol.documentation&.text
|
13
|
+
?>#{base.format(text.join("\n"), symbol)}<?r
|
14
14
|
end
|
15
15
|
?>
|
16
16
|
|
@@ -63,4 +63,4 @@
|
|
63
63
|
</section>
|
64
64
|
|
65
65
|
<content:discuss/>
|
66
|
-
</content:page>
|
66
|
+
</content:page>
|
data/public/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|