summaryrefslogtreecommitdiff
path: root/slides/final/scripts/md
diff options
context:
space:
mode:
Diffstat (limited to 'slides/final/scripts/md')
-rw-r--r--slides/final/scripts/md/README.md5
-rw-r--r--slides/final/scripts/md/base.html101
-rwxr-xr-xslides/final/scripts/md/render.py57
-rw-r--r--slides/final/scripts/md/slides.md251
4 files changed, 414 insertions, 0 deletions
diff --git a/slides/final/scripts/md/README.md b/slides/final/scripts/md/README.md
new file mode 100644
index 0000000..3188b3f
--- /dev/null
+++ b/slides/final/scripts/md/README.md
@@ -0,0 +1,5 @@
1### Want to use markdown to write your slides?
2
3`python render.py` can do that for you.
4
5Dependencies: jinja2, markdown.
diff --git a/slides/final/scripts/md/base.html b/slides/final/scripts/md/base.html
new file mode 100644
index 0000000..5e01a30
--- /dev/null
+++ b/slides/final/scripts/md/base.html
@@ -0,0 +1,101 @@
1<!--
2Google IO 2012 HTML5 Slide Template
3
4Authors: Eric Bidelman <ebidel@gmail.com>
5Luke Mahe <lukem@google.com>
6
7URL: https://code.google.com/p/io-2012-slides
8-->
9<!DOCTYPE html>
10<html>
11 <head>
12 <title>Google IO 2012</title>
13 <meta charset="utf-8">
14 <meta http-equiv="X-UA-Compatible" content="chrome=1">
15 <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">-->
16 <!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
17 <!--This one seems to work all the time, but really small on ipad-->
18 <!--<meta name="viewport" content="initial-scale=0.4">-->
19 <meta name="apple-mobile-web-app-capable" content="yes">
20 <link rel="stylesheet" media="all" href="theme/css/default.css">
21 <link rel="stylesheet" media="all" href="theme/css/app.css">
22 <link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="theme/css/phone.css">
23 <base target="_blank">
24 <!-- This amazingness opens all links in a new tab. -->
25 <script data-main="js/slides" src="js/require.js"></script>
26 </head>
27 <body style="opacity: 0">
28
29 <slides class="layout-widescreen">
30
31 <!-- <slide class="logoslide nobackground">
32 <article class="flexbox vcenter">
33 <span><img src="images/google_developers_logo.png"></span>
34 </article>
35 </slide>
36 -->
37 <slide class="title-slide segue nobackground">
38 <aside class="gdbar"><img src="images/google_developers_icon_128.png">
39 </aside>
40 <!-- The content of this hgroup is replaced programmatically through the slide_config.json. -->
41 <hgroup class="auto-fadein">
42 <h1 data-config-title><!-- populated from slide_config.json --></h1>
43 <h2 data-config-subtitle><!-- populated from slide_config.json --></h2>
44 <p data-config-presenter>
45 <!-- populated from slide_config.json -->
46 </p>
47 </hgroup>
48 </slide>
49
50 {% for slide in slides %}
51 <slide {% if slide.class %}class="{{- slide.class -}}"{% endif %} {% if slide.image %}style="background-image: url({{- slide.image -}})"{% endif %}>
52 {% if 'segue' in slide.class %}
53 <aside class="gdbar"><img src="images/google_developers_icon_128.png">
54 </aside>
55 <hgroup class="auto-fadein">
56 <h2>{{- slide.title -}}</h2>
57 <h3>{{- slide.subtitle -}}</h3>
58 </hgroup>
59 {% else %}
60 <hgroup>
61 <h2>{{- slide.title -}}</h2>
62 <h3>{{- slide.subtitle -}}</h3>
63 </hgroup>
64 <article {% if slide.content_class %}class="{{- slide.content_class -}}"{% endif %}>
65 {{- slide.content -}}
66 </article>
67 {% endif %}
68 </slide>
69 {% endfor %}
70
71 <slide class="logoslide dark nobackground">
72 <article class="flexbox vcenter">
73 <span><img src="images/ESIEE_Paris_logo_white.png"></span>
74 </article>
75 </slide>
76
77 <slide class="backdrop"></slide>
78
79 </slides>
80
81 <script>
82 var _gaq = _gaq || [];
83 _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']);
84 _gaq.push(['_trackPageview']);
85
86 (function() {
87 var ga = document.createElement('script');
88 ga.type = 'text/javascript';
89 ga.async = true;
90 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
91 var s = document.getElementsByTagName('script')[0];
92 s.parentNode.insertBefore(ga, s);
93 })();
94 </script>
95
96 <!--[if IE]>
97 <script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
98 <script>CFInstall.check({mode: 'overlay'});</script>
99 <![endif]-->
100 </body>
101</html>
diff --git a/slides/final/scripts/md/render.py b/slides/final/scripts/md/render.py
new file mode 100755
index 0000000..a035b90
--- /dev/null
+++ b/slides/final/scripts/md/render.py
@@ -0,0 +1,57 @@
1#!/usr/bin/env python
2
3import codecs
4import re
5import jinja2
6import markdown
7
8def process_slides():
9 with codecs.open('../../presentation-output.html', 'w', encoding='utf8') as outfile:
10 md = codecs.open('slides.md', encoding='utf8').read()
11 md_slides = md.split('\n---\n')
12 print 'Compiled %s slides.' % len(md_slides)
13
14 slides = []
15 # Process each slide separately.
16 for md_slide in md_slides:
17 slide = {}
18 sections = md_slide.split('\n\n')
19 # Extract metadata at the beginning of the slide (look for key: value)
20 # pairs.
21 metadata_section = sections[0]
22 metadata = parse_metadata(metadata_section)
23 slide.update(metadata)
24 remainder_index = metadata and 1 or 0
25 # Get the content from the rest of the slide.
26 content_section = '\n\n'.join(sections[remainder_index:])
27 html = markdown.markdown(content_section)
28 slide['content'] = postprocess_html(html, metadata)
29
30 slides.append(slide)
31
32 template = jinja2.Template(open('base.html').read())
33
34 outfile.write(template.render(locals()))
35
36def parse_metadata(section):
37 """Given the first part of a slide, returns metadata associated with it."""
38 metadata = {}
39 metadata_lines = section.split('\n')
40 for line in metadata_lines:
41 colon_index = line.find(':')
42 if colon_index != -1:
43 key = line[:colon_index].strip()
44 val = line[colon_index + 1:].strip()
45 metadata[key] = val
46
47 return metadata
48
49def postprocess_html(html, metadata):
50 """Returns processed HTML to fit into the slide template format."""
51 if metadata.get('build_lists') and metadata['build_lists'] == 'true':
52 html = html.replace('<ul>', '<ul class="build">')
53 html = html.replace('<ol>', '<ol class="build">')
54 return html
55
56if __name__ == '__main__':
57 process_slides()
diff --git a/slides/final/scripts/md/slides.md b/slides/final/scripts/md/slides.md
new file mode 100644
index 0000000..e6a605e
--- /dev/null
+++ b/slides/final/scripts/md/slides.md
@@ -0,0 +1,251 @@
1title: Sommaire
2class: big
3#build_lists: true
4
5<br><br>
6
7Sera abordé durant cette présentation :
8
9- Objectifs dégagés
10- Fonctionnalités actuelles
11- Problèmes rencontrés
12- Solutions mises en application
13- Fonctionnalités planifiées
14
15
16<aside class="note">
17<pre>
18Les notes s'afficheront ici
19
20On commence par : Timothée !
21</pre>
22</aside>
23
24---
25
26title: Objectifs dégagés
27class: segue dark nobackground
28
29---
30
31title: Objectifs dégagés
32subtitle: Cahier des charges
33
34But :
35
36- Jouer une mélodie à l'aide d'un générateur de fonctions
37
38<br>
39
40Moyens :
41
42- Générateur de fonctions
43- Logiciel de programmation graphique Labview
44
45
46<aside class="note">
47<pre>
48
49</pre>
50</aside>
51
52---
53
54title: Fonctionnalités actuelles
55class: segue dark nobackground
56
57
58<aside class="note">
59<pre>