Skip to content

Commit

Permalink
update website
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Jul 4, 2018
1 parent e4b97d7 commit 878d64c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
1 change: 1 addition & 0 deletions web/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pre code {
background: #1f292e;
border: 1px solid #343434;
color: #b3c3cc;
tab-size: 3;
}

pre code::after {
Expand Down
25 changes: 11 additions & 14 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,19 @@ <h1>The minimal & fast user interface library</h1>
</div>
</section>

<section id="feature-minimal" class="container feature">
<h1>Minimal</h1>
<p>Moon instances have two parts — a view and data. The view is responsible for displaying the data which can contain actions to update the view. The view is defined using the <b>Moon View Language</b> — an intuitive template language allowing for powerful interpolation and simple logic. The data is a JavaScript object that can contain properties of any type along with actions — functions that can change the data to update the view.</p>
<section id="feature-minimal" class="container feature"> <h1>Minimal</h1>
<p>Moon instances are composed of data and a view to display the data. Actions performed through the view update the data along with the view. The view is defined with the Moon view language — a minimalistic template language allowing powerful interpolation and logic. The data is defined with a JavaScript object containing values of any type.</p>
<div class="row">
<div class="col">
<pre><code lang="mvl"><span class="red">&lt;p</span><span class="red">&gt;</span>Count: { count }<span class="red">&lt;/p</span><span class="red">&gt;</span>
<span class="red">&lt;button</span> <span class="orange">@click</span>={ <span class="blue">increment</span>() }<span class="red">&gt;</span>
Increment
<span class="red">&lt;/button</span><span class="red">&gt;</span></code></pre>
<pre><code lang="js">{
count: <span class="orange">0</span>,
<span class="blue">increment</span>() {
<span class="orange">this</span>.<span class="blue">update</span>(<span class="green">&quot;count&quot;</span>, <span class="orange">this</span>.data.count + <span class="orange">1</span>);
}
}</code></pre>
<pre><code lang="mvl"><span class="red">&lt;h1</span><span class="red">&gt;</span>{text}<span class="red">&lt;/h1</span><span class="red">&gt;</span>
<span class="red">&lt;input</span> <span class="orange">type</span>=<span class="green">&quot;text&quot;</span> <span class="orange">@bind</span>={text} <span class="red">/&gt;</span></code></pre>
<pre><code lang="js"><span class="blue">Moon</span>({
root: <span class="green">&quot;#root&quot;</span>,
text: <span class="green">&quot;Hello Moon!&quot;</span>
});</code></pre>
</div>
<div class="col">

<div id="example"></div>
</div>
</div>
</section>
Expand All @@ -74,5 +69,7 @@ <h1>Fast</h1>
</div>
</div>
</section>
<script src="../dist/moon.min.js"></script>
<script src="./js/index.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions web/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Moon({
root: "#example",
view: "<h1>{text}</h1><input type='text' @bind={text}/>",
text: "Hello Moon!"
});
4 changes: 2 additions & 2 deletions web/soldfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const escapeMap = {
};

const highlight = function(compiled) {
compiled = compiled.replace(STR_RE, "<span class=\"green\">$1$2$1</span>");

compiled = compiled.replace(HTML_COMMENT_RE, "<span class=\"gray\">$1</span>");
compiled = compiled.replace(HTML_TAG_RE, function(match, start, content, end) {
if (content === undefined) {
Expand Down Expand Up @@ -52,6 +50,8 @@ const highlight = function(compiled) {
return "<span class=\"blue\">" + name + "</span>(";
});

compiled = compiled.replace(STR_RE, "<span class=\"green\">$1$2$1</span>");

return compiled;
}

Expand Down
25 changes: 11 additions & 14 deletions web/template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,19 @@ <h1>The minimal & fast user interface library</h1>
</div>
</section>

<section id="feature-minimal" class="container feature">
<h1>Minimal</h1>
<p>Moon instances have two parts — a view and data. The view is responsible for displaying the data which can contain actions to update the view. The view is defined using the <b>Moon View Language</b> — an intuitive template language allowing for powerful interpolation and simple logic. The data is a JavaScript object that can contain properties of any type along with actions — functions that can change the data to update the view.</p>
<section id="feature-minimal" class="container feature"> <h1>Minimal</h1>
<p>Moon instances are composed of data and a view to display the data. Actions performed through the view update the data along with the view. The view is defined with the Moon view language — a minimalistic template language allowing powerful interpolation and logic. The data is defined with a JavaScript object containing values of any type.</p>
<div class="row">
<div class="col">
<pre><code lang="mvl"><span class="red">&lt;p</span><span class="red">&gt;</span>Count: { count }<span class="red">&lt;/p</span><span class="red">&gt;</span>
<span class="red">&lt;button</span> <span class="orange">@click</span>={ <span class="blue">increment</span>() }<span class="red">&gt;</span>
Increment
<span class="red">&lt;/button</span><span class="red">&gt;</span></code></pre>
<pre><code lang="js">{
count: <span class="orange">0</span>,
<span class="blue">increment</span>() {
<span class="orange">this</span>.<span class="blue">update</span>(<span class="green">&quot;count&quot;</span>, <span class="orange">this</span>.data.count + <span class="orange">1</span>);
}
}</code></pre>
<pre><code lang="mvl"><span class="red">&lt;h1</span><span class="red">&gt;</span>{text}<span class="red">&lt;/h1</span><span class="red">&gt;</span>
<span class="red">&lt;input</span> <span class="orange">type</span>=<span class="green">&quot;text&quot;</span> <span class="orange">@bind</span>={text} <span class="red">/&gt;</span></code></pre>
<pre><code lang="js"><span class="blue">Moon</span>({
root: <span class="green">&quot;#root&quot;</span>,
text: <span class="green">&quot;Hello Moon!&quot;</span>
});</code></pre>
</div>
<div class="col">

<div id="example"></div>
</div>
</div>
</section>
Expand All @@ -74,5 +69,7 @@ <h1>Fast</h1>
</div>
</div>
</section>
<script src="../dist/moon.min.js"></script>
<script src="./js/index.js"></script>
</body>
</html>

0 comments on commit 878d64c

Please sign in to comment.