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

Commit

Permalink
Version 1.3.7
Browse files Browse the repository at this point in the history
Add build version in english documents
Build version is taken from VERSION file
  • Loading branch information
vtexier committed Oct 28, 2017
1 parent 2090355 commit 0a8c10f
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 24 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# LAST BUILD VERSION MUST BE SET IN source/conf.py
1.3.7
11 changes: 7 additions & 4 deletions build_en_US.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env bash

# set build release version in ENV to propagate it in documents
export BUILD_RELEASE=`cat ./VERSION`

# required to avoid pdf make to fail if a french latex build was made before
rm -r build/latex

Expand All @@ -8,16 +11,16 @@ sphinx-intl build --locale-dir source/locale

# HTML
# use tag for only directives (adapt image sizes for output)
make html SPHINXOPTS="-t html -D language='en_US' -D html_theme_path='themes/en_US' -D html_static_path='themes/en_US/html/static'"
make html SPHINXOPTS="-t html -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}' -D language='en_US' -D html_theme_path='themes/en_US' -D html_static_path='themes/en_US/html/static'"

# EPUB
make epub SPHINXOPTS="-t epub -D language='en_US' -D html_theme_path='themes/en_US' -D html_static_path='themes/en_US/epub/static'"
make epub SPHINXOPTS="-t epub -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}' -D language='en_US' -D html_theme_path='themes/en_US' -D html_static_path='themes/en_US/epub/static' -D epub_title='Relative Theory of Money v2.718 - rev. ${BUILD_RELEASE}'"
cp build/epub/TheorieRelativedelaMonnaie.epub build/html/.

# PDF
# make latexpdf SPHINXOPTS="-t latex -D language='en_US' -D latex_elements.title='Relative Theory of Money' -D latex_elements.release='' -D latex_elements.releasename=''"
make latexpdf SPHINXOPTS="-t latex -D language='en_US' -D latex_elements.title='Relative Theory of Money' -D latex_elements.release='2.718'"
cp build/latex/TheorieRelativedelaMonnaie.pdf build/html/.
make latexpdf SPHINXOPTS="-t latex -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}' -D language='en_US' -D latex_elements.title='Relative Theory of Money v2.718'"
cp build/latex/TheorieRelativedelaMonnaie.pdf build/html/.

# label folder as english version
rm -rf build/en_US/html
Expand Down
9 changes: 6 additions & 3 deletions build_fr_FR.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/usr/bin/env bash

# set build release version in ENV to propagate it in documents
export BUILD_RELEASE=`cat ./VERSION`

# HTML
# use tag for only directives (adapt image sizes for output)
make html SPHINXOPTS="-t html"
make html SPHINXOPTS="-t html -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}'"

# EPUB
make epub SPHINXOPTS="-t epub"
make epub SPHINXOPTS="-t epub -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}' -D epub_title='Théorie Relative de la Monnaie v2.718 - rev. ${BUILD_RELEASE}'"
cp build/epub/TheorieRelativedelaMonnaie.epub build/html/.

# PDF
make latexpdf SPHINXOPTS="-t latex"
make latexpdf SPHINXOPTS="-t latex -D version='${BUILD_RELEASE}' -D release='${BUILD_RELEASE}'"
cp build/latex/TheorieRelativedelaMonnaie.pdf build/html/.

# label folder as french version
Expand Down
6 changes: 3 additions & 3 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = '1.3.6'
version = '2.718'
# The full version, including alpha/beta/rc tags.
release = '1.3.6'
release = '2.718'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -297,7 +297,7 @@
# -- Options for Epub output -------------------------------------------
epub_basename = 'TheorieRelativedelaMonnaie'
epub_theme = 'epub'
epub_title = u"Théorie Relative de la Monnaie v2.718, rev. " + release
epub_title = u"Théorie Relative de la Monnaie v2.718"
epub_author = u'Stéphane Laborde'
epub_publisher = u'Stéphane Laborde'
#epub_scheme = 'UUID'
Expand Down
2 changes: 1 addition & 1 deletion source/themes/en_US/epub/epub-cover.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<title>Relative Theory of Money</title>
<title>Relative Theory of Money v2.718</title>
<link href="_static/cover.css" rel="stylesheet" type="text/css"/>
<style type="text/css">
body {
Expand Down
24 changes: 21 additions & 3 deletions source/themes/en_US/html/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<div class="row top-navbar">
<div class="span6 left">
Book « <a href="index.html">Relative Theory of Money v2.718</a> »
- rev. {{ version }} (Github rev. <a href="https://github.com/libre-money-projects/theorie-relative-de-la-monnaie/releases"><span id="TRM_releases"></span></a>)

</div><!-- span6 -->
<div class="span4 right"><div>
<a href="index.html">Table of content</a> |
Expand Down Expand Up @@ -47,18 +49,34 @@ <h1>Relative Theory of Money v2.718</h1>
</div><!-- container -->
{% endblock %}
{% block footer %}
<!--
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
-->
<script src="_static/Hyphenator.js" type="text/javascript" charset="utf-8"></script>
<script src="_static/fr.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
Hyphenator.config({
displaytogglebox : true,
minwordlength : 4,
defaultlanguage: 'en'
});
Hyphenator.run();

getRelease("libre-money-projects","theorie-relative-de-la-monnaie","TRM_releases");
function getRelease(user, repo, Id) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
var myArr = JSON.parse(xmlhttp.responseText);
release = populateRelease(myArr,Id);
}
};
xmlhttp.open("GET", "https://api.github.com/repos/" + user + "/" + repo + "/releases", true);
xmlhttp.send();
}
function populateRelease(arr,Id) {
var release = arr[0].tag_name;
document.getElementById(Id).innerHTML = release;
}

</script>

<div class="container footer">
Expand Down
12 changes: 3 additions & 9 deletions source/themes/html/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<div class="row top-navbar">
<div class="span6 left">
Livre « <a href="index.html">Théorie Relative de la Monnaie v2.718</a> »
- Rev. {{ version }} (Github rev. <a href="https://github.com/libre-money-projects/theorie-relative-de-la-monnaie/releases"><span id="TRM_releases"></span></a>)
- rev. {{ version }} (Github rev. <a href="https://github.com/libre-money-projects/theorie-relative-de-la-monnaie/releases"><span id="TRM_releases"></span></a>)

</div><!-- span6 -->
<div class="span4 right"><div>
<div class="span4 right"><div>
<a href="index.html">sommaire</a> |
{%- if prev %}
<a
Expand Down Expand Up @@ -49,9 +49,6 @@ <h1>{{ docstitle }}</h1>
</div><!-- container -->
{% endblock %}
{% block footer %}
<!--
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
-->
<script src="_static/Hyphenator.js" type="text/javascript" charset="utf-8"></script>
<script src="_static/fr.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Expand All @@ -71,7 +68,7 @@ <h1>{{ docstitle }}</h1>
var myArr = JSON.parse(xmlhttp.responseText);
release = populateRelease(myArr,Id);
}
}
};
xmlhttp.open("GET", "https://api.github.com/repos/" + user + "/" + repo + "/releases", true);
xmlhttp.send();
}
Expand All @@ -80,9 +77,6 @@ <h1>{{ docstitle }}</h1>
document.getElementById(Id).innerHTML = release;
}




</script>

<div class="container footer">
Expand Down

0 comments on commit 0a8c10f

Please sign in to comment.