utopia-project 0.17.1 → 0.18.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: b881d5774920131aff82d0f6fe8416713c6f303b70d45dd9235e926923026b89
4
- data.tar.gz: 40f0084a464195072528cf7d5a893eb9a26c2028deef1945c9cd94125c9054f2
3
+ metadata.gz: 24fda7ece0102628b1160b9f9b93cc15ca75ac1c7f7ed6d1a674521705ba96f3
4
+ data.tar.gz: 4ca114651629fefcc0a5db05ac38712c96454e2f8de97b53fabc0bae1d18e2d2
5
5
  SHA512:
6
- metadata.gz: 9bc24dcf38b852cd8e7f7a1fc0e07859393dcb78bc6e24c24c22e0fd083d67d9dcca9866853661aac2a286509e720c61f2087ea1956e7f266740dd4db9748a37
7
- data.tar.gz: b927441a75fbaa02b1f20f6e3f74bae3e0c2ddfe2dcfe1232badde18c8a14c63e5f8c550ece8c1cffc07e697062ee71c2bd5f7b136752fc5a524966df1c76b80
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
- require 'markly'
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 = Markly::HTMLRenderer.new(ids: true, flags: Markly::UNSAFE, **options)
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
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Utopia
24
24
  module Project
25
- VERSION = "0.17.1"
25
+ VERSION = "0.18.0"
26
26
  end
27
27
  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>
@@ -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.first}">
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 ?>
@@ -14,5 +14,9 @@ on '**/*/index' do |request, path|
14
14
 
15
15
  @node, @symbol = @base.lookup(lexical_path)
16
16
 
17
+ unless @symbol
18
+ fail! :not_found
19
+ end
20
+
17
21
  path.components = ["show"]
18
- end
22
+ end
@@ -9,8 +9,8 @@
9
9
  <?r
10
10
  if document = base.document_for(symbol)
11
11
  ?>#{document.to_html}<?r
12
- elsif documentation = symbol.documentation
13
- ?>#{base.format(documentation.text.join("\n"), symbol)}<?r
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