Przeglądaj źródła

make compatible with newer IPython

Jake Vanderplas 12 lat temu
rodzic
commit
5af2ff3c81
2 zmienionych plików z 3 dodań i 1 usunięć
  1. 2 0
      liquid_tags/include_code.py
  2. 1 1
      liquid_tags/notebook.py

+ 2 - 0
liquid_tags/include_code.py

@@ -70,7 +70,9 @@ def include_code(preprocessor, tag, markup):
         title = os.path.basename(src)
         title = os.path.basename(src)
 
 
     static_dir = settings.get('STATIC_OUT_DIR', 'static')
     static_dir = settings.get('STATIC_OUT_DIR', 'static')
+
     url = '/{0}/{1}/{2}'.format(static_dir, code_dir, src)
     url = '/{0}/{1}/{2}'.format(static_dir, code_dir, src)
+    url = re.sub('/+', '/', url)
 
 
     open_tag = ("<figure class='code'>\n<figcaption><span>{title}</span> "
     open_tag = ("<figure class='code'>\n<figcaption><span>{title}</span> "
                 "<a href='{url}'>download</a></figcaption>".format(title=title,
                 "<a href='{url}'>download</a></figcaption>".format(title=title,

+ 1 - 1
liquid_tags/notebook.py

@@ -179,7 +179,7 @@ def notebook(preprocessor, tag, markup):
         raise ValueError("File {0} could not be found".format(nb_path))
         raise ValueError("File {0} could not be found".format(nb_path))
 
 
     # Call the notebook converter
     # Call the notebook converter
-    converter = ConverterBloggerHTML(nb_path)
+    converter = ConverterBloggerHTML(infile=nb_path)
     converter.read()
     converter.read()
 
 
     header_lines = process_header(converter.header_body())
     header_lines = process_header(converter.header_body())