Browse Source

doc: make the color literal swatch patching work with vanilla Pygments.

pull/650/head
Vladimír Vondruš 2 years ago
parent
commit
29633932ad
  1. 4
      doc/changelog.dox
  2. 8
      doc/conf.py

4
doc/changelog.dox

@ -1410,6 +1410,10 @@ See also:
data to slices of @ref Text::AbstractGlyphCache::image() instead and data to slices of @ref Text::AbstractGlyphCache::image() instead and
call @relativeref{Text::AbstractGlyphCache,flushImage()} instead. The call @relativeref{Text::AbstractGlyphCache,flushImage()} instead. The
old API can only be called on 2D glyph caches now. old API can only be called on 2D glyph caches now.
- @cpp Text::DistanceFieldGlyphCache::distanceFieldTextureSize() @ce and
@cpp setDistanceFieldImage() @ce is deprecated in favor of
@ref Text::AbstractGlyphCache::processedSize() and
@relativeref{Text,AbstractGlyphCache,setProcessedImage()}
- The @cpp TextureTools::atlas() @ce utility is deprecated in favor of - The @cpp TextureTools::atlas() @ce utility is deprecated in favor of
@ref TextureTools::AtlasLandfill, which has a vastly better packing @ref TextureTools::AtlasLandfill, which has a vastly better packing
efficiency, supports incremental packing and doesn't force the caller to efficiency, supports incremental packing and doesn't force the caller to

8
doc/conf.py

@ -38,7 +38,13 @@ FAVICON = 'favicon.ico'
VERSION_LABELS = True VERSION_LABELS = True
_magnum_colors_src = re.compile(r"""<span class="mh">0x(?P<hex>[0-9a-f]{6})(?P<alpha>[0-9a-f]{2})?(?P<literal>_s?rgba?f?)</span>""") # There used to be a Pygments patch that would recognize the suffix as part of
# the literal, https://github.com/pygments/pygments/pull/1303, but it fell
# though the cracks and I was unable to resubmit it again. So this patch adds
# both the color swatch and removes the </span><span class="n> in between.
# TODO either resubmit the patch or do this patching also for all others (_deg,
# _rad, _sec, _nsec, ...)
_magnum_colors_src = re.compile(r"""<span class="mh">0x(?P<hex>[0-9a-f]{6})(?P<alpha>[0-9a-f]{2})?(</span><span class="n">)?(?P<literal>_s?rgba?f?)</span>""")
_magnum_colors_dst = r"""<span class="mh">0x\g<hex>\g<alpha>\g<literal><span class="m-code-color" style="background-color: #\g<hex>;"></span></span>""" _magnum_colors_dst = r"""<span class="mh">0x\g<hex>\g<alpha>\g<literal><span class="m-code-color" style="background-color: #\g<hex>;"></span></span>"""
# Code wrapped in DOXYGEN_ELLIPSIS() will get replaced by an (Unicode) ellipsis # Code wrapped in DOXYGEN_ELLIPSIS() will get replaced by an (Unicode) ellipsis

Loading…
Cancel
Save