utopia-project 0.20.0 → 0.20.3
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/bake/utopia/project.rb +4 -0
- data/lib/utopia/project/base.rb +13 -20
- data/lib/utopia/project/document.rb +14 -21
- data/lib/utopia/project/guide.rb +5 -22
- data/lib/utopia/project/linkify.rb +2 -19
- data/lib/utopia/project/renderer.rb +2 -19
- data/lib/utopia/project/version.rb +3 -20
- data/lib/utopia/project.rb +2 -19
- data/license.md +23 -0
- data/pages/_header.xnode +19 -2
- data/pages/controller.rb +5 -2
- data/pages/guides/controller.rb +4 -0
- data/pages/index.xnode +1 -1
- data/pages/links.yaml +1 -0
- data/pages/source/controller.rb +7 -3
- data/pages/source/show.xnode +30 -23
- data/public/.DS_Store +0 -0
- data/public/_components/.DS_Store +0 -0
- data/public/_components/jquery/jquery.js +118 -109
- data/public/_components/jquery/jquery.min.js +2 -2
- data/public/_components/jquery/jquery.min.map +1 -1
- data/public/_components/jquery/jquery.slim.js +106 -101
- data/public/_components/jquery/jquery.slim.min.js +2 -2
- data/public/_components/jquery/jquery.slim.min.map +1 -1
- data/public/_components/jquery-syntax/.DS_Store +0 -0
- data/public/_components/mermaid/.DS_Store +0 -0
- data/public/_components/mermaid/mermaid.min.js +1 -1
- data/public/_components/mermaid/mermaid.min.js.LICENSE.txt +1 -1
- data/readme.md +56 -0
- data/template/preload.rb +4 -0
- data.tar.gz.sig +0 -0
- metadata +35 -27
- 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: 883f693f304d3d472fdcc8b978298eddcb6c509a79f32527d2af4513a3ae793a
|
4
|
+
data.tar.gz: f11205cf2b75b905c4e0e8993a63a5a07a73b77c9c0757b2de943ca3e01f8877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5ca69c795b5977ef5e458fb3a1aef5b092fa66efcb7d5efd78ca9e6894737e3ea34ca45e76cd5ec8bbb1d2e387e3088c4474fcb70cb160ca0ecb8c426e963c2
|
7
|
+
data.tar.gz: 035e256b161d7fa6777498fa20fb0eaa4f1b5ef092209d0ed339f0585f3401fdc331d3359b0b6459bbc596a357f9b2100f61837fc8c2bccbaa6628e8b3049aeb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/bake/utopia/project.rb
CHANGED
data/lib/utopia/project/base.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'utopia/path'
|
24
7
|
require 'utopia/content/links'
|
@@ -71,7 +54,7 @@ module Utopia
|
|
71
54
|
attr :index
|
72
55
|
|
73
56
|
# Return the absolute path for the given file name, if it exists in the project.
|
74
|
-
# @parameter file_name [String] The relative path to the project file, e.g. `
|
57
|
+
# @parameter file_name [String] The relative path to the project file, e.g. `readme.md`.
|
75
58
|
# @returns [String] The file-system path.
|
76
59
|
def path_for(file_name)
|
77
60
|
full_path = File.expand_path(file_name, @root)
|
@@ -195,6 +178,16 @@ module Utopia
|
|
195
178
|
yield Guide.new(self, guide_path)
|
196
179
|
end
|
197
180
|
end
|
181
|
+
|
182
|
+
def readme_document
|
183
|
+
if path = self.path_for('readme.md')
|
184
|
+
Document.new(File.read(path), self)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def project_title
|
189
|
+
readme_document&.title || "Project"
|
190
|
+
end
|
198
191
|
end
|
199
192
|
end
|
200
193
|
end
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require_relative 'renderer'
|
24
7
|
|
@@ -40,6 +23,14 @@ module Utopia
|
|
40
23
|
@root ||= resolve(Markly.parse(@text, extensions: [:table]))
|
41
24
|
end
|
42
25
|
|
26
|
+
def title
|
27
|
+
child = self.root.first_child
|
28
|
+
|
29
|
+
if child && child.type == :header
|
30
|
+
return child.first_child.to_plaintext
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
43
34
|
def first_child
|
44
35
|
self.root.first_child
|
45
36
|
end
|
@@ -55,9 +46,11 @@ module Utopia
|
|
55
46
|
if header.first_child.to_plaintext.include?(name)
|
56
47
|
# Now subsequent children:
|
57
48
|
current = header.next
|
58
|
-
|
49
|
+
|
50
|
+
# Delete everything in the section until we encounter another header:
|
51
|
+
while current && current.type != :header
|
59
52
|
current.delete
|
60
|
-
current =
|
53
|
+
current = current.next
|
61
54
|
end
|
62
55
|
|
63
56
|
return yield(header)
|
data/lib/utopia/project/guide.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'utopia/path'
|
24
7
|
require 'trenni/reference'
|
@@ -48,18 +31,18 @@ module Utopia
|
|
48
31
|
# @attribute [String | Nil]
|
49
32
|
attr :description
|
50
33
|
|
51
|
-
README = "
|
34
|
+
README = "readme.md"
|
52
35
|
|
53
36
|
# The path to the README file for the guide.
|
54
37
|
# @returns [String] The file-system path.
|
55
38
|
def readme_path
|
56
|
-
File.expand_path(README, @root)
|
39
|
+
Dir[File.expand_path(README, @root)].first
|
57
40
|
end
|
58
41
|
|
59
42
|
# Does a README file exist for this guide?
|
60
43
|
# @returns [Boolean]
|
61
44
|
def readme?
|
62
|
-
|
45
|
+
!readme_path.nil?
|
63
46
|
end
|
64
47
|
|
65
48
|
# The document for the README, if one exists.
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'decode/syntax/rewriter'
|
24
7
|
|
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2022, by Samuel Williams.
|
22
5
|
|
23
6
|
require 'markly'
|
24
7
|
require 'markly/renderer/html'
|
@@ -1,27 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
22
5
|
|
23
6
|
module Utopia
|
24
7
|
module Project
|
25
|
-
VERSION = "0.20.
|
8
|
+
VERSION = "0.20.3"
|
26
9
|
end
|
27
10
|
end
|
data/lib/utopia/project.rb
CHANGED
@@ -1,24 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
#
|
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.
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020, by Samuel Williams.
|
22
5
|
|
23
6
|
require "utopia/project/version"
|
24
7
|
|
data/license.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# MIT License
|
2
|
+
|
3
|
+
Copyright, 2020-2022, by Samuel Williams.
|
4
|
+
Copyright, 2020, by Olle Jonsson.
|
5
|
+
Copyright, 2022, by dependabot[bot].
|
6
|
+
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
9
|
+
in the Software without restriction, including without limitation the rights
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
12
|
+
furnished to do so, subject to the following conditions:
|
13
|
+
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
15
|
+
copies or substantial portions of the Software.
|
16
|
+
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
SOFTWARE.
|
data/pages/_header.xnode
CHANGED
@@ -7,12 +7,29 @@
|
|
7
7
|
end
|
8
8
|
|
9
9
|
if link = links(path.dirname, name: path.last, locale: localization.current_locale, indices: true).first
|
10
|
-
|
10
|
+
if replace = link[:replace]&.to_sym
|
11
|
+
?> › #{link.to_href(content: controller[:base].public_send(replace))}<?r
|
12
|
+
else
|
13
|
+
?> › #{link.to_href}<?r
|
14
|
+
end
|
11
15
|
else
|
12
16
|
?> › <span>#{path.last}</span><?r
|
13
17
|
end
|
14
18
|
end
|
15
|
-
|
19
|
+
|
20
|
+
if lexical_path = controller[:lexical_path]
|
21
|
+
current = []
|
22
|
+
lexical_path.each do |part|
|
23
|
+
current << part
|
24
|
+
|
25
|
+
?> › <a href="/source/#{current.join('/')}/index">#{part}</a> <?r
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
if guide = controller[:guide]
|
30
|
+
?> › <a href="/guides/#{guide.name}/index">#{guide.title}</a> <?r
|
31
|
+
end
|
32
|
+
|
16
33
|
if localization.localized?
|
17
34
|
?> • (<?r
|
18
35
|
localization.all_locales.each.with_index do |locale, index|
|
data/pages/controller.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
1
5
|
|
2
6
|
prepend Actions
|
3
7
|
|
4
8
|
on 'index' do
|
5
9
|
@base = Utopia::Project::Base.instance
|
6
10
|
|
7
|
-
if
|
8
|
-
@document = Utopia::Project::Document.new(File.read(readme_path), @base)
|
11
|
+
if @document = @base.readme_document
|
9
12
|
|
10
13
|
@document.replace_section("Usage") do |header|
|
11
14
|
header.insert_after(@document.html_node("<content:usage/>"))
|
data/pages/guides/controller.rb
CHANGED
data/pages/index.xnode
CHANGED
data/pages/links.yaml
CHANGED
data/pages/source/controller.rb
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Released under the MIT License.
|
4
|
+
# Copyright, 2020-2022, by Samuel Williams.
|
1
5
|
|
2
6
|
prepend Actions
|
3
7
|
|
@@ -8,11 +12,11 @@ end
|
|
8
12
|
on '**/*/index' do |request, path|
|
9
13
|
@base = Utopia::Project::Base.instance
|
10
14
|
|
11
|
-
lexical_path = path.components.dup
|
15
|
+
@lexical_path = path.components.dup
|
12
16
|
# Remove the last "index" part:
|
13
|
-
lexical_path.pop
|
17
|
+
@lexical_path.pop
|
14
18
|
|
15
|
-
@node, @symbol = @base.lookup(lexical_path)
|
19
|
+
@node, @symbol = @base.lookup(@lexical_path)
|
16
20
|
|
17
21
|
unless @symbol
|
18
22
|
fail! :not_found
|
data/pages/source/show.xnode
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
base = self[:base]
|
4
4
|
node = self[:node]
|
5
5
|
symbol = self[:symbol]
|
6
|
+
document.attributes[:title] ||= symbol.qualified_name
|
6
7
|
?>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
</p>
|
8
|
+
|
9
|
+
<h1>
|
10
|
+
<code class="language-#{symbol.language.name}">#{symbol.short_form}</code>
|
11
|
+
</h1>
|
12
12
|
|
13
13
|
<?r
|
14
14
|
if document = base.document_for(symbol)
|
@@ -17,33 +17,39 @@
|
|
17
17
|
?>#{base.format(text.join("\n"), symbol)}<?r
|
18
18
|
end
|
19
19
|
?>
|
20
|
-
|
21
20
|
#{partial 'content:signature', symbol: symbol}
|
22
|
-
|
23
21
|
<?r
|
24
|
-
nested = node.children.map
|
22
|
+
nested = node.children.map do |name, child|
|
23
|
+
base.best(child.values)
|
24
|
+
end.select do |symbol|
|
25
|
+
symbol.container?
|
26
|
+
end
|
25
27
|
|
26
28
|
if nested.any?
|
27
29
|
?>
|
28
30
|
<section>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
<h2>Nested</h2>
|
32
|
+
|
33
|
+
<ul>
|
34
|
+
<?r nested.each do |symbol| ?>
|
35
|
+
<li><a href="#{base.link_for(symbol)}"><code class="language-#{symbol.language.name}">#{symbol.nested_name}</code></a></li>
|
36
|
+
<?r end ?>
|
37
|
+
</ul>
|
36
38
|
</section>
|
37
39
|
<?r
|
38
40
|
end
|
39
|
-
?>
|
40
41
|
|
42
|
+
definitions = node.children.map do |name, child|
|
43
|
+
child.values.select{|symbol| symbol.documentation and !symbol.container?}
|
44
|
+
end.flatten
|
45
|
+
|
46
|
+
if definitions.any?
|
47
|
+
?>
|
41
48
|
<section>
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
child.values.each do |symbol|
|
49
|
+
<h2>Definitions</h2>
|
50
|
+
|
51
|
+
<?r
|
52
|
+
definitions.each do |symbol|
|
47
53
|
if symbol.documentation and !symbol.container?
|
48
54
|
?><section id="#{base.id_for(symbol)}"><h3><code class="language-#{symbol.language.name}">#{symbol.long_form}</code></h3><?r
|
49
55
|
|
@@ -62,9 +68,10 @@
|
|
62
68
|
?></section><?r
|
63
69
|
end
|
64
70
|
end
|
71
|
+
?>
|
72
|
+
</section>
|
73
|
+
<?r
|
65
74
|
end
|
66
75
|
?>
|
67
|
-
</section>
|
68
|
-
|
69
76
|
<content:discuss/>
|
70
77
|
</content:page>
|
data/public/.DS_Store
ADDED
Binary file
|
Binary file
|