utopia-project 0.13.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- 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/_page.xnode +0 -1
- data/pages/_usage.xnode +11 -9
- data/pages/index.xnode +3 -1
- data/pages/source/show.xnode +3 -1
- data/public/_components/jquery-syntax/base/jquery.syntax.brush.xml.css +17 -0
- data/public/_components/jquery-syntax/jquery.syntax.core.js +2 -2
- data/public/_static/site.css +5 -2
- 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: '091faad399631568cd9bee652a58957cb4188c13c45052bf6ac5d1c17fb7b88e'
|
4
|
+
data.tar.gz: 36ef0df6a0644d7c31ef74d41f4805bd7afc3fa364ca71f8812fe9d8b4d53009
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59a0a301570e4828e83c3d76aafa836c2c34a91ed8bb06276e5772221823267b1763c20c779cbe5310d761806a192963433bb98d3dda346628875bf25cdb7855
|
7
|
+
data.tar.gz: dc24d777cccf856faae7eaccef615cd042e08faad2b0cfcb55de340d4088efb40b2ed276040b20394ebfca06a83251eefc1e5ccb633e69c96c90f7116a67488d
|
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/_page.xnode
CHANGED
@@ -18,7 +18,6 @@
|
|
18
18
|
<script src="/_components/jquery/jquery.min.js"></script>
|
19
19
|
<script src="/_components/jquery-syntax/jquery.syntax.min.js"></script>
|
20
20
|
|
21
|
-
<script src="/_components/lunr/lunr.min.js"></script>
|
22
21
|
<script src="/_static/links.js"></script>
|
23
22
|
|
24
23
|
<script type="text/javascript">
|
data/pages/_usage.xnode
CHANGED
@@ -5,15 +5,17 @@
|
|
5
5
|
|
6
6
|
base.guides do |guide|
|
7
7
|
?>
|
8
|
-
<
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
8
|
+
<section>
|
9
|
+
<h3><a href="#{guide.href}">#{guide.title}</a></h3>
|
10
|
+
|
11
|
+
<?r if documentation = guide.documentation ?>
|
12
|
+
#{base.format(documentation.text, language: guide.documentation.language)}
|
13
|
+
<?r elsif description = guide.description ?>
|
14
|
+
#{MarkupString.raw description.to_html}
|
15
|
+
<?r else ?>
|
16
|
+
<p>No description.</p>
|
17
|
+
<?r end ?>
|
18
|
+
</section>
|
17
19
|
<?r
|
18
20
|
end
|
19
21
|
?>
|
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
|
?>
|
@@ -16,3 +16,20 @@
|
|
16
16
|
color: #666;
|
17
17
|
background-color: #ddd;
|
18
18
|
border-radius: 0.5em; }
|
19
|
+
|
20
|
+
@media (prefers-color-scheme: dark) {
|
21
|
+
.syntax-theme-base .xml .cdata-content {
|
22
|
+
color: #a46; }
|
23
|
+
.syntax-theme-base .xml .xml-tag, .syntax-theme-base .xml .cdata {
|
24
|
+
color: #c59de7; }
|
25
|
+
.syntax-theme-base .xml .tag-name, .syntax-theme-base .xml .cdata-tag {
|
26
|
+
color: #9ae; }
|
27
|
+
.syntax-theme-base .xml .namespace {
|
28
|
+
color: #c59de7; }
|
29
|
+
.syntax-theme-base .xml .attribute {
|
30
|
+
color: #c59de7; }
|
31
|
+
.syntax-theme-base .xml .instruction {
|
32
|
+
color: #c59de7; }
|
33
|
+
.syntax-theme-base .xml .entity, .syntax-theme-base .xml .percent-escape {
|
34
|
+
color: #999;
|
35
|
+
background-color: #333; } }
|
@@ -9,8 +9,8 @@ Syntax.lib.camelCaseType={pattern:/\b_*[A-Z][\w]*\b/g,klass:"type"};Syntax.lib.c
|
|
9
9
|
Syntax.lib.doubleQuotedString={pattern:/"([^\\"\n]|\\.)*"/g,klass:"string"};Syntax.lib.singleQuotedString={pattern:/'([^\\'\n]|\\.)*'/g,klass:"string"};Syntax.lib.multiLineDoubleQuotedString={pattern:/"([^\\"]|\\.)*"/g,klass:"string"};Syntax.lib.multiLineSingleQuotedString={pattern:/'([^\\']|\\.)*'/g,klass:"string"};Syntax.lib.stringEscape={pattern:/\\./g,klass:"escape",only:["string"]};
|
10
10
|
Syntax.Match=function(b,a,c,d){this.offset=b;this.endOffset=b+a;this.length=a;this.expression=c;this.value=d;this.children=[];this.next=this.parent=null};Syntax.Match.prototype.shift=function(b,a){this.adjust(b,null,a);for(var c=0;c<this.children.length;c++)this.children[c].shift(b,a)};Syntax.Match.prototype.adjust=function(b,a,c){this.offset+=b;this.endOffset+=b;a&&(this.length=a,this.endOffset=this.offset+a);c&&(this.value=c.substr(this.offset,this.length))};
|
11
11
|
Syntax.Match.sort=function(b,a){return b.offset-a.offset||a.length-b.length};Syntax.Match.prototype.contains=function(b){return b.offset>=this.offset&&b.endOffset<=this.endOffset};Syntax.Match.defaultReduceCallback=function(b,a){"string"===typeof b&&(b=document.createTextNode(b));a.appendChild(b)};
|
12
|
-
Syntax.Match.prototype.reduce=function(b,a){var c=this.offset
|
13
|
-
this.offset,g-c);b(c,d);b(f.reduce(b,a),d);c=f.endOffset}c===this.offset?b(this.value,d):c<this.endOffset?b(this.value.substr(c-this.offset,this.endOffset-c),d):c>this.endOffset&&console.log("Syntax Warning: Start position "+c+" exceeds end of value "+this.endOffset);a&&(d=a(d,this));return d};
|
12
|
+
Syntax.Match.prototype.reduce=function(b,a){var c=this.offset;var d=this.expression&&this.expression.element?this.expression.element.cloneNode(!1):document.createElement("span");b=b||Syntax.Match.defaultReduceCallback;this.expression&&this.expression.klass&&(0<d.className.length&&(d.className+=" "),d.className+=this.expression.klass);this.className&&(d.className+=" ",d.className+=this.className);for(var e=0;e<this.children.length;e+=1){var f=this.children[e],g=f.offset;f.offset<this.offset&&console.log("Syntax Warning: Offset of child",
|
13
|
+
f,"is before offset of parent",this);c=this.value.substr(c-this.offset,g-c);b(c,d);b(f.reduce(b,a),d);c=f.endOffset}c===this.offset?b(this.value,d):c<this.endOffset?b(this.value.substr(c-this.offset,this.endOffset-c),d):c>this.endOffset&&console.log("Syntax Warning: Start position "+c+" exceeds end of value "+this.endOffset);a&&(d=a(d,this));return d};
|
14
14
|
Syntax.Match.prototype.canContain=function(b){return b.expression.force?!0:this.complete?!1:b.expression.only?!0:"undefined"===typeof this.expression.allow||jQuery.isArray(this.expression.disallow)&&-1!==jQuery.inArray(b.expression.klass,this.expression.disallow)?!1:"*"===this.expression.allow||jQuery.isArray(this.expression.allow)&&-1!==jQuery.inArray(b.expression.klass,this.expression.allow)?!0:!1};
|
15
15
|
Syntax.Match.prototype.canHaveChild=function(b){if(b=b.expression.only){for(var a=this;null!==a;){if(-1!==jQuery.inArray(a.expression.klass,b))return!0;if((a=a.parent)&&a.complete)break}return!1}return!0};Syntax.Match.prototype._splice=function(b,a){return this.canHaveChild(a)?(this.children.splice(b,0,a),a.parent=this,a.expression.owner||(a.expression.owner=this.expression.owner),this):null};
|
16
16
|
Syntax.Match.prototype.insert=function(b,a){if(!this.contains(b))return null;if(a){a=this;for(var c=0;c<a.children.length;)a.children[c].contains(b)?(a=a.children[c],c=0):c+=1;return a._insertWhole(b)}return this._insert(b)};
|
data/public/_static/site.css
CHANGED
@@ -48,7 +48,7 @@ html {
|
|
48
48
|
--main-color: #111;
|
49
49
|
--main-background-color: #fff;
|
50
50
|
|
51
|
-
--header-color: #
|
51
|
+
--header-color: #dfebff;
|
52
52
|
--underlay-color: #ddd;
|
53
53
|
|
54
54
|
--accent-color: #1a73e8;
|
@@ -131,7 +131,10 @@ footer {
|
|
131
131
|
|
132
132
|
h1, h2, h3, h4, h5, h6, p, pre, ul, dl, ol {
|
133
133
|
margin: 1rem;
|
134
|
-
|
134
|
+
}
|
135
|
+
|
136
|
+
pre {
|
137
|
+
margin: 2rem 1rem;
|
135
138
|
}
|
136
139
|
|
137
140
|
h1 span {
|
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.2
|
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-
|
11
|
+
date: 2020-08-05 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
|