You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but wasn't able to figure out where that directory is on Windows? Putting it directly in the C:\ folder didn't work.
I finally had to specify the following:
mathjax_path = 'file:///C:/MathJax/MathJax.js'
However, this doesn't work with Sphinx 1.0.3 unless I change add_javascript() in sphinx/application.py from:
def add_javascript(self, filename):
from sphinx.builders.html import StandaloneHTMLBuilder
StandaloneHTMLBuilder.script_files.append(
posixpath.join('_static', filename))
to:
def add_javascript(self, filename):
from sphinx.builders.html import StandaloneHTMLBuilder
if filename.startswith('file://'):
StandaloneHTMLBuilder.script_files.append(filename)
else:
StandaloneHTMLBuilder.script_files.append(
posixpath.join('_static', filename))
Looking at basic/layout.html I see:
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
And by looking at pathto() in sphinx\builders\html.py:
def pathto(otheruri, resource=False,
baseuri=self.get_target_uri(pagename)):
if not resource:
otheruri = self.get_target_uri(otheruri)
uri = relative_uri(baseuri, otheruri) or '#'
return uri
I see I also need to change relative_uri in sphinx\util\osutil.py from:
def relative_uri(base, to):
"""Return a relative URL from ``base`` to ``to``."""
if to.startswith(SEP):
return to
to:
def relative_uri(base, to):
"""Return a relative URL from ``base`` to ``to``."""
if to.startswith(SEP) or to.startswith("file://"):
return to
I have a feeling that bad things would also happen if you tried to temporarily use mathjax from some other host while testing local files; i.e. the following probably also won't work?:
In order to easily test the new mathjax extension (https://bitbucket.org/kevindunn/sphinx-extension-mathjax/src/tip/mathjax.py and see discussion at http://groups.google.com/group/sphinx-dev/browse_thread/thread/164db6fd920f3501/) on Windows with local files, I initially tried the following in my conf.py file:
but wasn't able to figure out where that directory is on Windows? Putting it directly in the C:\ folder didn't work.
I finally had to specify the following:
However, this doesn't work with Sphinx 1.0.3 unless I change add_javascript() in sphinx/application.py from:
to:
Looking at basic/layout.html I see:
And by looking at pathto() in sphinx\builders\html.py:
I see I also need to change relative_uri in sphinx\util\osutil.py from:
to:
I have a feeling that bad things would also happen if you tried to temporarily use mathjax from some other host while testing local files; i.e. the following probably also won't work?:
The text was updated successfully, but these errors were encountered: