utopia-project 0.20.3 → 0.22.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/readme/update.rb +50 -0
- data/bake/utopia/project/readme/usage.trenni +5 -0
- data/lib/utopia/project/base.rb +1 -1
- data/lib/utopia/project/document.rb +3 -2
- data/lib/utopia/project/guide.rb +2 -2
- data/lib/utopia/project/linkify.rb +1 -1
- data/lib/utopia/project/version.rb +1 -1
- data/lib/utopia/project.rb +1 -1
- data/license.md +1 -1
- data/pages/guides/controller.rb +1 -1
- 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 +24 -34
- data/template/preload.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +7 -23
- metadata.gz.sig +0 -0
- 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.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: af7ac04b71cc8b501069888bd23a5da5cd00bd25d7900016fe89de7e08170426
|
4
|
+
data.tar.gz: fba0add2c28c7712a0c6fd894b21aca3f0015c3fc13f3c4b0299aa053e4dca9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fd2ed330c03e2ba6b4dc2f5ffa7c31d88b6c974b2e1b349c03d882b11ba22cca2fd86aafef63aa09dc18a75d14c1daf766c27b7791c1d3832a67fab00ac22fa
|
7
|
+
data.tar.gz: 6d03bc32040379cfab0f3125da19bc05a21a860cded807c695c8b0592b8b6766c200b489988f9f867a42ab4053e5885a839e66c9774321217f59a4d0c0ab0d98
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
require 'utopia/project'
|
3
|
+
require 'trenni'
|
4
|
+
|
5
|
+
def update(path: "readme.md", documentation_url: nil)
|
6
|
+
project = Utopia::Project::Base.new(context.root)
|
7
|
+
readme = project.readme_document
|
8
|
+
|
9
|
+
documentation_url ||= public_documentation_url
|
10
|
+
|
11
|
+
readme.replace_section("Usage") do |header|
|
12
|
+
current = header
|
13
|
+
|
14
|
+
usage_section = self.usage_section(documentation_url, project)
|
15
|
+
usage_section.each do |child|
|
16
|
+
current.insert_after(child)
|
17
|
+
current = child
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
File.write(path, readme.root.to_markdown)
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
Scope = Struct.new(:documentation_url, :project)
|
27
|
+
|
28
|
+
def gemspec_path
|
29
|
+
Dir.glob("*.gemspec", base: context.root).first
|
30
|
+
end
|
31
|
+
|
32
|
+
def gemspec
|
33
|
+
if gemspec_path = self.gemspec_path
|
34
|
+
@gemspec ||= Gem::Specification.load(gemspec_path)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# The public documentation URL if it can be determined.
|
39
|
+
def public_documentation_url
|
40
|
+
gemspec&.homepage
|
41
|
+
end
|
42
|
+
|
43
|
+
def usage_section(documentation_url, project)
|
44
|
+
template = Trenni::Template.load_file(File.expand_path("usage.trenni", __dir__))
|
45
|
+
scope = Scope.new(documentation_url, project)
|
46
|
+
|
47
|
+
output = template.to_string(scope)
|
48
|
+
|
49
|
+
return Markly.parse(output)
|
50
|
+
end
|
data/lib/utopia/project/base.rb
CHANGED
@@ -46,11 +46,12 @@ module Utopia
|
|
46
46
|
if header.first_child.to_plaintext.include?(name)
|
47
47
|
# Now subsequent children:
|
48
48
|
current = header.next
|
49
|
-
|
49
|
+
|
50
50
|
# Delete everything in the section until we encounter another header:
|
51
51
|
while current && current.type != :header
|
52
|
+
current_next = current.next
|
52
53
|
current.delete
|
53
|
-
current =
|
54
|
+
current = current_next
|
54
55
|
end
|
55
56
|
|
56
57
|
return yield(header)
|
data/lib/utopia/project/guide.rb
CHANGED
@@ -83,8 +83,8 @@ module Utopia
|
|
83
83
|
|
84
84
|
# The hypertext reference to this guide.
|
85
85
|
# @returns [String]
|
86
|
-
def href
|
87
|
-
"
|
86
|
+
def href(base = "/")
|
87
|
+
"#{base}guides/#{self.name}/index"
|
88
88
|
end
|
89
89
|
|
90
90
|
# The best documentation, extracted from the source files of the guide.
|
data/lib/utopia/project.rb
CHANGED
data/license.md
CHANGED