Skip to content

Commit

Permalink
Publish PyConFR slides.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Sep 17, 2012
1 parent 65769b4 commit 1db6e9d
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 23 deletions.
2 changes: 1 addition & 1 deletion exyr/__init__.py
Expand Up @@ -115,7 +115,7 @@ def stylesheet():
return app.response_class(css, mimetype='text/css') return app.response_class(css, mimetype='text/css')




STATIC_EXTENSIONS = ('.jpg', '.png', '.html', '.css', '.pdf') STATIC_EXTENSIONS = ('.jpg', '.png', '.svg', '.html', '.css', '.pdf')


# the repr() of a tuple matches the micro-syntax used by `any` # the repr() of a tuple matches the micro-syntax used by `any`
# http://werkzeug.pocoo.org/documentation/dev/routing.html#werkzeug.routing.AnyConverter # http://werkzeug.pocoo.org/documentation/dev/routing.html#werkzeug.routing.AnyConverter
Expand Down
12 changes: 10 additions & 2 deletions exyr/pages/2012/weasyprint-at-pyconfr.markdown
Expand Up @@ -10,8 +10,7 @@ summary: |
I’ll be at PyConFR in Paris this weekend, September 15th and 16th. I’ll be at PyConFR in Paris this weekend, September 15th and 16th.
I’ll be [giving a talk](http://www.pycon.fr/2012/schedule/presentation/16/) I’ll be [giving a talk](http://www.pycon.fr/2012/schedule/presentation/16/)
Sunday 16th at noon, on [WeasyPrint](http://weasyprint.org/) and CSS for print. Sunday 16th at noon, on [WeasyPrint](http://weasyprint.org/) and CSS for print.
The talk will be in French, but the slides in English. I’ll post them here I’ll post the slides here afterwards.
afterwards.


See you there! See you there!


Expand All @@ -25,3 +24,12 @@ make it look nice on A4. You can regenerate the same PDF with:
:::sh :::sh
weasyprint http://www.pycon.fr/2012/schedule/ PyConFR_2012_schedule.pdf \ weasyprint http://www.pycon.fr/2012/schedule/ PyConFR_2012_schedule.pdf \
-s http://exyr.org/2012/weasyprint-at-pyconfr/print.css -s http://exyr.org/2012/weasyprint-at-pyconfr/print.css

**Update 2012-09-17**:
I think the talk was a success although I forgot a few details. The slides
are below (or <a href="embedder.html#slides.html">fullscreen</a>), with notes
paraphrasing what I said “on stage”.

<iframe
src="embedder.html#slides.html"
width="736" height="750" style="border: 2px solid black"></iframe>
Binary file not shown.
45 changes: 32 additions & 13 deletions exyr/pages/2012/weasyprint-at-pyconfr/embedder.html
Expand Up @@ -6,6 +6,9 @@
<div id="slides"> <div id="slides">
<iframe allowfullscreen mozallowfullscreen webkitallowfullscreen></iframe> <iframe allowfullscreen mozallowfullscreen webkitallowfullscreen></iframe>
</div> </div>
<div id="notes">
<p id="content"></p>
</div>
<div id="controls"> <div id="controls">
<button title="prev" id="back" onclick="Dz.back()">&#9664;</button> <button title="prev" id="back" onclick="Dz.back()">&#9664;</button>
<button title="next" id="forward" onclick="Dz.forward()">&#9654;</button> <button title="next" id="forward" onclick="Dz.forward()">&#9654;</button>
Expand All @@ -23,7 +26,7 @@
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
#slides, #controls { #slides, #controls, #notes {
left: 0; left: 0;
position: absolute; position: absolute;
right: 0; right: 0;
Expand All @@ -36,9 +39,21 @@
padding: 5px; padding: 5px;
} }
#slides { #slides {
bottom: 40px; bottom: 206px;
top: 0; top: 0;
} }
#notes {
bottom: 40px;
height: 150px;

