Comment 2 for bug 1876343

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstackdocstheme (master)

Reviewed: https://review.opendev.org/724897
Committed: https://git.openstack.org/cgit/openstack/openstackdocstheme/commit/?id=0b1eeda688c6b5e286c283a1fca1f6c92cac810a
Submitter: Zuul
Branch: master

commit 0b1eeda688c6b5e286c283a1fca1f6c92cac810a
Author: Stephen Finucane <email address hidden>
Date: Fri May 1 17:56:18 2020 +0100

    css: Namespace Pygments stylesheet

    The 'native.css' stylesheet is the stylesheet used by Pygments. The
    stylesheet defines a number of classes that map to the shortname of the
    tokens generated by Pygments. By default, these classes are not
    "namespaced" or prefixed by less generic selector. This is a problem
    since Sphinx 3.x has started using at least one class name that
    conflicts with one of the class names in Pygments, '.py'.

    Sphinx itself has solved this for quite some time by doing this
    "namespacing" and prepending the '.highlight' selector [1], which is the
    default class name used by Pygments' 'HTMLFormatter' formatter. Do the
    same thing ourselves by regenerating the Pygments stylesheet as
    described in the Pygments documentation [2]:

      pygmentize -f html -S native -a .highlight > native.css

    [1] https://github.com/sphinx-doc/sphinx/blob/v3.0.0/sphinx/highlighting.py#L163
    [2] https://pygments.org/docs/cmdline/#generating-styles

    Change-Id: I97731149d72b74fc4a92c0f5108c7a676f834fb8
    Signed-off-by: Stephen Finucane <email address hidden>
    Closes-Bug: #1876343