utopia-project 0.13.0 → 0.14.1
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 +1 -3
- 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
- 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: fbdcc336360ff1d15a59373bf8b092e65903e7b08db3f160d8f98552a44b1ad5
|
4
|
+
data.tar.gz: e1d4ec64476493cec60ba46c08016f76d0c599d378ceb8de6c4e607605f8bad1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d1bdeee7c8d2723f794020b4ccde19585d5d391203df95afb5853a778fdf70f4e3cfb6e49500aef612b39535a6f0782184a261647f23df829319f1d1ccc0c85
|
7
|
+
data.tar.gz: '087944905a965cbc0acfde35694d27795ee130440d85932e0e89c8e3a763c2829336db85cfc3ac748904045d2d40926b621afdcc894fef31c0ca7111b8cde420'
|
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,9 +18,7 @@
|
|
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="/
|
22
|
-
<script src="/_static/links.js?#{rand}"></script>
|
23
|
-
<script src="/_static/search.js?#{rand}"></script>
|
21
|
+
<script src="/_static/links.js"></script>
|
24
22
|
|
25
23
|
<script type="text/javascript">
|
26
24
|
//<![CDATA[
|
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)};
|
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.1
|
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
|