Permalink
Browse files

améliore le thème de la présentation

  • Loading branch information...
sdpython committed Mar 22, 2015
1 parent efacdeb commit 3676a7d91343e78bc4d5a73c1f23766a82cd7f20
Showing with 1,841 additions and 5 deletions.
  1. +3 −1 _doc/sphinxdoc/source/conf.py
  2. +14 −3 _doc/sphinxdoc/source/index.rst
  3. +23 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/__init__.py
  4. +29 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/coffee/menuselection.coffee
  5. +29 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/coffee/phantom_header.coffee
  6. +2 −1 _doc/sphinxdoc/source/{phdoc_templates → my_hachibee_sphinx_theme/hachibee}/layout.html
  7. +5 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/localtoc.html
  8. +9 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/page.html
  9. +12 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/relations.html
  10. 0 _doc/sphinxdoc/source/{phdoc_templates → my_hachibee_sphinx_theme/hachibee}/searchbox.html
  11. +5 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/sourcelink.html
  12. +31 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/backtop.js
  13. BIN _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/genericons-regular-webfont.eot
  14. +135 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/genericons-regular-webfont.svg
  15. BIN _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/genericons-regular-webfont.ttf
  16. BIN _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/genericons-regular-webfont.woff
  17. +21 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/genericons.css
  18. +160 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/main.css
  19. +93 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/main.js
  20. +22 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/static/mobile.css
  21. +20 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/colors.styl
  22. +64 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/directives.styl
  23. +148 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/genericons.styl
  24. +466 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/main.styl
  25. +84 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/mobile.styl
  26. +379 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/normalize.styl
  27. +13 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/reset.styl
  28. +62 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/roles.styl
  29. 0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/variables.styl
  30. +5 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/stylus/widget-decorations.styl
  31. +7 −0 _doc/sphinxdoc/source/my_hachibee_sphinx_theme/hachibee/theme.conf
