Commit 57e3f22a authored by Matthieu Boileau's avatar Matthieu Boileau

Merge branch 'develop' into 'master'

Develop

Closes #24 and #22

See merge request !16
parents bc2b1d31 24be366c
Pipeline #9499 passed with stages
in 29 minutes and 41 seconds
......@@ -14,3 +14,4 @@ tests/notebooks
.pytest_cache/
*.egg-info/
dist/
poetry.lock
......@@ -20,9 +20,9 @@ class BookContext:
self.curdir = None
def __enter__(self):
self.initial_path = Path.cwd()
os.chdir(self.work_path)
with open(self.filepath, 'w') as f:
self.initial_path = Path.cwd() # save initial path
os.chdir(self.work_path) # Move to work_path
with open(self.filepath, 'w') as f: # write file
f.write(self.filecontent)
return self
......@@ -34,7 +34,7 @@ class BookContext:
class Book:
"""A book to be built with bookbook"""
bookbook_filename = 'bookbook_filename.tex'
bookbook_filename = 'bookbook.tex'
def __init__(self, conf):
......@@ -57,11 +57,10 @@ class Book:
bookbook_template = template.render(titlepage=titlepage_content)
# Work temporarly in self.output_path directory
with BookContext(Path(self.bookbook_filename), bookbook_template,
with BookContext(self.bookbook_filename, bookbook_template,
self.output_path):
# Call bookbook
combine_and_convert(Path('.'),
combine_and_convert(Path.cwd(),
Path(self.book_title),
pdf=True,
template_file=self.bookbook_filename)
title: Apprendre Python pour les sciences
title: Learning Python for sciences
slug_title: cours-python
subtitle: Master Communication Scientifique, 2019-2020
subtitle: Scientific Communication Master, 2019-2020
favicon: fig/favicon.ico
book:
file: cours-python.pdf
picture:
path: fig/python-logo_full.png
path: img/python-logo_full.png
width: 300px
alt: Logo Python
authors:
......@@ -21,17 +21,17 @@ links:
title: Manual
target: manual.html
binder:
title: Exécuter
title: Run
target: https://mybinder.org/v2/gh/fitzinger/cours-python/master
book:
title: Version pdf
title: PDF version
gitlab:
title: Sources
target: https://gitlab.math.unistra.fr/fitzinger/cours-python
archive:
title: Archive complète
title: Full archive
license:
text: Contenu mis à disposition sous licence
text: Content available under license
target: https://creativecommons.org/licenses/by-sa/4.0/
icon:
path: img/by-sa.svg
......
......@@ -15,7 +15,7 @@
\vspace*{0.1\textheight}
\centering
\includegraphics{fig/python-logo_full.png}
\includegraphics{img/head_of_python_molurus_frame.png}
\vfill
......
This diff is collapsed.
[tool.poetry]
name = "nbcourse"
version = "0.2.5"
version = "0.2.6"
description = "Create a minisite to publish a course based on Jupyter notebooks"
authors = ["Matthieu Boileau <matthieu.boileau@math.unistra.fr>"]
license = "MIT"
......@@ -10,6 +10,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.7"
nbconvert = "^5.6.1"
bookbook = "^0.2"
bs4 = "^0.0.1"
IPython = "^7.15.0"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment