From c73ec14c4a1f267a20f07ed9dce03c233a33de83 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Tue, 16 Jul 2024 10:06:43 +0200 Subject: [PATCH] update --- .github/workflows/test-formats.yml | 45 +++++++++++++----------------- myst_parser/sphinx_ext/main.py | 9 ++++-- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test-formats.yml b/.github/workflows/test-formats.yml index 21f3e208..59ffda70 100644 --- a/.github/workflows/test-formats.yml +++ b/.github/workflows/test-formats.yml @@ -51,31 +51,26 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[linkify,rtd] - - name: replace emoji - # TODO getting: Missing character: There is no 🚀 (U+1F680) in font [FreeSansBold.otf] - run: | - sed -i 's/🚀 /-/g' docs/intro.md - sed -i 's/⚡ /-/g' docs/live-preview.md - name: Build docs run: | sphinx-build -nW --keep-going -b ${{ matrix.format }} docs/ docs/_build/${{ matrix.format }} - - - name: Make PDF - uses: xu-cheng/latex-action@v2 - with: - working_directory: docs/_build/latex - root_file: "mystparser.tex" - # https://github.com/marketplace/actions/github-action-for-latex#it-fails-due-to-xindy-cannot-be-found - pre_compile: | - ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy - ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy - wget https://sourceforge.net/projects/xindy/files/xindy-source-components/2.4/xindy-kernel-3.0.tar.gz - tar xf xindy-kernel-3.0.tar.gz - cd xindy-kernel-3.0/src - apk add make - apk add clisp --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community - make - cp -f xindy.mem /opt/texlive/texdir/bin/x86_64-linuxmusl/ - cd ../../ - env: - XINDYOPTS: -L english -C utf8 -M sphinx.xdy + # TODO https://github.com/sphinx-doc/sphinx/issues/12594 + # - name: Make PDF + # uses: xu-cheng/latex-action@v2 + # with: + # working_directory: docs/_build/latex + # root_file: "mystparser.tex" + # # https://github.com/marketplace/actions/github-action-for-latex#it-fails-due-to-xindy-cannot-be-found + # pre_compile: | + # ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy + # ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy + # wget https://sourceforge.net/projects/xindy/files/xindy-source-components/2.4/xindy-kernel-3.0.tar.gz + # tar xf xindy-kernel-3.0.tar.gz + # cd xindy-kernel-3.0/src + # apk add make + # apk add clisp --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community + # make + # cp -f xindy.mem /opt/texlive/texdir/bin/x86_64-linuxmusl/ + # cd ../../ + # env: + # XINDYOPTS: -L english -C utf8 -M sphinx.xdy diff --git a/myst_parser/sphinx_ext/main.py b/myst_parser/sphinx_ext/main.py index c6945f22..259ab0a9 100644 --- a/myst_parser/sphinx_ext/main.py +++ b/myst_parser/sphinx_ext/main.py @@ -2,6 +2,7 @@ from typing import Any +import sphinx from docutils import nodes from sphinx.application import Sphinx @@ -42,9 +43,11 @@ def setup_sphinx(app: Sphinx, load_parser: bool = False) -> None: # override only the html writer visit methods for rubric, to use the "level" attribute # this allows for nested headers to be correctly rendered - app.add_node( - nodes.rubric, override=True, html=(visit_rubric_html, depart_rubric_html) - ) + if sphinx.version_info < (7, 4): + # This is now added in sphinx: https://github.com/sphinx-doc/sphinx/pull/12506 + app.add_node( + nodes.rubric, override=True, html=(visit_rubric_html, depart_rubric_html) + ) # override only the html writer visit methods for container, # to remove the "container" class for divs # this avoids CSS clashes with the bootstrap theme