Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
damianavila committed Sep 13, 2013
1 parent ba20dcb commit 29f24b1
Show file tree
Hide file tree
Showing 99 changed files with 2,396 additions and 211 deletions.
Binary file modified .doit.db
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

<div class="text_cell_render border-box-sizing rendered_html">
<p>IPython slides are powered by <a href="https://github.com/hakimel/reveal.js/">Reveal.js</a> library, you probably already know that.</p>
<p>But... you probably don't know that we use <a href="http://www.jsdelivr.com/">jsdelivr</a> CDN to load all the necessary js and css files. As a consequence, you don't need to download Reveal.js, but also, the speaker notes are not working by default.</p>
<p>But... what happens, if you have low connectivity in the place where you will be presenting your talk (or if you want to use the speaker notes feature)? <!-- TEASER_END --></p>
<p>In this case, it would be better to use a local copy of the Reveal.js library. And you can easily configure this behavior using a config object from the IPython machinery.</p>
<p>Below, you have one way to do it:</p>
</div>
<div class="cell border-box-sizing code_cell vbox">
<div class="input hbox">
<div class="prompt input_prompt">
In&nbsp;[1]:
</div>
<div class="input_area box-flex1">
<div class="highlight"><pre><span class="kn">from</span> <span class="nn">IPython.nbconvert.exporters</span> <span class="kn">import</span> <span class="n">SlidesExporter</span>
<span class="kn">from</span> <span class="nn">IPython.config</span> <span class="kn">import</span> <span class="n">Config</span>

<span class="kn">from</span> <span class="nn">IPython.nbformat</span> <span class="kn">import</span> <span class="n">current</span> <span class="k">as</span> <span class="n">nbformat</span>

<span class="n">infile</span> <span class="o">=</span> <span class="s">&quot;talk.ipynb&quot;</span> <span class="c"># load the name of your slideshow</span>
<span class="n">outfile</span> <span class="o">=</span> <span class="s">&quot;talk.slides.html&quot;</span>

<span class="n">notebook</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">infile</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">notebook_json</span> <span class="o">=</span> <span class="n">nbformat</span><span class="o">.</span><span class="n">reads_json</span><span class="p">(</span><span class="n">notebook</span><span class="p">)</span>

<span class="c"># This is the config object I talked before: </span>
<span class="c"># After the &#39;url_prefix&#39;, you can set the location of your </span>
<span class="c"># local reveal.js library, i.e. if the reveal.js is located </span>
<span class="c"># in the same directory as your talk.slides.html, then </span>
<span class="c"># set &#39;url_prefix&#39;:&#39;reveal.js&#39;.</span>