background: #EEE;
color: #444;
padding: 0 20px;
overflow: auto;
font: 25px sans-serif;
border: 8px solid #555;
border-style: solid none;
}
iframe { iframe {
border: none; border: none;
background-color: white; background-color: white;
Expand Down Expand Up @@ -98,11 +113,11 @@
count: null, count: null,
iframe: null iframe: null
}; };

Dz.init = function() { Dz.init = function() {
this.loadIframe(); this.loadIframe();
} }

Dz.onkeydown = function(aEvent) { Dz.onkeydown = function(aEvent) {
// Don't intercept keyboard shortcuts // Don't intercept keyboard shortcuts
if (aEvent.altKey if (aEvent.altKey
Expand Down Expand Up @@ -142,13 +157,14 @@
this.goFullscreen(); this.goFullscreen();
} }
} }

Dz.onmessage = function(aEvent) { Dz.onmessage = function(aEvent) {
if (aEvent.source === this.view) { if (aEvent.source === this.view) {
var argv = aEvent.data.split(" "), argc = argv.length; var argv = aEvent.data.split(" "), argc = argv.length;
argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) }); argv.forEach(function(e, i, a) { a[i] = decodeURIComponent(e) });
if (argv[0] === "CURSOR" && argc === 2) { if (argv[0] === "CURSOR" && argc === 2) {
var cursor = argv[1].split("."); var cursor = argv[1].split(".");
this.postMsg(this.view, "GET_NOTES");
this.idx = ~~cursor[0]; this.idx = ~~cursor[0];
this.step = ~~cursor[1]; this.step = ~~cursor[1];
$("#slideidx").value = this.idx; $("#slideidx").value = this.idx;
Expand All @@ -159,11 +175,14 @@
$("#slidecount").innerHTML = this.count = argv[2]; $("#slidecount").innerHTML = this.count = argv[2];
document.title = argv[1]; document.title = argv[1];
} }
if (argv[0] === "NOTES" && argc === 2) {
$("#notes > #content").innerHTML = this.notes = argv[1];
}
} }
} }

/* Get url from hash or prompt and store it */ /* Get url from hash or prompt and store it */

Dz.getUrl = function() { Dz.getUrl = function() {
var u = window.location.hash.split("#")[1]; var u = window.location.hash.split("#")[1];
if (!u) { if (!u) {
Expand All @@ -179,7 +198,7 @@
} }
return u; return u;
} }

Dz.loadIframe = function() { Dz.loadIframe = function() {
this.iframe = $("iframe"); this.iframe = $("iframe");
this.iframe.src = this.url = this.getUrl(); this.iframe.src = this.url = this.getUrl();
Expand All @@ -188,15 +207,15 @@
Dz.postMsg(Dz.view, "REGISTER"); Dz.postMsg(Dz.view, "REGISTER");
} }
} }

Dz.toggleContent = function() { Dz.toggleContent = function() {
this.postMsg(this.view, "TOGGLE_CONTENT"); this.postMsg(this.view, "TOGGLE_CONTENT");
} }

Dz.onhashchange = function() { Dz.onhashchange = function() {
this.loadIframe(); this.loadIframe();
} }

Dz.back = function() { Dz.back = function() {
this.postMsg(this.view, "BACK"); this.postMsg(this.view, "BACK");
} }
Expand Down Expand Up @@ -225,7 +244,7 @@
window.open(this.url + "#" + this.idx, '', 'width=800,height=600,personalbar=0,toolbar=0,scrollbars=1,resizable=1'); window.open(this.url + "#" + this.idx, '', 'width=800,height=600,personalbar=0,toolbar=0,scrollbars=1,resizable=1');
} }
} }

