##// END OF EJS Templates
Merge pull request #8888 from minrk/sphinx-directive...
Min RK -
r21812:9be0bc19 merge
parent child Browse files
Show More
@@ -135,16 +135,9 b' import ast'
135 import warnings
135 import warnings
136 import shutil
136 import shutil
137
137
138 # To keep compatibility with various python versions
139 try:
140 from hashlib import md5
141 except ImportError:
142 from md5 import md5
143
138
144 # Third-party
139 # Third-party
145 import sphinx
146 from docutils.parsers.rst import directives
140 from docutils.parsers.rst import directives
147 from docutils import nodes
148 from sphinx.util.compat import Directive
141 from sphinx.util.compat import Directive
149
142
150 # Our own
143 # Our own
@@ -285,6 +278,7 b' class EmbeddedSphinxShell(object):'
285
278
286 # Create config object for IPython
279 # Create config object for IPython
287 config = Config()
280 config = Config()
281 config.HistoryManager.hist_file = ':memory:'
288 config.InteractiveShell.autocall = False
282 config.InteractiveShell.autocall = False
289 config.InteractiveShell.autoindent = False
283 config.InteractiveShell.autoindent = False
290 config.InteractiveShell.colors = 'NoColor'
284 config.InteractiveShell.colors = 'NoColor'
@@ -856,14 +850,14 b' class IPythonDirective(Directive):'
856 config = self.state.document.settings.env.config
850 config = self.state.document.settings.env.config
857
851
858 # get config variables to set figure output directory
852 # get config variables to set figure output directory
859 confdir = self.state.document.settings.env.app.confdir
853 outdir = self.state.document.settings.env.app.outdir
860 savefig_dir = config.ipython_savefig_dir
854 savefig_dir = config.ipython_savefig_dir
861 source_dir = os.path.dirname(self.state.document.current_source)
855 source_dir = os.path.dirname(self.state.document.current_source)
862 if savefig_dir is None:
856 if savefig_dir is None:
863 savefig_dir = config.html_static_path
857 savefig_dir = config.html_static_path or '_static'
864 if isinstance(savefig_dir, list):
858 if isinstance(savefig_dir, list):
865 savefig_dir = savefig_dir[0] # safe to assume only one path?
859 savefig_dir = os.path.join(*savefig_dir)
866 savefig_dir = os.path.join(confdir, savefig_dir)
860 savefig_dir = os.path.join(outdir, savefig_dir)
867
861
868 # get regex and prompt stuff
862 # get regex and prompt stuff
869 rgxin = config.ipython_rgxin
863 rgxin = config.ipython_rgxin
General Comments 0
You need to be logged in to leave comments. Login now