<span class="n">c</span> <span class="o">=</span> <span class="n">Config</span><span class="p">({</span>
<span class="s">&#39;RevealHelpTransformer&#39;</span><span class="p">:{</span>
<span class="s">&#39;enabled&#39;</span><span class="p">:</span><span class="bp">True</span><span class="p">,</span>
<span class="s">&#39;url_prefix&#39;</span><span class="p">:</span><span class="s">&#39;reveal.js&#39;</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">})</span>

<span class="n">exportHtml</span> <span class="o">=</span> <span class="n">SlidesExporter</span><span class="p">(</span><span class="n">config</span><span class="o">=</span><span class="n">c</span><span class="p">)</span>
<span class="p">(</span><span class="n">body</span><span class="p">,</span><span class="n">resources</span><span class="p">)</span> <span class="o">=</span> <span class="n">exportHtml</span><span class="o">.</span><span class="n">from_notebook_node</span><span class="p">(</span><span class="n">notebook_json</span><span class="p">)</span>

<span class="nb">open</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="s">&#39;w&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">body</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;utf-8&#39;</span><span class="p">))</span>
</pre></div>

</div>
</div>

</div>
<div class="text_cell_render border-box-sizing rendered_html">
<p>Then, just serve the directory:</p>
<p><code>python -m SimpleHTTPServer 8000</code></p>
<p>open the browser and point it to <code>http://localhost:port</code>, ie:</p>
<p><code>xdg-open http://127.0.0.1:8000</code></p>
<p>OK, that's all... you don't need connectivity anymore ;-) OK, just kidding... he he!</p>
<p><strong>NOTE</strong>: If you are using master, it is even simpler... because now <code>--post serve</code> post-processor uses tornado to forward requests to the CDN if and only if local Reveal.js is unavailable (PR merged <a href="https://github.com/ipython/ipython/pull/4048">here</a>, thanks <strong>MinRK</strong>). So, just locate the <code>reveal.js</code> in the same directory as your talk.slides.html lives and run (as usually):</p>
<p><code>ipython nbconvert talk.ipynb --to slides --post serve</code></p>
<p>You can also point to another directory using the <code>--reveal-prefix</code> alias, ie:</p>
<p><code>ipython nbconvert talk.ipynb --to slides --post serve --reveal-prefix foo/reveal.js</code></p>
<p>Hope it helps.</p>
<p>Damián.</p>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

<div class="text_cell_render border-box-sizing rendered_html">
<p>IPython slides are powered by <a href="https://github.com/hakimel/reveal.js/">Reveal.js</a> library, you probably already know that.</p>
<p>But... you probably don't know that we use <a href="http://www.jsdelivr.com/">jsdelivr</a> CDN to load all the necessary js and css files. As a consequence, you don't need to download Reveal.js, but also, the speaker notes are not working by default.</p>
<p>But... what happens, if you have low connectivity in the place where you will be presenting your talk (or if you want to use the speaker notes feature)? <!-- TEASER_END --></p>
<p>In this case, it would be better to use a local copy of the Reveal.js library. And you can easily configure this behavior using a config object from the IPython machinery.</p>
<p>Below, you have one way to do it:</p>
</div>
<div class="cell border-box-sizing code_cell vbox">
<div class="input hbox">
<div class="prompt input_prompt">
In&nbsp;[1]:
</div>
<div class="input_area box-flex1">
<div class="highlight"><pre><span class="kn">from</span> <span class="nn">IPython.nbconvert.exporters</span> <span class="kn">import</span> <span class="n">SlidesExporter</span>
<span class="kn">from</span> <span class="nn">IPython.config</span> <span class="kn">import</span> <span class="n">Config</span>

<span class="kn">from</span> <span class="nn">IPython.nbformat</span> <span class="kn">import</span> <span class="n">current</span> <span class="k">as</span> <span class="n">nbformat</span>

<span class="n">infile</span> <span class="o">=</span> <span class="s">&quot;talk.ipynb&quot;</span> <span class="c"># load the name of your slideshow</span>
<span class="n">outfile</span> <span class="o">=</span> <span class="s">&quot;talk.slides.html&quot;</span>

<span class="n">notebook</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="n">infile</span><span class="p">)</span><span class="o">.</span><span class="n">read</span><span class="p">()</span>
<span class="n">notebook_json</span> <span class="o">=</span> <span class="n">nbformat</span><span class="o">.</span><span class="n">reads_json</span><span class="p">(</span><span class="n">notebook</span><span class="p">)</span>

<span class="c"># This is the config object I talked before: </span>
<span class="c"># After the &#39;url_prefix&#39;, you can set the location of your </span>
<span class="c"># local reveal.js library, i.e. if the reveal.js is located </span>
<span class="c"># in the same directory as your talk.slides.html, then </span>
<span class="c"># set &#39;url_prefix&#39;:&#39;reveal.js&#39;.</span>

<span class="n">c</span> <span class="o">=</span> <span class="n">Config</span><span class="p">({</span>
<span class="s">&#39;RevealHelpTransformer&#39;</span><span class="p">:{</span>
<span class="s">&#39;enabled&#39;</span><span class="p">:</span><span class="bp">True</span><span class="p">,</span>
<span class="s">&#39;url_prefix&#39;</span><span class="p">:</span><span class="s">&#39;reveal.js&#39;</span><span class="p">,</span>
<span class="p">},</span>
<span class="p">})</span>

