diff --git a/_unittests/ut_sphinxext/Python.tex b/_unittests/ut_sphinxext/Python.tex deleted file mode 100644 index e69de29bb..000000000 diff --git a/_unittests/ut_sphinxext/sphinxhighlight.sty b/_unittests/ut_sphinxext/sphinxhighlight.sty deleted file mode 100644 index 1557ce6e3..000000000 --- a/_unittests/ut_sphinxext/sphinxhighlight.sty +++ /dev/null @@ -1,105 +0,0 @@ -\NeedsTeXFormat{LaTeX2e}[1995/12/01] -\ProvidesPackage{sphinxhighlight}[2016/05/29 stylesheet for highlighting with pygments] - - -\makeatletter -\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax% - \let\PYG@ul=\relax \let\PYG@tc=\relax% - \let\PYG@bc=\relax \let\PYG@ff=\relax} -\def\PYG@tok#1{\csname PYG@tok@#1\endcsname} -\def\PYG@toks#1+{\ifx\relax#1\empty\else% - \PYG@tok{#1}\expandafter\PYG@toks\fi} -\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{% - \PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}} -\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}} - -\expandafter\def\csname PYG@tok@w\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} -\expandafter\def\csname PYG@tok@c\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@cp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@cs\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\colorbox[rgb]{1.00,0.94,0.94}{\strut ##1}}} -\expandafter\def\csname PYG@tok@k\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@kp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@kt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.56,0.13,0.00}{##1}}} -\expandafter\def\csname PYG@tok@o\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PYG@tok@ow\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@nb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@nf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} -\expandafter\def\csname PYG@tok@nc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} -\expandafter\def\csname PYG@tok@nn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.05,0.52,0.71}{##1}}} -\expandafter\def\csname PYG@tok@ne\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@nv\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@no\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.38,0.68,0.84}{##1}}} -\expandafter\def\csname PYG@tok@nl\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.13,0.44}{##1}}} -\expandafter\def\csname PYG@tok@ni\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.84,0.33,0.22}{##1}}} -\expandafter\def\csname PYG@tok@na\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@nt\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.45}{##1}}} -\expandafter\def\csname PYG@tok@nd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.33,0.33,0.33}{##1}}} -\expandafter\def\csname PYG@tok@s\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sd\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@si\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.44,0.63,0.82}{##1}}} -\expandafter\def\csname PYG@tok@se\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.14,0.33,0.53}{##1}}} -\expandafter\def\csname PYG@tok@ss\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.32,0.47,0.09}{##1}}} -\expandafter\def\csname PYG@tok@sx\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} -\expandafter\def\csname PYG@tok@m\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@gh\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} -\expandafter\def\csname PYG@tok@gu\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} -\expandafter\def\csname PYG@tok@gd\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} -\expandafter\def\csname PYG@tok@gi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} -\expandafter\def\csname PYG@tok@gr\endcsname{\def\PYG@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} -\expandafter\def\csname PYG@tok@ge\endcsname{\let\PYG@it=\textit} -\expandafter\def\csname PYG@tok@gs\endcsname{\let\PYG@bf=\textbf} -\expandafter\def\csname PYG@tok@gp\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.78,0.36,0.04}{##1}}} -\expandafter\def\csname PYG@tok@go\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.20,0.20,0.20}{##1}}} -\expandafter\def\csname PYG@tok@gt\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} -\expandafter\def\csname PYG@tok@err\endcsname{\def\PYG@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} -\expandafter\def\csname PYG@tok@kc\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@kd\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@kn\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@kr\endcsname{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@bp\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.44,0.13}{##1}}} -\expandafter\def\csname PYG@tok@fm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.02,0.16,0.49}{##1}}} -\expandafter\def\csname PYG@tok@vc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@vg\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@vi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@vm\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.38,0.84}{##1}}} -\expandafter\def\csname PYG@tok@sa\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sc\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@dl\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@s2\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@sh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@s1\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.25,0.44,0.63}{##1}}} -\expandafter\def\csname PYG@tok@mb\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mf\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mh\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mi\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@il\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@mo\endcsname{\def\PYG@tc##1{\textcolor[rgb]{0.13,0.50,0.31}{##1}}} -\expandafter\def\csname PYG@tok@ch\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@cm\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@cpf\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} -\expandafter\def\csname PYG@tok@c1\endcsname{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.25,0.50,0.56}{##1}}} - -\def\PYGZbs{\char`\\} -\def\PYGZus{\char`\_} -\def\PYGZob{\char`\{} -\def\PYGZcb{\char`\}} -\def\PYGZca{\char`\^} -\def\PYGZam{\char`\&} -\def\PYGZlt{\char`\<} -\def\PYGZgt{\char`\>} -\def\PYGZsh{\char`\#} -\def\PYGZpc{\char`\%} -\def\PYGZdl{\char`\$} -\def\PYGZhy{\char`\-} -\def\PYGZsq{\char`\'} -\def\PYGZdq{\char`\"} -\def\PYGZti{\char`\~} -% for compatibility with earlier versions -\def\PYGZat{@} -\def\PYGZlb{[} -\def\PYGZrb{]} -\makeatother - -\renewcommand\PYGZsq{\textquotesingle} diff --git a/_unittests/ut_sphinxext/test_latex_builder.py b/_unittests/ut_sphinxext/test_latex_builder.py index a15e15c96..9699b42db 100644 --- a/_unittests/ut_sphinxext/test_latex_builder.py +++ b/_unittests/ut_sphinxext/test_latex_builder.py @@ -383,11 +383,11 @@ def test_latex_image(self): img2 = os.path.join(root, "data", "thumbnail", "im.png") content = """ .. image:: {0} - :width: 200 + :width: 59 :alt: alternative1 * .. image:: {1} - :width: 200 + :width: 59 :alt: alternative2 """.replace(" ", "").format(img1, img2).replace("\\", "/") if sys.version_info[0] >= 3: @@ -400,7 +400,7 @@ def test_latex_image(self): text = text.replace("\r", "") self.assertIn('sphinxincludegraphics', text) - self.assertIn('=200', text) + self.assertIn('=59', text) self.assertIn("png", text) with open(os.path.join(temp, "elatex_image.tex"), "w", encoding="utf8") as f: f.write(text) diff --git a/src/pyquickhelper/helpgen/_nbconvert_preprocessor.py b/src/pyquickhelper/helpgen/_nbconvert_preprocessor.py index c36e56b9f..3a5a5f293 100644 --- a/src/pyquickhelper/helpgen/_nbconvert_preprocessor.py +++ b/src/pyquickhelper/helpgen/_nbconvert_preprocessor.py @@ -8,7 +8,7 @@ class LatexRawOutputPreprocessor(Preprocessor): """ - Custom processor to apply a different syle on raw output. + Custom processor to apply a different style on raw output. """ def preprocess_cell(self, cell, resources, cell_index): diff --git a/src/pyquickhelper/helpgen/process_notebooks.py b/src/pyquickhelper/helpgen/process_notebooks.py index c3e891b39..13a8b94b1 100644 --- a/src/pyquickhelper/helpgen/process_notebooks.py +++ b/src/pyquickhelper/helpgen/process_notebooks.py @@ -387,7 +387,7 @@ def _process_notebooks_in(notebooks, outfold, build, latex_path=None, pandoc_pat list_args.extend(['--config', '"%s"' % custom_config, '--SphinxTransformer.author=""', '--SphinxTransformer.overridetitle="{0}"'.format(title)]) - format = "elatex" + format = "latex" compilation = True thisfiles.append(os.path.splitext(outputfile)[0] + ".tex") elif format in ("latex", "elatex"): @@ -395,7 +395,7 @@ def _process_notebooks_in(notebooks, outfold, build, latex_path=None, pandoc_pat raise FileNotFoundError(custom_config) list_args.extend(['--config', '"%s"' % custom_config]) compilation = False - format = "elatex" + format = "latex" elif format in ("word", "docx"): format = "html" compilation = False @@ -409,7 +409,7 @@ def _process_notebooks_in(notebooks, outfold, build, latex_path=None, pandoc_pat compilation = False # output - templ = {'html': 'full', 'latex': 'article'}.get(format, format) + templ = {'html': 'full', 'latex': 'article', 'elatex': 'article'}.get(format, format) fLOG("[_process_notebooks_in] ### convert into ", format_, " NB: ", notebook, " ### ", os.path.exists(outputfile), ":", outputfile) @@ -458,8 +458,8 @@ def _process_notebooks_in(notebooks, outfold, build, latex_path=None, pandoc_pat out, err = _process_notebooks_in_private_cmd( fnbcexe, list_args, options_args, fLOG) - if "raise ImportError" in err: - raise ImportError(err) + if "raise ImportError" in err or "Unknown exporter" in err: + raise ImportError("cmd: {0} {1}\n--ERR--\n{2}".format(fnbcexe, list_args, err)) if len(err) > 0: if format in ("elatex", "latex"): # There might be some errors because the latex script needs to be post-processed diff --git a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py index 17cbd9f92..b82453629 100644 --- a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py +++ b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py @@ -9,8 +9,9 @@ from collections import deque import warnings import pickle +from sphinx.deprecation import RemovedInSphinx30Warning from sphinx.locale import _ -from docutils.parsers.rst import directives, roles +from docutils.parsers.rst import directives, roles, convert_directive_function from docutils.languages import en as docutils_en from sphinx.writers.html import HTMLWriter from sphinx.application import Sphinx, ENV_PICKLE_FILENAME @@ -1281,13 +1282,18 @@ def __init__(self, srcdir, confdir, outdir, doctreedir, buildername="memoryhtml" # read config self.tags = Tags(tags) - self.config = Config(confdir, CONFIG_FILENAME, - confoverrides or {}, self.tags) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RemovedInSphinx30Warning) + self.config = Config(confdir, CONFIG_FILENAME, + confoverrides or {}, self.tags) self.sphinx__display_version__ = __display_version__ # create the environment self.env = _CustomBuildEnvironment(self) - self.config.check_unicode() + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RemovedInSphinx30Warning) + warnings.simplefilter("ignore", ImportWarning) + self.config.check_unicode() self.config.pre_init_values() # set up translation infrastructure @@ -1387,7 +1393,9 @@ def __init__(self, srcdir, confdir, outdir, doctreedir, buildername="memoryhtml" # create the builder self.builder = self.create_builder(buildername) # check all configuration values for permissible types - self.config.check_types() + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RemovedInSphinx30Warning) + self.config.check_types() # set up the build environment self._init_env(freshenv) # set up the builder @@ -1511,7 +1519,11 @@ def add_directive(self, name, obj, content=None, arguments=None, override=False, 'already registered, it will be overridden'), self._setting_up_extension[-1], name, type='app', subtype='add_directive') - directive = directive_helper(obj, content, arguments, **options) + + obj.content = content # type: ignore + obj.arguments = arguments or (0, 0, False) # type: ignore + obj.options = options # type: ignore + directive = convert_directive_function(obj) directives.register_directive(name, directive) def add_domain(self, domain, override=False): diff --git a/src/pyquickhelper/helpgen/sphinxm_mock_app.py b/src/pyquickhelper/helpgen/sphinxm_mock_app.py index 4657ed085..7a89f517f 100644 --- a/src/pyquickhelper/helpgen/sphinxm_mock_app.py +++ b/src/pyquickhelper/helpgen/sphinxm_mock_app.py @@ -5,6 +5,7 @@ .. versionadded:: 1.0 """ import logging +import warnings from docutils import nodes from docutils.parsers.rst.directives import directive as rst_directive from docutils.parsers.rst import directives as doc_directives, roles as doc_roles @@ -14,6 +15,7 @@ from sphinx.application import VersionRequirementError from sphinx.util.docutils import is_html5_writer_available from sphinx.errors import ExtensionError +from sphinx.deprecation import RemovedInSphinx30Warning from .sphinxm_convert_doc_sphinx_helper import HTMLWriterWithCustomDirectives, _CustomSphinx from .sphinxm_convert_doc_sphinx_helper import MDWriterWithCustomDirectives, RSTWriterWithCustomDirectives, LatexWriterWithCustomDirectives from ..sphinxext import get_default_extensions @@ -50,7 +52,9 @@ def __init__(self, writer, app, confoverrides, new_extensions=None): "": "only", } self.mapping_connect = {} - self.config = Config(None, None, confoverrides, None) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RemovedInSphinx30Warning) + self.config = Config(None, None, confoverrides, None) self.confdir = "." self.doctreedir = "." self.srcdir = "." @@ -257,14 +261,17 @@ def add_source_parser(self, ext, parser, exc=False): app.add_source_parser(self, ext, parser) """ - try: - self.app.add_source_parser(ext, parser) - except ExtensionError as e: - if exc: - raise - else: - logger = logging.getLogger("MockSphinxApp") - logger.warning('[MockSphinxApp] {0}'.format(e)) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + + try: + self.app.add_source_parser(ext, parser) + except ExtensionError as e: + if exc: + raise + else: + logger = logging.getLogger("MockSphinxApp") + logger.warning('[MockSphinxApp] {0}'.format(e)) def disconnect_env_collector(self, clname): """ diff --git a/src/pyquickhelper/pycode/default_filter_warning.py b/src/pyquickhelper/pycode/default_filter_warning.py index 30707fab1..dda4e5f0a 100644 --- a/src/pyquickhelper/pycode/default_filter_warning.py +++ b/src/pyquickhelper/pycode/default_filter_warning.py @@ -18,10 +18,12 @@ def default_filter_warning(w): class UnusedException(Exception): pass - try: - from matplotlib.cbook import MatplotlibDeprecationWarning - except ImportError: - MatplotlibDeprecationWarning = UnusedException + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + try: + from matplotlib.cbook import MatplotlibDeprecationWarning + except ImportError: + MatplotlibDeprecationWarning = UnusedException if isinstance(w.message, RuntimeWarning): if "_bootstrap.py" in w.filename: diff --git a/src/pyquickhelper/sphinxext/_sphinx_common_builder.py b/src/pyquickhelper/sphinxext/_sphinx_common_builder.py index bb37d97e3..76da919d5 100644 --- a/src/pyquickhelper/sphinxext/_sphinx_common_builder.py +++ b/src/pyquickhelper/sphinxext/_sphinx_common_builder.py @@ -87,7 +87,8 @@ def base_visit_image(self, node, image_dest=None): full = os.path.join(srcdir, atts['src']) if srcdir else atts['src'] if not os.path.exists(full): raise FileNotFoundError( - "Unable to find source file '{0}' for docname '{1}'".format(full, atts['src'])) + "Unable to find source file '{0}' for docname '{1}', srcdir='{2}' src='{3}'".format( + full, atts['src'], srcdir, atts['src'])) ext = os.path.splitext(atts['src'])[-1] name = self.hash_md5_readfile(full) + ext diff --git a/src/pyquickhelper/sphinxext/bokeh/bokeh_plot.py b/src/pyquickhelper/sphinxext/bokeh/bokeh_plot.py index 57d0440ae..f77037062 100644 --- a/src/pyquickhelper/sphinxext/bokeh/bokeh_plot.py +++ b/src/pyquickhelper/sphinxext/bokeh/bokeh_plot.py @@ -69,6 +69,7 @@ """ from __future__ import absolute_import +import warnings import ast from os.path import basename, dirname, join import re @@ -80,6 +81,7 @@ from sphinx.errors import SphinxError from sphinx.util import console, copyfile, ensuredir, status_iterator from sphinx.util.nodes import set_source_info +from sphinx.deprecation import RemovedInSphinx30Warning from bokeh.settings import settings from bokeh.resources import Resources @@ -336,7 +338,9 @@ def setup(app): """ sphinx config variable to scan .py files in provided directories only """ app.add_config_value('bokeh_plot_pyfile_include_dirs', [], 'html') - app.add_source_parser('.py', PlotScriptParser) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", RemovedInSphinx30Warning) + app.add_source_parser('.py', PlotScriptParser) app.add_directive('bokeh-plot', BokehPlotDirective) diff --git a/src/pyquickhelper/sphinxext/sphinx_md_builder.py b/src/pyquickhelper/sphinxext/sphinx_md_builder.py index 9094439ce..d7657541f 100644 --- a/src/pyquickhelper/sphinxext/sphinx_md_builder.py +++ b/src/pyquickhelper/sphinxext/sphinx_md_builder.py @@ -894,9 +894,6 @@ def clean_refuri(uri): (anchor, clean_refuri(node['refuri']))) raise nodes.SkipNode elif 'reftitle' in node: - # Include node as text, rather than with markup. - # reST seems unable to parse a construct like ` ``literal`` `_ - # Hence it reverts to the more simple `literal `_ self.add_text('[%s](%s)' % (node.astext(), clean_refuri(node['refuri']))) # self.end_state(wrap=False) @@ -1036,11 +1033,11 @@ def depart_collapse_node(self, node): depart_collapse_node_rst(self, node) def visit_issue(self, node): - self.add_text(':issue:`') + self.add_text('(issue *') self.add_text(node['text']) def depart_issue(self, node): - self.add_text('`') + self.add_text('*)') def eval_expr(self, expr): md = True