Dz.postMsg = function(aWin, aMsg) { // [arg0, [arg1...]] Dz.postMsg = function(aWin, aMsg) { // [arg0, [arg1...]]
aMsg = [aMsg]; aMsg = [aMsg];
for (var i = 2; i < arguments.length; i++) for (var i = 2; i < arguments.length; i++)
Expand All @@ -249,7 +268,7 @@
Function.prototype.bind = function (oThis) { Function.prototype.bind = function (oThis) {


// closest thing possible to the ECMAScript 5 internal IsCallable // closest thing possible to the ECMAScript 5 internal IsCallable
// function // function
if (typeof this !== "function") if (typeof this !== "function")
throw new TypeError( throw new TypeError(
"Function.prototype.bind - what is trying to be fBound is not callable" "Function.prototype.bind - what is trying to be fBound is not callable"
Expand Down
20 changes: 13 additions & 7 deletions exyr/pages/2012/weasyprint-at-pyconfr/slides.html
Expand Up @@ -53,7 +53,7 @@ <h2>Flask</h2>
</section> </section>


<section> <section>
<h2>Flask-WeasyPrint</h2> <h2>Flask-WeasyPrint (<a href="frozen_demo/foo/index.html">demo</a>)</h2>
<pre><code <pre><code
>from flask_weasyprint import render_pdf >from flask_weasyprint import render_pdf
<span style="color: #888">from flask import Flask <span style="color: #888">from flask import Flask
Expand All @@ -66,7 +66,6 @@ <h2>Flask-WeasyPrint</h2>
@app.route("/hello.pdf") @app.route("/hello.pdf")
def hello_pdf(): def hello_pdf():
return render_pdf("/hello")</code></pre> return render_pdf("/hello")</code></pre>
<!-- TODO: uncomment <p><a href="frozen_demo/foo/index.html">Demo</a></p>-->
<details> <details>
Once you have that, PDF is easy.<br> Once you have that, PDF is easy.<br>
WeasyPrint: like the <em>print</em> function of your browser, but with WeasyPrint: like the <em>print</em> function of your browser, but with
Expand Down Expand Up @@ -145,11 +144,9 @@ <h2>Features</h2>
<section> <section>
<h2>Examples</h2> <h2>Examples</h2>
<p><a href="PyConFR_2012_schedule.pdf">PyConFR 2012 schedule</a></p> <p><a href="PyConFR_2012_schedule.pdf">PyConFR 2012 schedule</a></p>
<p> <p><a href="http://weasyprint.org/samples/CSS21-intro.pdf">
<!-- TODO: switch back to the absolute URL before uploading. CSS 2.1 intro</a></p>
<a href="http://weasyprint.org/samples/CSS21-intro.pdf">--> <p><a href="http://weasyprint.org/#acid2">Acid2</a>
<a href="CSS21-intro.pdf">CSS 2.1 intro</a></p>
<p><a href="http://www.webstandards.org/files/acid2/test.html">Acid2</a>
<img src=images/acid2-small.png <img src=images/acid2-small.png
style="vertical-align: middle; margin: 0 3em 0 .5em"></p> style="vertical-align: middle; margin: 0 3em 0 .5em"></p>
<details> <details>
Expand Down Expand Up @@ -295,6 +292,12 @@ <h2><code>import weasyprint</code></h2>
<li>BSD license</li> <li>BSD license</li>
</ul> </ul>
<details> <details>
In spite of CSS’s inherent complexity, we try to keep the engine
simple. (Especially compared to a Gecko or a WebKit.)<br>
Python 2 & 3 with the same code base. Not using
<a href="http://pypi.python.org/pypi/six">six</a>,
but a custom 100-lines <code>compat.py</code> file.<br>
It’s open source and free software.
</details> </details>
</section> </section>


Expand All @@ -307,6 +310,9 @@ <h2>Questions?</h2>
<a href="http://community.kozea.fr/">community.kozea.fr</a><br> <a href="http://community.kozea.fr/">community.kozea.fr</a><br>
IRC: ##kozea @ Freenode IRC: ##kozea @ Freenode
</footer> </footer>
<details>
Come and chat with us!
</details>
</section> </section>


<script src="prism.js"></script> <script src="prism.js"></script>
Expand Down

0 comments on commit 1db6e9d

Please sign in to comment.