utopia-project 0.13.3 → 0.14.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
- data/lib/utopia/project/base.md +7 -0
- data/lib/utopia/project/base.rb +14 -0
- data/lib/utopia/project/version.rb +1 -1
- data/pages/index.xnode +3 -1
- data/pages/source/show.xnode +3 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 892e9849fb8f032a63212174f8940f22cd8765a633638aff870f3b73cce9f2e5
|
4
|
+
data.tar.gz: dc7265bfbd2f9c52d25c5f068da9d28c38e1fcd8fba5344eb81d177f59b92a5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2eff941e3bbcf12d0d930371f95cd06a84e720d9abaf5c2d596f50ab0167284685a69fdd9217121e59ec927594d7baf376692bd1c79603f11257d28e0ec73b4
|
7
|
+
data.tar.gz: d8f7baa20bf59b301bc59bbc60285dc65f3bb056aed964c5ea47bfc9caba0e2a3908266c48d770aa125f5e5fc9d387b443c0127306b3b27c2424dcf290de6478
|
data/lib/utopia/project/base.rb
CHANGED
@@ -106,6 +106,20 @@ module Utopia
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
109
|
+
def document_for(definition)
|
110
|
+
document_path = File.join("lib", definition.lexical_path.map{|_| _.to_s.downcase}) + ".md"
|
111
|
+
|
112
|
+
if File.exist?(document_path)
|
113
|
+
document = self.document(File.read(document_path), definition)
|
114
|
+
|
115
|
+
if document.first_child.type == :header
|
116
|
+
document.first_child.delete
|
117
|
+
end
|
118
|
+
|
119
|
+
return document
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
109
123
|
def linkify(text, definition, language: definition&.language)
|
110
124
|
rewriter = Linkify.new(self, language, text)
|
111
125
|
|
data/pages/index.xnode
CHANGED
@@ -12,7 +12,9 @@
|
|
12
12
|
when :text
|
13
13
|
?><content:heading>#{title.string_content}</content:heading><?r
|
14
14
|
when :image
|
15
|
-
|
15
|
+
self.document.attributes[:title] ||= title.to_plaintext
|
16
|
+
|
17
|
+
?><h1><img src="#{title.url}" /></h1><?r
|
16
18
|
else
|
17
19
|
?><content:heading>Project</content:heading><?r
|
18
20
|
end
|
data/pages/source/show.xnode
CHANGED
@@ -7,7 +7,9 @@
|
|
7
7
|
<content:heading><code class="language-#{symbol.language.name}">#{symbol.qualified_name}</code></content:heading>
|
8
8
|
|
9
9
|
<?r
|
10
|
-
if
|
10
|
+
if document = base.document_for(symbol)
|
11
|
+
?>#{document.to_html}<?r
|
12
|
+
elsif documentation = symbol.documentation
|
11
13
|
?>#{base.format(documentation.text.join("\n"), symbol)}<?r
|
12
14
|
end
|
13
15
|
?>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utopia-project
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: utopia
|
@@ -187,6 +187,7 @@ extra_rdoc_files: []
|
|
187
187
|
files:
|
188
188
|
- bake/utopia/project.rb
|
189
189
|
- lib/utopia/project.rb
|
190
|
+
- lib/utopia/project/base.md
|
190
191
|
- lib/utopia/project/base.rb
|
191
192
|
- lib/utopia/project/document.rb
|
192
193
|
- lib/utopia/project/guide.rb
|