first import book
This commit is contained in:
parent
6be2701fd8
commit
dfd9c869d5
233 changed files with 47797 additions and 0 deletions
20
book/LICENSE
Normal file
20
book/LICENSE
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2014 RunestoneInteractive
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
105
book/README.rst
Normal file
105
book/README.rst
Normal file
|
|
@ -0,0 +1,105 @@
|
||||||
|
RunestoneTools
|
||||||
|
==============
|
||||||
|
|
||||||
|
Packaging of the Runestone tools for publishing educational materials using github pages
|
||||||
|
|
||||||
|
During January 2014 I switched my personal blog to OctoPress. This inspired me in many ways. First to try to blog more often, but more importantly to think about how the Runestone Toolset could be more easily used and deployed by people who didn't want to mess around with hosting, and setting up web2py servers, etc. This new project is the first phase of that inspiration.
|
||||||
|
|
||||||
|
Prerequisites
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The following three prerequisites are easily installed using pip. All are either Python2.x or 3.x compatible.
|
||||||
|
|
||||||
|
1. Install Spinx
|
||||||
|
2. Install Paver
|
||||||
|
3. Install paverutils
|
||||||
|
|
||||||
|
|
||||||
|
First, get `Sphinx <http://sphinx.pocoo.org>`_, version 1.2.x is current as of this writing:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# pip install sphinx
|
||||||
|
|
||||||
|
Install `paver <http://paver.github.io/paver/>`_, at least version 1.2.0:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# pip install paver
|
||||||
|
|
||||||
|
|
||||||
|
Once paver is installed you will also need to install sphinxcontrib-paverutils, at least version 1.5:
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
# pip install sphinxcontrib-paverutils
|
||||||
|
|
||||||
|
Quick Start
|
||||||
|
-----------
|
||||||
|
|
||||||
|
This guide will get you started with creating your own course materials using the Runestone tools.
|
||||||
|
|
||||||
|
1. Clone the RunestoneTools repository to your development machine ``git clone https://github.com/RunestoneInteractive/RunestoneTools.git``
|
||||||
|
|
||||||
|
2. Copy conf.py.prototype to conf.py You should not need to make any edits to get the basics working.
|
||||||
|
|
||||||
|
2. Type the command ``paver build``
|
||||||
|
|
||||||
|
You will now have a build folder with a file index.html in it, along with some default content. The contents of the build folder are suitable for hosting anywhere that you can serve static web content from! For a small class you could even serve the content using the builtin Python webserver.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
$ cd build
|
||||||
|
$ python3 -m http.server
|
||||||
|
|
||||||
|
Now from your browser you can open up http://localhost:8000/index.html
|
||||||
|
|
||||||
|
Running your own web server isn't always the easiest way to go. So I have provided a couple of commands to make it easy for you to host your materials using githubs Pages feature.
|
||||||
|
|
||||||
|
|
||||||
|
#. Create a repository (if you don't already have one where you would like to host the finished product) Copy the github URL to your clipboard.
|
||||||
|
|
||||||
|
#. Type the command ``paver setup_github_pages`` You will be prompted to paste in the URL to your repository.
|
||||||
|
|
||||||
|
#. Type the command ``paver deploy``
|
||||||
|
|
||||||
|
#. Now you can access your pages from github at http://username.github.io/repo where username is your github username, and repo is the repository you created to host your deployed pages. Note that the deployed pages will be on the branch ``gh-pages``
|
||||||
|
|
||||||
|
Details
|
||||||
|
~~~~~~~
|
||||||
|
|
||||||
|
If you want to know the details of what goes on in the paver commands above here is what is happening:
|
||||||
|
|
||||||
|
#. paver build -- creates build directory and html files
|
||||||
|
#. cd build
|
||||||
|
#. git init
|
||||||
|
#. git remote add origin git@github.com:bnmnetp/deploytest.git
|
||||||
|
#. git checkout -b gh-pages
|
||||||
|
#. git touch .nojekyll
|
||||||
|
#. git add .nojekyll
|
||||||
|
#. git add .
|
||||||
|
#. git commit -m 'first published version'
|
||||||
|
#. git push origin gh-pages
|
||||||
|
|
||||||
|
Now wait a few minutes and go to http://username.github.io/yourRepo
|
||||||
|
|
||||||
|
You should see an example page.
|
||||||
|
|
||||||
|
Work in Progress
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Here's what is on the todo list for this project. If you have the inclination to help out please let me know, I would welcome the help.
|
||||||
|
|
||||||
|
Slides
|
||||||
|
~~~~~~
|
||||||
|
|
||||||
|
I am currently working on getting hieroglyph integrated so that you can make presentation slides with Runestone Interactive features. At the moment, some of the tools work and some do not. Activecode works OK, multiple choice questions work fine, reveals work fine, but CodeLens does not work and neither do parsons problems. Some things make more sense to work in slide mode than others. In particular getting CodeLens to work nicely would be valuable. I'll keep working on it. If you want to give it a try yourself. Install ``pip install hieroglyph``, and uncomment the line in your conf.py file that adds heiroglyph to the extension list. To build slides you need to run ``paver build --slides``. There is much that could be done in terms of styling, and working out some problems with javascript. Standard Sphinx loads all the js files up front, whereas the template for slides moves javscript loading to the bottom of the page. This appears to be the root of most problems. In addition the directives themselves for some could be updated to provide a better layout when generating slides instead of html.
|
||||||
|
|
||||||
|
I'm not even sure whether this particular little project should be a high priority, I thought everything might just work, but then it didn't. So, I spent a day hacking at it until I realized it was much more work than I thought.
|
||||||
|
|
||||||
|
|
||||||
|
Login/Logout
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Currently you cannot have your students login to any resources you build and host yourself or on github. This is a problem that probably will not get fixed until later this semester or even this summer when I have more time to work on the back end. This has to do with the way that most web frameworks (including web2py) use session cookies to track login/logout. Given the current architecture of the tools it makes sense to go away from cookies anyway.
|
||||||
|
|
||||||
BIN
book/_images/aapssfc.png
Normal file
BIN
book/_images/aapssfc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
6297
book/_images/aapssfc.svg
Normal file
6297
book/_images/aapssfc.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 548 KiB |
135
book/_sources/index.rst
Normal file
135
book/_sources/index.rst
Normal file
|
|
@ -0,0 +1,135 @@
|
||||||
|
|
||||||
|
.. © 2015 Johann Dreo
|
||||||
|
|
||||||
|
.. |br| raw:: html
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
=================================================
|
||||||
|
Apprendre à programmer |br| (sans se faire chier)
|
||||||
|
=================================================
|
||||||
|
|
||||||
|
.. image:: ../_images/aapssfc.png
|
||||||
|
:scale: 30%
|
||||||
|
:alt: The grumpy cat loves you
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
############
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
principes
|
||||||
|
introduction
|
||||||
|
python
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Exemples par difficulté
|
||||||
|
#######################
|
||||||
|
|
||||||
|
.. Seul chapitre avec un niveau de TOC de 2
|
||||||
|
|
||||||
|
Jeux simples
|
||||||
|
============
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
nombre
|
||||||
|
pendu
|
||||||
|
|
||||||
|
Jeux de tableau
|
||||||
|
===============
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Exemples par domaine
|
||||||
|
####################
|
||||||
|
|
||||||
|
Simulation
|
||||||
|
==========
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
mounty_hall
|
||||||
|
|
||||||
|
Dessin procédural
|
||||||
|
=================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
Intelligence artificielle
|
||||||
|
=========================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
pendu
|
||||||
|
|
||||||
|
Système
|
||||||
|
=======
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
Sécurité et réseaux
|
||||||
|
===================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Exemples par concept
|
||||||
|
####################
|
||||||
|
|
||||||
|
Boucles imbriquées
|
||||||
|
==================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
Récursivité
|
||||||
|
===========
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
|
||||||
|
Aléatoire
|
||||||
|
=========
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
mounty_hall
|
||||||
|
|
||||||
|
Graphes
|
||||||
|
=======
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Exemples par approche
|
||||||
|
#####################
|
||||||
|
|
||||||
|
Programmation impérative
|
||||||
|
========================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
nombre
|
||||||
|
mounty_hall
|
||||||
|
|
||||||
|
|
||||||
|
Programmation fonctionnelle
|
||||||
|
===========================
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
|
||||||
|
pendu
|
||||||
|
|
||||||
|
Programmation Objet
|
||||||
|
===================
|
||||||
|
.. toctree::
|
||||||
|
|
||||||
|
|
||||||
11
book/_sources/introduction.rst
Normal file
11
book/_sources/introduction.rst
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
Qu'est-ce que l'informatique ?
|
||||||
|
==============================
|
||||||
|
|
||||||
|
Qu'est-ce qu'un ordinateur ?
|
||||||
|
----------------------------
|
||||||
|
|
||||||
|
Qu'est-ce que la programmation ?
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
10
book/_sources/mounty_hall.rst
Normal file
10
book/_sources/mounty_hall.rst
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
Mounty Hall
|
||||||
|
-----------
|
||||||
|
|
||||||
|
La chèvres et la voiture
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
L'informatique au secours du cerveau
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
9
book/_sources/nombre.rst
Normal file
9
book/_sources/nombre.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
Avec un nombre
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Devine un nombre
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Pense à un nombre
|
||||||
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
9
book/_sources/pendu.rst
Normal file
9
book/_sources/pendu.rst
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
Le pendu
|
||||||
|
--------
|
||||||
|
|
||||||
|
Jouer au pendu
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
IA du pendu
|
||||||
|
^^^^^^^^^^^
|
||||||
7
book/_sources/principes.rst
Normal file
7
book/_sources/principes.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
Principes de ce livre
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
Conventions utilisées
|
||||||
|
---------------------
|
||||||
|
|
||||||
40
book/_sources/python.rst
Normal file
40
book/_sources/python.rst
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
|
||||||
|
Bases de Python
|
||||||
|
===============
|
||||||
|
|
||||||
|
Une calculette
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Branchement conditionnel : `if`
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
Boucles : `for` et `while`
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
Fonctions
|
||||||
|
---------
|
||||||
|
|
||||||
|
Listes
|
||||||
|
------
|
||||||
|
|
||||||
|
Dictionnaires
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Mise en forme du texte
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Modules
|
||||||
|
-------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.. activecode:: example2
|
||||||
|
..
|
||||||
|
.. import turtle
|
||||||
|
.. t = turtle.Turtle()
|
||||||
|
..
|
||||||
|
.. for i in range(4):
|
||||||
|
.. t.forward(100)
|
||||||
|
.. t.right(90)
|
||||||
|
|
||||||
|
|
||||||
13
book/_templates/runestone_slides/console.html
Normal file
13
book/_templates/runestone_slides/console.html
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
{% extends "layout.html" %}
|
||||||
|
|
||||||
|
{% block header %}
|
||||||
|
<section id="controls">
|
||||||
|
<a href="" id="prev">prev</a>
|
||||||
|
<span id="cur_slide_num"></span> / <span id="num_slides"></span>
|
||||||
|
<a href="" id="next">next</a>
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{%- block slide_container_class %}table{%- endblock %}
|
||||||
|
|
||||||
|
{%- block presenter_notes %}<div class="presenter_notes" id="presenter_notes">notes go here</div>{% endblock %}
|
||||||
171
book/_templates/runestone_slides/layout.html
Normal file
171
book/_templates/runestone_slides/layout.html
Normal file
|
|
@ -0,0 +1,171 @@
|
||||||
|
{#
|
||||||
|
basic/layout.html
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Master layout template for Sphinx themes.
|
||||||
|
|
||||||
|
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
|
||||||
|
:license: BSD, see LICENSE for details.
|
||||||
|
#}
|
||||||
|
{%- block doctype -%}
|
||||||
|
<!DOCTYPE html>
|
||||||
|
{%- endblock %}
|
||||||
|
{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
|
||||||
|
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
|
||||||
|
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
|
||||||
|
(sidebars != []) %}
|
||||||
|
{%- set url_root = pathto('', 1) %}
|
||||||
|
{# XXX necessary? #}
|
||||||
|
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
|
||||||
|
{%- if not embedded and docstitle %}
|
||||||
|
{%- set titlesuffix = " — "|safe + docstitle|e %}
|
||||||
|
{%- else %}
|
||||||
|
{%- set titlesuffix = "" %}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
{%- macro relbar() %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{%- macro sidebar() %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{%- macro script() %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
var DOCUMENTATION_OPTIONS = {
|
||||||
|
URL_ROOT: '{{ url_root }}',
|
||||||
|
VERSION: '{{ release|e }}',
|
||||||
|
COLLAPSE_INDEX: false,
|
||||||
|
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||||
|
HAS_SOURCE: {{ has_source|lower }}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
{%- for scriptfile in script_files %}
|
||||||
|
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
|
||||||
|
{%- endfor %}
|
||||||
|
{% if theme_custom_js %}
|
||||||
|
<script type="text/javascript" src="{{ pathto('_static/' + theme_custom_js, 1) }}"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
{%- macro css() %}
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/basic.css', 1) }}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/styles.css', 1) }}" type="text/css" />
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
|
||||||
|
{% if theme_custom_css %}
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/' + theme_custom_css, 1) }}" type="text/css" />
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
|
||||||
|
{%- for cssfile in css_files %}
|
||||||
|
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
|
||||||
|
{%- endfor %}
|
||||||
|
{%- endmacro %}
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
|
||||||
|
{{ metatags }}
|
||||||
|
{%- block htmltitle %}
|
||||||
|
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
|
||||||
|
{%- endblock %}
|
||||||
|
{{ css() }}
|
||||||
|
<script type="text/javascript" src="_static/jquery.js" />
|
||||||
|
<script type="text/javascript" src="_static/parsons.js" />
|
||||||
|
<script type="text/javascript" src="_static/parsons-noconflict.js" />
|
||||||
|
{%- if not embedded %}
|
||||||
|
{%- if use_opensearch %}
|
||||||
|
<link rel="search" type="application/opensearchdescription+xml"
|
||||||
|
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
|
||||||
|
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
|
||||||
|
{%- endif %}
|
||||||
|
{%- if favicon %}
|
||||||
|
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- block linktags %}
|
||||||
|
{%- if hasdoc('about') %}
|
||||||
|
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('genindex') %}
|
||||||
|
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('search') %}
|
||||||
|
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if hasdoc('copyright') %}
|
||||||
|
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
|
||||||
|
{%- endif %}
|
||||||
|
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
|
||||||
|
{%- if parents %}
|
||||||
|
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if next %}
|
||||||
|
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- if prev %}
|
||||||
|
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
|
||||||
|
{%- endif %}
|
||||||
|
{%- endblock %}
|
||||||
|
{%- block extrahead %} {% endblock %}
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{%- block header %}{% endblock %}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
eBookConfig = {};
|
||||||
|
eBookConfig.host = '{{course_url}}' ? '{{course_url}}' : 'http://interactivepython.org';
|
||||||
|
eBookConfig.app = eBookConfig.host+'/{{appname}}';
|
||||||
|
eBookConfig.ajaxURL = eBookConfig.app+'/ajax/';
|
||||||
|
eBookConfig.course = '{{course_id}}';
|
||||||
|
eBookConfig.logLevel = {{loglevel}};
|
||||||
|
eBookConfig.loginRequired = {{login_required}}
|
||||||
|
eBookConfig.build_info = "{{build_info}}";
|
||||||
|
eBookConfig.isLoggedIn = false;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<section
|
||||||
|
id="slide_container"
|
||||||
|
class='slides {% block slide_container_class %}layout-regular{% endblock %}'>
|
||||||
|
|
||||||
|
{% block body %} {% endblock %}
|
||||||
|
</section>
|
||||||
|
{% block presenter_notes %}{% endblock %}
|
||||||
|
{%- if not embedded %}
|
||||||
|
{{ script() }}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
|
<script type="text/javascript" charset="utf-8">
|
||||||
|
$(document).ready(createEditors);
|
||||||
|
$(document).ready(styleUnittestResults());
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
// add the video play button overlay image
|
||||||
|
$(".video-play-overlay").each(function() {
|
||||||
|
$(this).css('background-image', "url(\'_static/play_overlay_icon.png\')")
|
||||||
|
});
|
||||||
|
|
||||||
|
// This function is needed to allow the dropdown search bar to work;
|
||||||
|
// The default behaviour is that the dropdown menu closes when something in
|
||||||
|
// it (like the search bar) is clicked
|
||||||
|
$(function() {
|
||||||
|
// Fix input element click problem
|
||||||
|
$('.dropdown input, .dropdown label').click(function(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// style codelens buttons (doing it here because PyTutor is a submodule owned by someone else
|
||||||
|
$(function() {
|
||||||
|
$(".ExecutionVisualizer").each(function() {
|
||||||
|
$(this).find("#jmpFirstInstr").addClass('btn btn-default');
|
||||||
|
$(this).find("#jmpStepBack").addClass('btn btn-danger');
|
||||||
|
$(this).find("#jmpStepFwd").addClass('btn btn-success');
|
||||||
|
$(this).find("#jmpLastInstr").addClass('btn btn-default');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
129
book/_templates/runestone_slides/static/common.js
Normal file
129
book/_templates/runestone_slides/static/common.js
Normal file
|
|
@ -0,0 +1,129 @@
|
||||||
|
var PERMANENT_URL_PREFIX = DOCUMENTATION_OPTIONS.URL_ROOT + '_static/';
|
||||||
|
|
||||||
|
var SLIDE_CLASSES = ['far-past', 'past', 'current', 'next', 'far-next'];
|
||||||
|
var SLIDES_SELECTOR = 'section.slides > article';
|
||||||
|
|
||||||
|
var PM_TOUCH_SENSITIVITY = 15;
|
||||||
|
var TABLE_CLASS = 'table';
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
/* classList polyfill by Eli Grey
|
||||||
|
* (http://purl.eligrey.com/github/classList.js/blob/master/classList.js) */
|
||||||
|
|
||||||
|
if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
|
||||||
|
|
||||||
|
(function (view) {
|
||||||
|
|
||||||
|
var
|
||||||
|
classListProp = "classList"
|
||||||
|
, protoProp = "prototype"
|
||||||
|
, elemCtrProto = (view.HTMLElement || view.Element)[protoProp]
|
||||||
|
, objCtr = Object
|
||||||
|
strTrim = String[protoProp].trim || function () {
|
||||||
|
return this.replace(/^\s+|\s+$/g, "");
|
||||||
|
}
|
||||||
|
, arrIndexOf = Array[protoProp].indexOf || function (item) {
|
||||||
|
for (var i = 0, len = this.length; i < len; i++) {
|
||||||
|
if (i in this && this[i] === item) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
// Vendors: please allow content code to instantiate DOMExceptions
|
||||||
|
, DOMEx = function (type, message) {
|
||||||
|
this.name = type;
|
||||||
|
this.code = DOMException[type];
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
, checkTokenAndGetIndex = function (classList, token) {
|
||||||
|
if (token === "") {
|
||||||
|
throw new DOMEx(
|
||||||
|
"SYNTAX_ERR"
|
||||||
|
, "An invalid or illegal string was specified"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (/\s/.test(token)) {
|
||||||
|
throw new DOMEx(
|
||||||
|
"INVALID_CHARACTER_ERR"
|
||||||
|
, "String contains an invalid character"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return arrIndexOf.call(classList, token);
|
||||||
|
}
|
||||||
|
, ClassList = function (elem) {
|
||||||
|
var
|
||||||
|
trimmedClasses = strTrim.call(elem.className)
|
||||||
|
, classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
|
||||||
|
;
|
||||||
|
for (var i = 0, len = classes.length; i < len; i++) {
|
||||||
|
this.push(classes[i]);
|
||||||
|
}
|
||||||
|
this._updateClassName = function () {
|
||||||
|
elem.className = this.toString();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
, classListProto = ClassList[protoProp] = []
|
||||||
|
, classListGetter = function () {
|
||||||
|
return new ClassList(this);
|
||||||
|
}
|
||||||
|
;
|
||||||
|
// Most DOMException implementations don't allow calling DOMException's toString()
|
||||||
|
// on non-DOMExceptions. Error's toString() is sufficient here.
|
||||||
|
DOMEx[protoProp] = Error[protoProp];
|
||||||
|
classListProto.item = function (i) {
|
||||||
|
return this[i] || null;
|
||||||
|
};
|
||||||
|
classListProto.contains = function (token) {
|
||||||
|
token += "";
|
||||||
|
return checkTokenAndGetIndex(this, token) !== -1;
|
||||||
|
};
|
||||||
|
classListProto.add = function (token) {
|
||||||
|
token += "";
|
||||||
|
if (checkTokenAndGetIndex(this, token) === -1) {
|
||||||
|
this.push(token);
|
||||||
|
this._updateClassName();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
classListProto.remove = function (token) {
|
||||||
|
token += "";
|
||||||
|
var index = checkTokenAndGetIndex(this, token);
|
||||||
|
if (index !== -1) {
|
||||||
|
this.splice(index, 1);
|
||||||
|
this._updateClassName();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
classListProto.toggle = function (token) {
|
||||||
|
token += "";
|
||||||
|
if (checkTokenAndGetIndex(this, token) === -1) {
|
||||||
|
this.add(token);
|
||||||
|
} else {
|
||||||
|
this.remove(token);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
classListProto.toString = function () {
|
||||||
|
return this.join(" ");
|
||||||
|
};
|
||||||
|
|
||||||
|
if (objCtr.defineProperty) {
|
||||||
|
var classListPropDesc = {
|
||||||
|
get: classListGetter
|
||||||
|
, enumerable: true
|
||||||
|
, configurable: true
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||||
|
} catch (ex) { // IE 8 doesn't support enumerable:true
|
||||||
|
if (ex.number === -0x7FF5EC54) {
|
||||||
|
classListPropDesc.enumerable = false;
|
||||||
|
objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (objCtr[protoProp].__defineGetter__) {
|
||||||
|
elemCtrProto.__defineGetter__(classListProp, classListGetter);
|
||||||
|
}
|
||||||
|
|
||||||
|
}(self));
|
||||||
|
|
||||||
|
}
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
60
book/_templates/runestone_slides/static/console.css
Normal file
60
book/_templates/runestone_slides/static/console.css
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
#controls {
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
margin: 10px;
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-family: sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slides.table > article {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
article.placeholder {
|
||||||
|
background: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slides.table > article {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -225px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slides.table > article.past {
|
||||||
|
transform: translate(-325px);
|
||||||
|
-o-transform: translate(-325px);
|
||||||
|
-moz-transform: translate(-325px);
|
||||||
|
-webkit-transform: translate3d(-325px, 0, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.slides.table > article.next {
|
||||||
|
transform: translate(475px);
|
||||||
|
-o-transform: translate(475px);
|
||||||
|
-moz-transform: translate(475px);
|
||||||
|
-webkit-transform: translate3d(475px, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.slides > article.past,
|
||||||
|
.slides > article.next {
|
||||||
|
height: 230px;
|
||||||
|
width: 300px;
|
||||||
|
|
||||||
|
margin-top: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.presenter_notes {
|
||||||
|
position: absolute;
|
||||||
|
top: 420px;
|
||||||
|
left: 10%;
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
padding: 1em;
|
||||||
|
width: 80%;
|
||||||
|
font-size: 130%;
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
-o-border-radius: 10px;
|
||||||
|
-moz-border-radius: 10px;
|
||||||
|
-webkit-border-radius: 10px;
|
||||||
|
}
|
||||||
91
book/_templates/runestone_slides/static/console.js
Normal file
91
book/_templates/runestone_slides/static/console.js
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
|
var
|
||||||
|
|
||||||
|
handleKey = function(event) {
|
||||||
|
switch (event.keyCode) {
|
||||||
|
case 39: // right arrow
|
||||||
|
case 13: // Enter
|
||||||
|
case 32: // space
|
||||||
|
case 34: // PgDn
|
||||||
|
nextSlide();
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 37: // left arrow
|
||||||
|
case 8: // Backspace
|
||||||
|
case 33: // PgUp
|
||||||
|
prevSlide();
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleUpdateSlides = function(slide_index, prev_slide, cur_slide, next_slide) {
|
||||||
|
document.querySelector('#cur_slide_num').innerHTML = Number(slide_index) + 1;
|
||||||
|
|
||||||
|
// make sure we have a previous and next slide to show;
|
||||||
|
// if not add dummy placeholders
|
||||||
|
if (!prev_slide) {
|
||||||
|
prev_slide = '<article class="past placeholder"></article>';
|
||||||
|
}
|
||||||
|
if (!next_slide) {
|
||||||
|
next_slide = '<article class="next placeholder"></article>';
|
||||||
|
}
|
||||||
|
|
||||||
|
document.querySelector('#slide_container').innerHTML = prev_slide + cur_slide + next_slide;
|
||||||
|
|
||||||
|
// Copy the presenter notes into place
|
||||||
|
$('#presenter_notes').empty();
|
||||||
|
$('article.current').find('div.admonition.note').each(
|
||||||
|
function(i, node) {
|
||||||
|
$('#presenter_notes').append($(node).html());
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var slides = document.querySelector('section.slides > article');
|
||||||
|
for (var i=0; i < slides.length; i++) {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleMessage = function(e) {
|
||||||
|
switch (e.data.command) {
|
||||||
|
case 'num_slides':
|
||||||
|
document.querySelector('#num_slides').innerHTML = e.data.content;
|
||||||
|
break;
|
||||||
|
case 'cur_slide':
|
||||||
|
handleUpdateSlides(e.data.content, e.data.prev_slide, e.data.slide, e.data.next_slide);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
nextSlide = function(e) {
|
||||||
|
if (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
window.opener.postMessage({command: 'nextSlide'}, '*');
|
||||||
|
},
|
||||||
|
|
||||||
|
prevSlide = function(e) {
|
||||||
|
if (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.opener.postMessage({command: 'prevSlide'}, '*');
|
||||||
|
},
|
||||||
|
|
||||||
|
init = function(e) {
|
||||||
|
window.addEventListener('message', handleMessage, false);
|
||||||
|
document.addEventListener('keydown', handleKey, false);
|
||||||
|
|
||||||
|
document.querySelector('#next').addEventListener('click', nextSlide);
|
||||||
|
document.querySelector('#prev').addEventListener('click', prevSlide);
|
||||||
|
|
||||||
|
window.opener.postMessage({command: 'register'}, '*');
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
||||||
|
|
||||||
|
}, false);
|
||||||
57
book/_templates/runestone_slides/static/controller.js
Normal file
57
book/_templates/runestone_slides/static/controller.js
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
var SlideController = (
|
||||||
|
function(){
|
||||||
|
|
||||||
|
var
|
||||||
|
slidedeck,
|
||||||
|
|
||||||
|
onKeyDown = function (event) {
|
||||||
|
|
||||||
|
switch (event.keyCode) {
|
||||||
|
case 39: // right arrow
|
||||||
|
case 13: // Enter
|
||||||
|
case 32: // space
|
||||||
|
case 34: // PgDn
|
||||||
|
slidedeck.nextSlide();
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 37: // left arrow
|
||||||
|
case 8: // Backspace
|
||||||
|
case 33: // PgUp
|
||||||
|
slidedeck.prevSlide();
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 40: // down arrow
|
||||||
|
if (isChromeVoxActive()) {
|
||||||
|
slidedeck.speakNextItem();
|
||||||
|
} else {
|
||||||
|
slidedeck.nextSlide();
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 38: // up arrow
|
||||||
|
if (isChromeVoxActive()) {
|
||||||
|
slidedeck.speakPrevItem();
|
||||||
|
} else {
|
||||||
|
slidedeck.prevSlide();
|
||||||
|
}
|
||||||
|
event.preventDefault();
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
init = function(slides) {
|
||||||
|
slidedeck = slides;
|
||||||
|
|
||||||
|
document.addEventListener('keydown', onKeyDown, false);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
init: init
|
||||||
|
};
|
||||||
|
|
||||||
|
}());
|
||||||
2
book/_templates/runestone_slides/static/init.js
Normal file
2
book/_templates/runestone_slides/static/init.js
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
SlideSync.init(SlideDeck);
|
||||||
|
SlideController.init(SlideSync);
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
.CodeMirror-lines {
|
||||||
|
line-height: 35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.CodeMirror-gutter {
|
||||||
|
line-height: 35px;
|
||||||
|
}
|
||||||
47
book/_templates/runestone_slides/static/slides.css
Normal file
47
book/_templates/runestone_slides/static/slides.css
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
img.fill {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
min-width: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
|
||||||
|
border-radius: 10px;
|
||||||
|
-o-border-radius: 10px;
|
||||||
|
-moz-border-radius: 10px;
|
||||||
|
-webkit-border-radius: 10px;
|
||||||
|
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.headerlink {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1:hover > a.headerlink,
|
||||||
|
h2:hover > a.headerlink,
|
||||||
|
h3:hover > a.headerlink,
|
||||||
|
h4:hover > a.headerlink,
|
||||||
|
h5:hover > a.headerlink,
|
||||||
|
h6:hover > a.headerlink,
|
||||||
|
dt:hover > a.headerlink {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.figure p.caption {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
font-size: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-no {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 1ex;
|
||||||
|
right: 1em;
|
||||||
|
font-size: 66%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.admonition.note {
|
||||||
|
visibility: hidden;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue