utopia-project 0.17.4 → 0.18.0
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 +3 -1
- 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/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 +11 -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: 24fda7ece0102628b1160b9f9b93cc15ca75ac1c7f7ed6d1a674521705ba96f3
|
4
|
+
data.tar.gz: 4ca114651629fefcc0a5db05ac38712c96454e2f8de97b53fabc0bae1d18e2d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ff765506a5841b132cfea27267c2ab1a50d319d127b7ec6c55342c99a7321216c04c593e814a8bd5959189b1c7c2bec37a43865c36a71a46a102a111d57550
|
7
|
+
data.tar.gz: 24d6eb555a6540e181cf62ab7172864ecb88bde77cb8e0a2924655f868753ece0d6e7a9d6ebc5f16dae9bb6e33bbb77aba8a5105fcf5468e9181324e95b7726b
|
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,12 +17,14 @@
|
|
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
|
|
23
24
|
<script type="text/javascript">
|
24
25
|
//<![CDATA[
|
25
26
|
jQuery(function($) {
|
27
|
+
mermaid.init();
|
26
28
|
$.syntax();
|
27
29
|
});
|
28
30
|
//]]>
|
@@ -38,4 +40,4 @@
|
|
38
40
|
<footer>Documentation generated by <a href="https://github.com/socketry/utopia-project">Utopia::Project</a>.</footer>
|
39
41
|
</main>
|
40
42
|
</body>
|
41
|
-
</html>
|
43
|
+
</html>
|
data/public/.DS_Store
ADDED
Binary file
|
Binary file
|
Binary file
|