[Numpy-discussion] Sphinx custom extension mess, and patches

josef.pktd@gmai... josef.pktd@gmai...
Sun Feb 15 18:53:01 CST 2009

I tracked down one more windows specific bug in the plot directive.
Initially the link to the source file for a graph generated by the
plot_directive didn't work (literal text instead of link). The source
was that the source link contains `\\` as separators and not `/`

The fix is in the call to jinja, replace the os.path.sep also for the
source_link  in the same way as is done for the link_dir.
After this change, the source links render correctly in the html output.

    result = jinja.from_string(TEMPLATE).render(
        link_dir=link_dir.replace(os.path.sep, '/'),
        source_link=source_link.replace(os.path.sep, '/'),       #
change os.path.sep on windows

The generated or copied source files for the plots do not contain any
file extension, in my changes I also added '.py' extension back to the
filename. Is there a reason for dropping the file extension?


More information about the Numpy-discussion mailing list