Skip to content

Commit ecb53f8

Browse files
committed
rebuilding site Sun Mar 5 15:41:19 CST 2017
1 parent 21b533b commit ecb53f8

File tree

10 files changed

+479
-45
lines changed

10 files changed

+479
-45
lines changed

guide/index.html

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<meta charset="UTF-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<meta content="" name="keywords">
6+
<meta content="Guides - Elixirscript" property="og:title">
7+
<title>Guides | Elixirscript</title>
8+
<link rel="stylesheet" href="https://elixirscript.github.io/css/style.css">
9+
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
10+
11+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github.min.css">
12+
13+
<section class="section">
14+
<div class="container">
15+
<nav class="nav">
16+
<div class="nav-left">
17+
<a class="nav-item" href="https://elixirscript.github.io">
18+
<h1 class="title is-4">Elixirscript</h1>
19+
</a>
20+
</div>
21+
<div class="nav-right">
22+
<nav class="nav-item level is-mobile">
23+
<a class="level-item" href="/guide">Guide</a>
24+
<a class="level-item" href="https://github.com/elixirscript">
25+
<span class="icon">
26+
<i class="fa fa-github"></i>
27+
</span>
28+
</a>
29+
30+
<a class="level-item" href="/index.xml">
31+
<span class="icon">
32+
<i class="fa fa-rss"></i>
33+
</span>
34+
</a>
35+
36+
</nav>
37+
</div>
38+
</nav>
39+
</div>
40+
</section>
41+
<section class="section">
42+
<div class="container">
43+
44+
<article>
45+
<h1 class="title"><a href="https://elixirscript.github.io/guide/using-with-phoenix/">using with phoenix</a></h1>
46+
47+
<div class="content">
48+
This guide will walk through setting up a Phoenix project with Elixirscript. This guide assumes you have already created a Phoenix project
49+
NOTE: This guide covers Phoenix 1.2. It will be updated when Phoenix 1.3 is released
50+
Update your mix.exs file to add the current version of elixirscript to your dependencies:
51+
defp deps do [ #other deps {:elixir_script, &quot;~&gt; x.x.x&quot;} ] Run mix deps.get:
52+
mix deps.get Next, Add the elixir_script compiler to your list of mix compilers. ...
53+
<a class="button is-link" href="https://elixirscript.github.io/guide/using-with-phoenix/" style="height:28px">
54+
Read more
55+
<span class="icon is-small">
56+
<i class="fa fa-angle-double-right"></i>
57+
</span>
58+
</a>
59+
</div>
60+
</article>
61+
62+
</div>
63+
</section>
64+
<section class="section">
65+
<div class="container">
66+
<nav class="level is-mobile">
67+
<div class="level-left">
68+
<div class="level-item">
69+
70+
<a class="button is-disabled">
71+
<span class="icon is-small is-marginless">
72+
<i class="fa fa-angle-left"></i>
73+
</span>
74+
Newer
75+
</a>
76+
77+
</div>
78+
</div>
79+
<div class="level-right is-marginless">
80+
<div class="level-item">
81+
82+
<a class="button is-disabled">
83+
Older
84+
<span class="icon is-small is-marginless">
85+
<i class="fa fa-angle-right"></i>
86+
</span>
87+
</a>
88+
89+
</div>
90+
</div>
91+
</nav>
92+
</div>
93+
</section>
94+
<section class="section">
95+
<div class="container has-text-centered">
96+
<p></p>
97+
</div>
98+
</section>
99+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js" integrity="sha256-KbfTjB0WZ8vvXngdpJGY3Yp3xKk+tttbqClO11anCIU=" crossorigin="anonymous"></script>
100+
101+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/elixir.min.js"></script>
102+
103+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/javascript.min.js"></script>
104+
105+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/bash.min.js"></script>
106+
107+
<script>hljs.initHighlightingOnLoad();</script>
108+

guide/index.xml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
3+
<channel>
4+
<title>Guides on Elixirscript</title>
5+
<link>https://elixirscript.github.io/guide/index.xml</link>
6+
<description>Recent content in Guides on Elixirscript</description>
7+
<generator>Hugo -- gohugo.io</generator>
8+
<language>en-us</language>
9+
<lastBuildDate>Sun, 05 Mar 2017 14:27:53 -0600</lastBuildDate>
10+
<atom:link href="https://elixirscript.github.io/guide/index.xml" rel="self" type="application/rss+xml" />
11+
12+
<item>
13+
<title>using with phoenix</title>
14+
<link>https://elixirscript.github.io/guide/using-with-phoenix/</link>
15+
<pubDate>Sun, 05 Mar 2017 14:27:53 -0600</pubDate>
16+
17+
<guid>https://elixirscript.github.io/guide/using-with-phoenix/</guid>
18+
<description>&lt;p&gt;This guide will walk through setting up a Phoenix project with Elixirscript. This guide assumes you have already created a Phoenix project&lt;/p&gt;
19+
20+
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: This guide covers Phoenix 1.2. It will be updated when Phoenix 1.3 is released&lt;/p&gt;
21+
22+
&lt;p&gt;Update your mix.exs file to add the current version of elixirscript to your dependencies:&lt;/p&gt;
23+
24+
&lt;pre&gt;&lt;code class=&#34;language-elixir&#34;&gt; defp deps do
25+
[
26+
#other deps
27+
{:elixir_script, &amp;quot;~&amp;gt; x.x.x&amp;quot;}
28+
]
29+
&lt;/code&gt;&lt;/pre&gt;
30+
31+
&lt;p&gt;Run &lt;code&gt;mix deps.get&lt;/code&gt;:&lt;/p&gt;
32+
33+
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;mix deps.get
34+
&lt;/code&gt;&lt;/pre&gt;
35+
36+
&lt;p&gt;Next, Add the &lt;code&gt;elixir_script&lt;/code&gt; compiler to your list of mix compilers. Also add in the &lt;code&gt;elixir_script&lt;/code&gt; configuration:&lt;/p&gt;
37+
38+
&lt;pre&gt;&lt;code class=&#34;language-elixir&#34;&gt;def project do
39+
[app: :my_app,
40+
version: &amp;quot;0.0.1&amp;quot;,
41+
elixir: &amp;quot;~&amp;gt; 1.2&amp;quot;,
42+
elixirc_paths: elixirc_paths(Mix.env),
43+
compilers: [:phoenix, :gettext, :elixir_script] ++ Mix.compilers,
44+
build_embedded: Mix.env == :prod,
45+
start_permanent: Mix.env == :prod,
46+
deps: deps(),
47+
elixir_script: [
48+
input: &amp;quot;web/static/elixirscript&amp;quot;,
49+
output: &amp;quot;web/static/js/build&amp;quot;
50+
]
51+
]
52+
end
53+
&lt;/code&gt;&lt;/pre&gt;
54+
55+
&lt;p&gt;Elixirscript by default will looks for input in the &lt;code&gt;lib/elixirscript&lt;/code&gt; directory. It will also by default output to &lt;code&gt;priv/elixirscript&lt;/code&gt;. Update the input directory to &lt;code&gt;web/static/elixirscript&lt;/code&gt;. Update the output directory to &lt;code&gt;web/static/js/build&lt;/code&gt;. This lets it tie into Brunch&amp;rsquo;s pipeline.&lt;/p&gt;
56+
57+
&lt;p&gt;Next, update the watcher configuration to use the Elixirscript watcher:&lt;/p&gt;
58+
59+
&lt;pre&gt;&lt;code class=&#34;language-elixir&#34;&gt; watchers: [node: [&amp;quot;node_modules/brunch/bin/brunch&amp;quot;, &amp;quot;watch&amp;quot;, &amp;quot;--stdin&amp;quot;,
60+
cd: Path.expand(&amp;quot;../&amp;quot;, __DIR__)], mix: [&amp;quot;elixirscript.watch&amp;quot;]]
61+
&lt;/code&gt;&lt;/pre&gt;
62+
63+
&lt;p&gt;Whenever your Elixirscript code changes, the elixirscript compiler will recompile it.&lt;/p&gt;
64+
65+
&lt;p&gt;Create &lt;code&gt;app.ex&lt;/code&gt; in the &lt;code&gt;web/static/elixirscript&lt;/code&gt; directory&lt;/p&gt;
66+
67+
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;touch web/static/elixirscript/app.ex
68+
&lt;/code&gt;&lt;/pre&gt;
69+
70+
&lt;p&gt;For this example, write a simple module that will write &lt;code&gt;Hello, world&lt;/code&gt; to the console on start:&lt;/p&gt;
71+
72+
&lt;pre&gt;&lt;code class=&#34;language-elixir&#34;&gt;defmodule App do
73+
74+
def start(_type, _args) do
75+
:console.log(&amp;quot;Hello, world&amp;quot;)
76+
end
77+
78+
end
79+
&lt;/code&gt;&lt;/pre&gt;
80+
81+
&lt;p&gt;Finally, update &lt;code&gt;web/static/js/app.js&lt;/code&gt; to start your Elixirscript app:&lt;/p&gt;
82+
83+
&lt;pre&gt;&lt;code class=&#34;language-javascript&#34;&gt;import Elixir from &#39;./build/Elixir.App&#39;;
84+
Elixir.start(Elixir.App, [])
85+
&lt;/code&gt;&lt;/pre&gt;
86+
87+
&lt;p&gt;The empty array is list of initial arguments for your app.&lt;/p&gt;
88+
89+
&lt;p&gt;If you run &lt;code&gt;mix compile&lt;/code&gt;, you should see a JavaScript file, &lt;code&gt;Elixir.App.js&lt;/code&gt; in your &lt;code&gt;web/static/js/build&lt;/code&gt; directory.&lt;/p&gt;
90+
91+
&lt;p&gt;If you run &lt;code&gt;mix phoenix.server&lt;/code&gt;, open your browser, and then open your console, you should see &lt;code&gt;Hello, world&lt;/code&gt;. Any changes should cause a reload&lt;/p&gt;
92+
</description>
93+
</item>
94+
95+
</channel>
96+
</rss>

