diff --git a/doc/source/themes/nature_with_gtoc/static/nature.css_t b/doc/source/themes/nature_with_gtoc/static/nature.css_t index ebfeb6e5a8b08..2e0bed922c1e6 100644 --- a/doc/source/themes/nature_with_gtoc/static/nature.css_t +++ b/doc/source/themes/nature_with_gtoc/static/nature.css_t @@ -30,7 +30,8 @@ div.documentwrapper { div.bodywrapper { /* ugly hack, probably not attractive with other font size for re*/ margin: 0 0 0 {{ theme_sidebarwidth|toint}}px; - max-width: 600px; + min-width: 540px; + max-width: 720px; } diff --git a/doc/sphinxext/ipython_directive.py b/doc/sphinxext/ipython_directive.py index b237341e81125..0c28e397a0005 100644 --- a/doc/sphinxext/ipython_directive.py +++ b/doc/sphinxext/ipython_directive.py @@ -621,6 +621,8 @@ class IpythonDirective(Directive): shell = EmbeddedSphinxShell() + seen_docs = set() + def get_config_options(self): # contains sphinx configuration variables config = self.state.document.settings.env.config @@ -644,6 +646,12 @@ def get_config_options(self): return savefig_dir, source_dir, rgxin, rgxout, promptin, promptout def setup(self): + + if not self.state.document.current_source in self.seen_docs: + self.shell.IP.history_manager.reset() + self.shell.IP.execution_count = 1 + self.seen_docs.add(self.state.document.current_source) + # get config values (savefig_dir, source_dir, rgxin, rgxout, promptin, promptout) = self.get_config_options()