@@ -9,7 +9,6 @@
import os
import datetime
import re
import hachibee_sphinx_theme
sys.path.insert(0, os.path.abspath(os.path.join(os.path.split(__file__)[0])))
sys.path.insert(
@@ -30,8 +29,11 @@
"pyquickhelper",
"src")))
import my_hachibee_sphinx_theme as hachibee_sphinx_theme
from pyquickhelper.helpgen.default_conf import set_sphinx_variables
set_sphinx_variables(__file__,
"Les enfants codaient",
"Xavier Dupré",
@@ -1,13 +1,24 @@
Les enfants codaient
====================
**Links:** `pypi <https://pypi.python.org/pypi/code_beatrix/>`_,
On dira bientôt cela.
**Liens :** `pypi <https://pypi.python.org/pypi/code_beatrix/>`_,
`github <https://github.com/sdpython/code_beatrix/>`_,
`documentation <http://www.xavierdupre.fr/app/code_beatrix/helpsphinx/index.html>`_,
`wheel <http://www.xavierdupre.fr/site2013/index_code.html#code_beatrix>`_
On programme pour faire des jeux, des sites internets, des recherches scientifiques,
pour automatiser une tâche qu'on ne souhaite plus faire à la main.
On n'écrit jamais deux fois le même programme car on peut réutiliser celui-ci
à l'infini. C'est *créatif*. C'est pour cela qu'il est important de
cultiver son imagination. Lire, lire
n'importe quel livre, pratiquer mais ne pas faire que ça.
Les exercices qui suivent ont pour objectif de faire découvrir la programmation
aux enfants principalement.
Patchworks
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
""" """
import os
from sphinx.builders.html import StandaloneHTMLBuilder
def get_html_themes_path():
"""Return list of sphinx themes."""
here = os.path.abspath(os.path.dirname(__file__))
return here
def setup(app):
pass
# script_files = [
# '_static/dist/js/jquery.min.js',
# '_static/dist/js/underscore-min.js',
# '_static/dist/js/doctools.js',
# ]
# StandaloneHTMLBuilder.script_files = script_files
@@ -0,0 +1,29 @@
RoleAdjuster = do(namespace={}) ->
menuselection = ->
_create_menulabel = (content) ->
el = document.createElement 'span'
el.className = 'menu'
el.textContent = content
return el
window.addEventListener 'load', ->
menuselections = document.querySelectorAll '.menuselection'
for menuselection in menuselections
content = menuselection.textContent
menuselection.textContent = '' # clear default value
menu_elements = (
_create_menulabel menu_text.replace(/^\s+|\s+$/g, "") for menu_text in content.split '')
for m in menu_elements
menuselection.appendChild m
menuselection.appendChild do ->
el = document.createElement 'span'
el.className = 'menu-separator icon-rightarrow'
# el.textContent = MENU_SEPARATOR #use web font
return el
return
namespace.menuselection = menuselection
return namespace
RoleAdjuster.menuselection()
@@ -0,0 +1,29 @@
SELECTOR_OF_HEADER = '#top-header'
ELEMENT_OF_HEADER = document.querySelector SELECTOR_OF_HEADER
SELECTOR_OF_RAISETOP_BUTTON = '#raise-top'
ELEMENT_OF_RAISETOP_BUTTON = document.querySelector SELECTOR_OF_RAISETOP_BUTTON
ElementAdjuster = do(namespace=ElementAdjuster || {}) ->
namespace.phantom_header = ->
scroll_y = document.documentElement.scrollTop || document.body.scrollTop
if scroll_y <= 30
ELEMENT_OF_HEADER.className = ""
else
ELEMENT_OF_HEADER.className = "modest"
namespace.phantom_raise_top_button = ->
scroll_y = document.documentElement.scrollTop || document.body.scrollTop
raiser_style = ELEMENT_OF_RAISETOP_BUTTON.style
if scroll_y <= 30
raiser_style.bottom = "-70px"
else if scroll_y <= 330
raiser_style.bottom = "#{70 - (330 - scroll_y)}px"
else
raiser_style.bottom = "70px"
return namespace
window.addEventListener 'scroll', ElementAdjuster.phantom_header
window.addEventListener 'scroll', ElementAdjuster.phantom_raise_top_button
@@ -190,7 +190,8 @@ <h3><a href="{{ pathto(master_doc) }}">{{ _('Top') }}</a></h3>
{%- if last_updated %}
<p class="last-updated">
{% trans last_updated=last_updated|e %}Dernière mise à jour {{ last_updated }}.{% endtrans %}
{% trans last_updated=last_updated|e %}Dernière mise à jour {{ last_updated }}.{% endtrans %}
<a href="http://www.xavierdupre.fr/">Xavier Dupré</a>
</p>
{%- endif %}
</footer>
@@ -0,0 +1,5 @@
<nav class="localtoc">
{%- if display_toc %}
{{ toc }}
{%- endif %}
</nav>
@@ -0,0 +1,9 @@
{% extends "!layout.html" %}
{%- block extrahead %}
<script type="text/javascript" src="{{ pathto('_static/backtop.js', 1) }}"></script>
{% endblock %}
{% block body %}
{{ body }}
<div id="raise-top"></div>
{% endblock body %}
@@ -0,0 +1,12 @@
<div class="relative">
{%- if prev %}
<h4>{{ _('Previous topic') }}</h4>
<p class="topless"><a href="{{ prev.link|e }}"
title="{{ _('previous chapter') }}">{{ prev.title }}</a></p>
{%- endif %}
{%- if next %}
<h4>{{ _('Next topic') }}</h4>
<p class="topless"><a href="{{ next.link|e }}"
title="{{ _('next chapter') }}">{{ next.title }}</a></p>
{%- endif %}
</div>
@@ -0,0 +1,5 @@
{%- if show_source and has_source and sourcename %}
<h4>{{ _('This Page') }}</h4>
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a>
{%- endif %}
@@ -0,0 +1,31 @@
var ns = (function(exports) {
var Raise = function constructor() {
this._init_handler = function(func) {
window.addEventListener('load', func);
};
};
Raise.prototype.register = function(id) {
var to_top = function(e) {
var scroll_top = document.documentElement.scrollTop || document.body.scrollTop;
if (scroll_top > 0) {
var diff = Math.max(scroll_top / 2, 20);
window.scrollTo(0, scroll_top - diff);
window.setTimeout(to_top, 25, e);
}
};
this._init_handler(function() {
var target = document.getElementById(id);
target.addEventListener('click', to_top);
});
};
exports.Raise = Raise;
return exports;
})({});
var RAISE_BUTTONS_ID = 'raise-top';
var raiser = new ns.Raise();
raiser.register(RAISE_BUTTONS_ID);
Oops, something went wrong.

0 comments on commit 3676a7d

Please sign in to comment.