[yt-svn] commit/yt-doc: ngoldbaum: Fixing paths for the links used in the notebook directive.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Dec 3 08:26:59 PST 2013


1 new commit in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/f5100120a4f1/
Changeset:   f5100120a4f1
User:        ngoldbaum
Date:        2013-12-03 16:47:12
Summary:     Fixing paths for the links used in the notebook directive.
Affected #:  1 file

diff -r c3a9cac0a7d98019d304f86181d9b236d227f889 -r f5100120a4f12dd26cdd5371375f87df6c7458bc extensions/notebook_sphinxext.py
--- a/extensions/notebook_sphinxext.py
+++ b/extensions/notebook_sphinxext.py
@@ -29,6 +29,7 @@
 
         # Move files around.
         rel_dir = os.path.relpath(rst_dir, setup.confdir)
+        rel_path = os.path.join(rel_dir, nb_basename)
         dest_dir = os.path.join(setup.app.builder.outdir, rel_dir)
         dest_path = os.path.join(dest_dir, nb_basename)
 
@@ -43,6 +44,8 @@
 
         dest_path_eval = string.replace(dest_path, '.ipynb', '_evaluated.ipynb')
         dest_path_script = string.replace(dest_path, '.ipynb', '.py')
+        rel_path_eval = string.replace(nb_basename, '.ipynb', '_evaluated.ipynb')
+        rel_path_script = string.replace(nb_basename, '.ipynb', '.py')
 
         # Create python script vesion
         unevaluated_text = nb_to_html(nb_abs_path)
@@ -59,9 +62,9 @@
 
         # Create link to notebook and script files
         link_rst = "(" + \
-                   formatted_link(dest_path) + "; " + \
-                   formatted_link(dest_path_eval) + "; " + \
-                   formatted_link(dest_path_script) + \
+                   formatted_link(nb_basename) + "; " + \
+                   formatted_link(rel_path_eval) + "; " + \
+                   formatted_link(rel_path_script) + \
                    ")"
 
         self.state_machine.insert_input([link_rst], rst_file)

Repository URL: https://bitbucket.org/yt_analysis/yt-doc/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list