From a5d0a2d5b7588552a14377711b48b838397bce2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?xavier=20dupr=C3=A9?= Date: Mon, 15 Feb 2021 11:30:39 +0100 Subject: [PATCH] Fixes for sphinx 3.5 --- _unittests/ut_sphinxext/test_latex_builder.py | 3 ++- .../helpgen/sphinxm_convert_doc_sphinx_helper.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/_unittests/ut_sphinxext/test_latex_builder.py b/_unittests/ut_sphinxext/test_latex_builder.py index f71de23f7..4150c049e 100644 --- a/_unittests/ut_sphinxext/test_latex_builder.py +++ b/_unittests/ut_sphinxext/test_latex_builder.py @@ -171,7 +171,8 @@ def test_latex_builder_sphinx_table(self): raise Exception(html) t1 = "a&b1" - if t1 not in html.replace("\n", ""): + t1b = "a&\\sphinxAtStartParb1" # sphinx 3.5 + if t1 not in html.replace("\n", "") and t1b not in html.replace("\n", ""): raise Exception(html) t1 = "\\begin{tabulary}{\\linewidth}[t]{|T|T|}" diff --git a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py index 07e88e5f8..ce02117e3 100644 --- a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py +++ b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py @@ -158,9 +158,18 @@ def depart_only(self, node): # The program should not necessarily be here. pass + def visit_viewcode_anchor(self, node): + # Removed in sphinx 3.5 + pass + + def depart_viewcode_anchor(self, node): + # Removed in sphinx 3.5 + pass + def unknown_visit(self, node): # pragma: no cover - raise NotImplementedError("[_AdditionalVisitDepart] Unknown node: '{0}' in '{1}'".format( - node.__class__.__name__, self.__class__.__name__)) + raise NotImplementedError( + "[_AdditionalVisitDepart] Unknown node: '{0}' in '{1}'".format( + node.__class__.__name__, self.__class__.__name__)) class HTMLTranslatorWithCustomDirectives(_AdditionalVisitDepart, HTMLTranslator):