guide/page/1/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!DOCTYPE html><html><head><title>https://elixirscript.github.io/guide/</title><link rel="canonical" href="https://elixirscript.github.io/guide/"/><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta http-equiv="refresh" content="0; url=https://elixirscript.github.io/guide/" /></head></html>
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<meta charset="UTF-8">
4+
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<meta content="" name="keywords">
6+
<meta content="using with phoenix - Elixirscript" property="og:title">
7+
<title>using with phoenix | Elixirscript</title>
8+
<link rel="stylesheet" href="https://elixirscript.github.io/css/style.css">
9+
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
10+
11+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/github.min.css">
12+
13+
<section class="section">
14+
<div class="container">
15+
<nav class="nav">
16+
<div class="nav-left">
17+
<a class="nav-item" href="https://elixirscript.github.io">
18+
<h1 class="title is-4">Elixirscript</h1>
19+
</a>
20+
</div>
21+
<div class="nav-right">
22+
<nav class="nav-item level is-mobile">
23+
<a class="level-item" href="/guide">Guide</a>
24+
<a class="level-item" href="https://github.com/elixirscript">
25+
<span class="icon">
26+
<i class="fa fa-github"></i>
27+
</span>
28+
</a>
29+
30+
<a class="level-item" href="/index.xml">
31+
<span class="icon">
32+
<i class="fa fa-rss"></i>
33+
</span>
34+
</a>
35+
36+
</nav>
37+
</div>
38+
</nav>
39+
</div>
40+
</section>
41+
<section class="section">
42+
<div class="container">
43+
<h1 class="title">using with phoenix</h1>
44+
45+
<div class="content">
46+
<p>This guide will walk through setting up a Phoenix project with Elixirscript. This guide assumes you have already created a Phoenix project</p>
47+
48+
<p><strong>NOTE</strong>: This guide covers Phoenix 1.2. It will be updated when Phoenix 1.3 is released</p>
49+
50+
<p>Update your mix.exs file to add the current version of elixirscript to your dependencies:</p>
51+
52+
<pre><code class="language-elixir"> defp deps do
53+
[
54+
#other deps
55+
{:elixir_script, &quot;~&gt; x.x.x&quot;}
56+
]
57+
</code></pre>
58+
59+
<p>Run <code>mix deps.get</code>:</p>
60+
61+
<pre><code class="language-bash">mix deps.get
62+
</code></pre>
63+
64+
<p>Next, Add the <code>elixir_script</code> compiler to your list of mix compilers. Also add in the <code>elixir_script</code> configuration:</p>
65+
66+
<pre><code class="language-elixir">def project do
67+
[app: :my_app,
68+
version: &quot;0.0.1&quot;,
69+
elixir: &quot;~&gt; 1.2&quot;,
70+
elixirc_paths: elixirc_paths(Mix.env),
71+
compilers: [:phoenix, :gettext, :elixir_script] ++ Mix.compilers,
72+
build_embedded: Mix.env == :prod,
73+
start_permanent: Mix.env == :prod,
74+
deps: deps(),
75+
elixir_script: [
76+
input: &quot;web/static/elixirscript&quot;,
77+
output: &quot;web/static/js/build&quot;
78+
]
79+
]
80+
end
81+
</code></pre>
82+
83+
<p>Elixirscript by default will looks for input in the <code>lib/elixirscript</code> directory. It will also by default output to <code>priv/elixirscript</code>. Update the input directory to <code>web/static/elixirscript</code>. Update the output directory to <code>web/static/js/build</code>. This lets it tie into Brunch&rsquo;s pipeline.</p>
84+
85+
<p>Next, update the watcher configuration to use the Elixirscript watcher:</p>
86+
87+
<pre><code class="language-elixir"> watchers: [node: [&quot;node_modules/brunch/bin/brunch&quot;, &quot;watch&quot;, &quot;--stdin&quot;,
88+
cd: Path.expand(&quot;../&quot;, __DIR__)], mix: [&quot;elixirscript.watch&quot;]]
89+
</code></pre>
90+
91+
<p>Whenever your Elixirscript code changes, the elixirscript compiler will recompile it.</p>
92+
93+
<p>Create <code>app.ex</code> in the <code>web/static/elixirscript</code> directory</p>
94+
95+
<pre><code class="language-bash">touch web/static/elixirscript/app.ex
96+
</code></pre>
97+
98+
<p>For this example, write a simple module that will write <code>Hello, world</code> to the console on start:</p>
99+
100+
<pre><code class="language-elixir">defmodule App do
101+
102+
def start(_type, _args) do
103+
:console.log(&quot;Hello, world&quot;)
104+
end
105+
106+
end
107+
</code></pre>
108+
109+
<p>Finally, update <code>web/static/js/app.js</code> to start your Elixirscript app:</p>
110+
111+
<pre><code class="language-javascript">import Elixir from './build/Elixir.App';
112+
Elixir.start(Elixir.App, [])
113+
</code></pre>
114+
115+
<p>The empty array is list of initial arguments for your app.</p>
116+
117+
<p>If you run <code>mix compile</code>, you should see a JavaScript file, <code>Elixir.App.js</code> in your <code>web/static/js/build</code> directory.</p>
118+
119+
<p>If you run <code>mix phoenix.server</code>, open your browser, and then open your console, you should see <code>Hello, world</code>. Any changes should cause a reload</p>
120+
121+
</div>
122+
</div>
123+
</section>
124+
<section class="section">
125+
<div class="container has-text-centered">
126+
<p></p>
127+
</div>
128+
</section>
129+
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js" integrity="sha256-KbfTjB0WZ8vvXngdpJGY3Yp3xKk+tttbqClO11anCIU=" crossorigin="anonymous"></script>
130+
131+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/elixir.min.js"></script>
132+
133+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/javascript.min.js"></script>
134+
135+
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/languages/bash.min.js"></script>
136+
137+
<script>hljs.initHighlightingOnLoad();</script>
138+

0 commit comments

Comments
 (0)