utopia-project 0.20.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +10 -19
- 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 +5 -1
- 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 +4 -0
- data/public/_components/jquery/jquery.js +209 -97
- 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 +197 -85
- data/public/_components/jquery/jquery.slim.min.js +2 -2
- data/public/_components/jquery/jquery.slim.min.map +1 -1
- data/public/_components/mermaid/mermaid.min.js +1589 -3
- data/public/_components/mermaid/mermaid.min.js.map +1 -0
- data/readme.md +32 -0
- data/template/preload.rb +4 -0
- data.tar.gz.sig +0 -0
- metadata +34 -44
- metadata.gz.sig +0 -0
- data/public/_components/mermaid/mermaid.min.js.LICENSE.txt +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d1ad15923d59f832f9be9b32a296003f285d38b95da13ac831575dc034a6c08
|
4
|
+
data.tar.gz: 3029c9fac2566ca56590ec6f15761218a0ecae564b1c55d75f2d9b6cb692a6bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fabe143fac57289c5c273db880f66e4e2502da748b9179bb81cfe0eea38bb15d93dc042e12c2e95c1dec13b8d9cdafc108e50b1a9d8e42d5ad5955be47657788
|
7
|
+
data.tar.gz: '093c1ad0f1570461d66980065a982e3acf3286a8c67d4d94d9d57d83b09b7a8f1efe149ba8042a8d23b782c0acc0c2ad73c2bbcbf6787d98a951d305dbe9710a'
|
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') || 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
|
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-2023, 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.
|
8
|
+
VERSION = "0.21.0"
|
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-2023, 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-2023, 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,7 +7,11 @@
|
|
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
|
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