
from urllib.parse import quote  # Py 3
import os


def path2url(path):
    """Turn a file path into a URL"""
    parts = path.split(os.path.sep)
    return '{{ site.baseurl }}/notebooks/' + '/'.join(quote(part) for part in parts)

################################################################################

c = get_config()
c.NbConvertApp.export_format = 'markdown'
c.MarkdownExporter.template_file = 'jupyter-jekyll'
c.FilesWriter.build_directory = 'webpage/_notebooks'
c.MarkdownExporter.filters = {'path2url': path2url}
c.Exporter.preprocessors = ['nbconvert_utils.JekyllPreprocessor']
# We do not need to rename for the current date. We actually want to freeze the date.
# c.NbConvertApp.postprocessor_class = 'nbconvert_utils.Rename'

@@ -1,9 +1,8 @@
-%0A
 from url
@@ -27,16 +27,8 @@
 uote
-  # Py 3
 %0Aimp
@@ -220,89 +220,8 @@
 s)%0A%0A
-################################################################################%0A
 %0Ac =
@@ -233,16 +233,24 @@
 config()
+  # noqa
 %0Ac.NbCon

fix lints