<span class="n">exportHtml</span> <span class="o">=</span> <span class="n">SlidesExporter</span><span class="p">(</span><span class="n">config</span><span class="o">=</span><span class="n">c</span><span class="p">)</span>
<span class="p">(</span><span class="n">body</span><span class="p">,</span><span class="n">resources</span><span class="p">)</span> <span class="o">=</span> <span class="n">exportHtml</span><span class="o">.</span><span class="n">from_notebook_node</span><span class="p">(</span><span class="n">notebook_json</span><span class="p">)</span>

<span class="nb">open</span><span class="p">(</span><span class="n">outfile</span><span class="p">,</span> <span class="s">&#39;w&#39;</span><span class="p">)</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">body</span><span class="o">.</span><span class="n">encode</span><span class="p">(</span><span class="s">&#39;utf-8&#39;</span><span class="p">))</span>
</pre></div>

</div>
</div>

</div>
<div class="text_cell_render border-box-sizing rendered_html">
<p>Then, just serve the directory:</p>
<p><code>python -m SimpleHTTPServer 8000</code></p>
<p>open the browser and point it to <code>http://localhost:port</code>, ie:</p>
<p><code>xdg-open http://127.0.0.1:8000</code></p>
<p>OK, that's all... you don't need connectivity anymore ;-) OK, just kidding... he he!</p>
<p><strong>NOTE</strong>: If you are using master, it is even simpler... because now <code>--post serve</code> post-processor uses tornado to forward requests to the CDN if and only if local Reveal.js is unavailable (PR merged <a href="https://github.com/ipython/ipython/pull/4048">here</a>, thanks <strong>MinRK</strong>). So, just locate the <code>reveal.js</code> in the same directory as your talk.slides.html lives and run (as usually):</p>
<p><code>ipython nbconvert talk.ipynb --to slides --post serve</code></p>
<p>You can also point to another directory using the <code>--reveal-prefix</code> alias, ie:</p>
<p><code>ipython nbconvert talk.ipynb --to slides --post serve --reveal-prefix foo/reveal.js</code></p>
<p>Hope it helps.</p>
<p>Damián.</p>
</div>
4 changes: 3 additions & 1 deletion output/2013/09/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@
<h1>Posts for September 2013</h1>
<ul class="unstyled">

<li><a href="../../posts/different-ways-to-lead-an-open-source-project.html">[2013-09-13 01:40] Different ways to lead an open source project</a>
<li><a href="../../posts/using-a-local-revealjs-library-with-your-ipython-slides.html">[2013-09-13 18:50] Using a local Reveal.js library with your IPython slides.</a>

</li><li><a href="../../posts/different-ways-to-lead-an-open-source-project.html">[2013-09-13 01:40] Different ways to lead an open source project</a>

</li><li><a href="../../posts/a-new-nikolas-theme-for-my-site-zen.html">[2013-09-09 21:10] A new Nikola's theme for my site: Zen</a>

Expand Down
2 changes: 1 addition & 1 deletion output/assets/js/tag_cloud_data.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"family": [2, "/categories/family.html"], "less": [1, "/categories/less.html"], "zen": [1, "/categories/zen.html"], "gh-pages": [1, "/categories/gh-pages.html"], "IPython": [16, "/categories/ipython.html"], "zenmode": [1, "/categories/zenmode.html"], "talks": [1, "/categories/talks.html"], "politics": [1, "/categories/politics.html"], "nikola": [10, "/categories/nikola.html"], "git": [1, "/categories/git.html"], "blog": [6, "/categories/blog.html"], "flood": [1, "/categories/flood.html"], "theme": [1, "/categories/theme.html"], "nbconvert": [7, "/categories/nbconvert.html"], "vIPer": [3, "/categories/viper.html"], "tutorials": [1, "/categories/tutorials.html"], "css": [1, "/categories/css.html"], "opensource": [1, "/categories/opensource.html"], "life": [2, "/categories/life.html"], "python": [18, "/categories/python.html"], "javascript": [1, "/categories/javascript.html"], "SciPyCon": [1, "/categories/scipycon.html"], "slideshow": [3, "/categories/slideshow.html"], "first_post": [1, "/categories/first_post.html"], "reveal": [4, "/categories/reveal.html"], "Facundo": [2, "/categories/facundo.html"], "extension": [1, "/categories/extension.html"], "pdf": [1, "/categories/pdf.html"]}
{"family": [2, "/categories/family.html"], "less": [1, "/categories/less.html"], "zen": [1, "/categories/zen.html"], "gh-pages": [1, "/categories/gh-pages.html"], "IPython": [17, "/categories/ipython.html"], "zenmode": [1, "/categories/zenmode.html"], "talks": [1, "/categories/talks.html"], "politics": [1, "/categories/politics.html"], "nikola": [10, "/categories/nikola.html"], "git": [1, "/categories/git.html"], "blog": [6, "/categories/blog.html"], "flood": [1, "/categories/flood.html"], "theme": [1, "/categories/theme.html"], "nbconvert": [8, "/categories/nbconvert.html"], "vIPer": [3, "/categories/viper.html"], "tutorials": [1, "/categories/tutorials.html"], "local": [1, "/categories/local.html"], "css": [1, "/categories/css.html"], "opensource": [1, "/categories/opensource.html"], "life": [2, "/categories/life.html"], "python": [19, "/categories/python.html"], "javascript": [1, "/categories/javascript.html"], "SciPyCon": [1, "/categories/scipycon.html"], "slideshow": [4, "/categories/slideshow.html"], "connectivity": [1, "/categories/connectivity.html"], "first_post": [1, "/categories/first_post.html"], "reveal": [5, "/categories/reveal.html"], "Facundo": [2, "/categories/facundo.html"], "extension": [1, "/categories/extension.html"], "pdf": [1, "/categories/pdf.html"]}
2 changes: 1 addition & 1 deletion output/categories/blog.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Damian's blog (blog)</title><link>http://www.damian.oquanta.info/</link><description>My place to share some thoughts with the world.</description><atom:link href="http://www.damian.oquanta.info/categories/blog.xml" type="application/rss+xml" rel="self"></atom:link><lastBuildDate>Fri, 13 Sep 2013 01:43:28 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A new Nikola's theme for my site: Zen</title><link>http://www.damian.oquanta.info//posts/a-new-nikolas-theme-for-my-site-zen.html</link><description>&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Damian's blog (blog)</title><link>http://www.damian.oquanta.info/</link><description>My place to share some thoughts with the world.</description><atom:link href="http://www.damian.oquanta.info/categories/blog.xml" type="application/rss+xml" rel="self"></atom:link><lastBuildDate>Fri, 13 Sep 2013 18:54:34 GMT</lastBuildDate><generator>nikola</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A new Nikola's theme for my site: Zen</title><link>http://www.damian.oquanta.info//posts/a-new-nikolas-theme-for-my-site-zen.html</link><description>&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;Some days ago, &lt;a href="https://plus.google.com/106780152352450272697/about"&gt;Aru Sahni&lt;/a&gt; wrote to &lt;a href="https://groups.google.com/forum/#!forum/nikola-discuss"&gt;Nikola's&lt;/a&gt; forum and posted a link to his site... I really like the theme he was using so I though to take it as a starting point to develop my own theme. &lt;/p&gt;&lt;p class="more"&gt;&lt;a href="http://www.damian.oquanta.info//posts/a-new-nikolas-theme-for-my-site-zen.html"&gt;Read more…&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>python</category><category>blog</category><category>zen</category><category>theme</category><category>less</category><category>nikola</category><category>IPython</category><guid>http://www.damian.oquanta.info//posts/a-new-nikolas-theme-for-my-site-zen.html</guid><pubDate>Mon, 09 Sep 2013 21:10:18 GMT</pubDate></item><item><title>One line deployment of your site to gh-pages</title><link>http://www.damian.oquanta.info//posts/one-line-deployment-of-your-site-to-gh-pages.html</link><description>&lt;div class="text_cell_render border-box-sizing rendered_html"&gt;
&lt;p&gt;Do you want to &lt;strong&gt;easily&lt;/strong&gt; deploy your site to Github pages?&lt;/p&gt;
&lt;p&gt;OK, here we go...&lt;/p&gt;
Expand Down
Loading

0 comments on commit 29f24b1

Please sign in to comment.