Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
essai d'une troisième version du layout
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Aug 10, 2014
1 parent 578d02a commit 39a1246
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -48,6 +48,7 @@ local.properties
x64/
build/
build2/
build3/
[Bb]in/
[Oo]bj/

Expand Down
25 changes: 25 additions & 0 deletions _doc/sphinxdoc/source/conf3/conf.py
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# documentation build configuration file, created by
# sphinx-quickstart on Fri May 10 18:35:14 2013.
#

import sys, os, datetime, re
import sphinx_bootstrap_theme

source_path = os.path.normpath(os.path.join(os.path.abspath(os.path.split(__file__)[0]),".."))

try :
from conf import *
except ImportError :
sys.path.append(source_path)
from conf import *

html_theme = 'bootstrap'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
templates_path = [ os.path.join(source_path,'phdoc_static3') ]
html_static_path = templates_path

if not os.path.exists(templates_path[0]):
raise FileNotFoundError(templates_path[0])
9 changes: 1 addition & 8 deletions _doc/sphinxdoc/source/phdoc_static/footer.html
Expand Up @@ -14,15 +14,8 @@

<div role="contentinfo">
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %} {{ copyright }}.{% endtrans %}
{%- endif %}
{%- endif %}

<a href="http://www.xavierdupre.fr/"><img src="http://www.xavierdupre.fr/app/ensae_teaching_cs/helpsphinx/_static/project_ico.ico" width="15" /></a>
<a href="http://www.xavierdupre.fr/"><img src="http://www.xavierdupre.fr/app/ensae_teaching_cs/helpsphinx/_static/project_ico_long.png" height="15" /></a>
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Dernière mise à jour : {{ last_updated }}.{% endtrans %}
{%- endif %}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions _doc/sphinxdoc/source/phdoc_static3/layout.html
@@ -0,0 +1,140 @@
{% extends "basic/layout.html" %}

{% set theme_css_files = [] %}
{% if theme_bootstrap_version == "3" %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "3.1.0", "theme", "" %}
{% set bs_span_prefix = "col-md-" %}
{% else %}
{% set bootstrap_version, bootstrap_additional_css, navbar_version = "2.3.2", "responsive", "-2" %}
{% set bs_span_prefix = "span" %}
{% endif %}

{% if theme_bootswatch_theme %}
{# BS2 needs "bootstrap-responsive.css". BS3 doesn't. #}
{% if theme_bootstrap_version == "3" %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootswatch-' + bootstrap_version + '/' + theme_bootswatch_theme + '/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}
{% else %}
{% set theme_css_files = theme_css_files + [
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap.min.css',
'_static/bootstrap-' + bootstrap_version + '/css/bootstrap-' + bootstrap_additional_css + '.min.css',
'_static/bootstrap-sphinx.css'
]
%}
{% endif %}

{% if not bootswatch_css_custom %}
{% set bootswatch_css_custom = [] %}
{% endif %}
{% set css_files = css_files + theme_css_files + bootswatch_css_custom %}

{% set script_files = script_files + [
'_static/js/jquery-1.11.0.min.js',
'_static/js/jquery-fix.js',
'_static/bootstrap-' + bootstrap_version + '/js/bootstrap.min.js',
'_static/bootstrap-sphinx.js'
]
%}

{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and sidebars %}

{%- set bs_content_width = render_sidebar and "9" or "12"%}

{%- block doctype -%}
<!DOCTYPE html>
{%- endblock %}

{# Sidebar: Rework into our Bootstrap nav section. #}
{% macro navBar() %}
{% include "navbar" + navbar_version + ".html" %}
{% endmacro %}

{% if theme_bootstrap_version == "3" %}
{%- macro bsidebar() %}
{%- if render_sidebar %}
<div class="{{ bs_span_prefix }}3">
<div id="sidebar" class="bs-sidenav" role="complementary">
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
</div>
</div>
{%- endif %}
{%- endmacro %}
{% else %}
{%- macro bsidebar() %}
{%- if render_sidebar %}
<div class="{{ bs_span_prefix }}3">
<div id="sidebar" class="bs-sidenav well" data-spy="affix">
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
</div>
</div>
{%- endif %}
{%- endmacro %}
{% endif %}

{%- block extrahead %}
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
{% endblock %}

{# Silence the sidebar's, relbar's #}
{% block header %}{% endblock %}
{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}
{% block sidebarsourcelink %}{% endblock %}

{%- block content %}
{{ navBar() }}
<div class="container">
<div class="row">
{%- block sidebar1 %}{{ bsidebar() }}{% endblock %}
<div class="{{ bs_span_prefix }}{{ bs_content_width }}">
{% block body %}{% endblock %}
</div>
{% block sidebar2 %} {# possible location for sidebar #} {% endblock %}
</div>
</div>
{%- endblock %}

{%- block footer %}
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
{% if theme_source_link_position == "footer" %}
<br/>
{% include "sourcelink.html" %}
{% endif %}
</p>
<p>
{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}<br/>
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}<br/>
{%- endif %}
{%- endif %}
<a href="http://www.xavierdupre.fr/"><img src="http://www.xavierdupre.fr/app/ensae_teaching_cs/helpsphinx/_static/project_ico.ico" height="15" /></a>
{%- if last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}<br/>
{%- endif %}
</p>
</div>
</footer>
{%- endblock %}
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build_setup_help_on_windows.bat
Expand Up @@ -57,6 +57,7 @@ echo #######################################################
if not exist dist\html mkdir dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build\html dist\html
xcopy /E /C /I /Y _doc\sphinxdoc\build2\html dist\html2
xcopy /E /C /I /Y _doc\sphinxdoc\build3\html dist\html3
xcopy /E /C /I /Y _doc\sphinxdoc\build\latex dist\latex


3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -124,8 +124,9 @@
project_name = os.path.split(os.path.split(os.path.abspath(__file__))[0])[-1]
generate_help_sphinx(project_name,
layout = [ "pdf",
"html",
"html",
("html", "build2", {"html_theme":"basicstrap"}, "source/conf2"),
("html", "build3", {"html_theme":"bootstrap"}, "source/conf3"),
] )

elif "unittests" in sys.argv:
Expand Down

0 comments on commit 39a1246

Please sign in to comment.