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
Reviewed: https:/ /review. opendev. org/724897 /git.openstack. org/cgit/ openstack/ openstackdocsth eme/commit/ ?id=0b1eeda688c 6b5e286c283a1fc a1f6c92cac810a
Committed: https:/
Submitter: Zuul
Branch: master
commit 0b1eeda688c6b5e 286c283a1fca1f6 c92cac810a
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 /pygments. org/docs/ cmdline/ #generating- styles
[2] https:/
Change-Id: I97731149d72b74 fc4a92c0f5108c7 a676f834fb8
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1876343