Files
ServerSync/lib/pygments/formatters/__pycache__/svg.cpython-314.pyc

114 lines
9.1 KiB
Plaintext
Raw Normal View History

2026-02-12 02:28:23 +02:00
+
<00> <0C>i<EFBFBD><00><00>X<00>Rt^RIHt^RIHt^RIHtHtR.tRt /t
!RR]4t R#)z<>
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
)<01> Formatter)<01>Comment)<02> get_bool_opt<70> get_int_opt<70> SvgFormatterc<04><><00>VPRR4PRR4PRR4PRR4PR R
4#) z<Escape &, <, > as well as single and double quotes for HTML.<2E>&z&amp;<3B><z&lt;<3B>>z&gt;<3B>"z&quot;<3B>'z&#39;)<01>replace)<01>texts&<26>>/tmp/pip-target-qd_sq_1j/lib/python/pygments/formatters/svg.py<70> escape_htmlrsE<00><00> <0F><<3C><<3C><03>W<EFBFBD> %<25><17><07><03>V<EFBFBD>$<24><17><07><03>V<EFBFBD>$<24><17><07><03>X<EFBFBD>&<26><17><07><03>W<EFBFBD>%<25> &<26>c<00>Fa<00>]tRt^toRtRtR.tR.tRtRt Rt
Rt Vt R #)
rad
Format tokens as an SVG graphics file. This formatter is still experimental.
Each line of code is a ``<text>`` element with explicit ``x`` and ``y``
coordinates containing ``<tspan>`` elements with the individual token styles.
By default, this formatter outputs a full SVG document including doctype
declaration and the ``<svg>`` root element.
.. versionadded:: 0.9
Additional options accepted:
`nowrap`
Don't wrap the SVG ``<text>`` elements in ``<svg><g>`` elements and
don't add a XML declaration and a doctype. If true, the `fontfamily`
and `fontsize` options are ignored. Defaults to ``False``.
`fontfamily`
The value to give the wrapping ``<g>`` element's ``font-family``
attribute, defaults to ``"monospace"``.
`fontsize`
The value to give the wrapping ``<g>`` element's ``font-size``
attribute, defaults to ``"14px"``.
`linenos`
If ``True``, add line numbers (default: ``False``).
`linenostart`
The line number for the first line (default: ``1``).
`linenostep`
If set to a number n > 1, only every nth line number is printed.
`linenowidth`
Maximum width devoted to line numbers (default: ``3*ystep``, sufficient
for up to 4-digit line numbers. Increase width for longer code blocks).
`xoffset`
Starting offset in X direction, defaults to ``0``.
`yoffset`
Starting offset in Y direction, defaults to the font size if it is given
in pixels, or ``20`` else. (This is necessary since text coordinates
refer to the text baseline, not the top edge.)
`ystep`
Offset to add to the Y coordinate for each subsequent line. This should
roughly be the text size plus 5. It defaults to that value if the text
size is given in pixels, or ``25`` else.
`spacehack`
Convert spaces in the source to ``&#160;``, which are non-breaking
spaces. SVG provides the ``xml:space`` attribute to control how
whitespace inside tags is handled, in theory, the ``preserve`` value
could be used to keep all whitespace as-is. However, many current SVG
viewers don't obey that rule, so this option is provided as a workaround
and defaults to ``True``.
<EFBFBD>SVG<56>svgz*.svgc <08><><00>\P!V3/VB\VRR4VnVP RR4VnVP RR4Vn\VR^4VnVP P4pVPR4'dVRRP4p\V4p\VR V4Vn \VR
V^,4Vn\VR R 4Vn\VR R4Vn\VR^4Vn\VR^4Vn\VR^VP,4Vn/VnR# \d^pL<>i;i)<12>nowrapF<70>
fontfamily<EFBFBD> monospace<63>fontsize<7A>14px<70>xoffset<65>pxN<78>yoffset<65>ystep<65> spacehackT<6B>linenos<6F> linenostart<72>
linenostep<EFBFBD> linenowidth<74><68><EFBFBD><EFBFBD><EFBFBD>)r<00>__init__rr<00>getrrrr<00>strip<69>endswith<74>int<6E>
ValueErrorrrrr r!r"r#<00> _stylecache)<04>self<6C>options<6E>fs<66>int_fss&, rr%<00>SvgFormatter.__init__]s7<00><00><11><1A><1A>4<EFBFBD>+<2B>7<EFBFBD>+<2B>"<22>7<EFBFBD>H<EFBFBD>e<EFBFBD><<3C><04> <0B>!<21>+<2B>+<2B>l<EFBFBD>K<EFBFBD>@<40><04><0F><1F> <0B> <0B>J<EFBFBD><06>7<><04> <0A>"<22>7<EFBFBD>I<EFBFBD>q<EFBFBD>9<><04> <0C> <11>]<5D>]<5D> <20> <20> "<22><02> <0A>;<3B>;<3B>t<EFBFBD> <1C> <1C><13>C<EFBFBD>R<EFBFBD><17><1D><1D><1F>B<EFBFBD> <18><18><12>W<EFBFBD>F<EFBFBD>#<23>7<EFBFBD>I<EFBFBD>v<EFBFBD>><3E><04> <0C> <20><17>'<27>6<EFBFBD>A<EFBFBD>:<3A>><3E><04>
<EFBFBD>%<25>g<EFBFBD>{<7B>D<EFBFBD>A<><04><0E>#<23>G<EFBFBD>I<EFBFBD>e<EFBFBD><<3C><04> <0C>&<26>w<EFBFBD>}<7D>Q<EFBFBD>?<3F><04><18>%<25>g<EFBFBD>l<EFBFBD>1<EFBFBD>=<3D><04><0F>&<26>w<EFBFBD>}<7D>a<EFBFBD><04>
<EFBFBD>
<EFBFBD>l<EFBFBD>K<><04><18><1D><04><18><><1A> <18><17>F<EFBFBD> <18>s<00>/ E<00> E)<03>(E)c  <0C>t<00>VPpVPpVP'g<>VP'd!VP RVP R24MVP R4VP R4VP R4VP RVP
RVP R24VPpVPpVP\4pTpVP'dhWV,^8Xd/VP R W0P, R
V R V R V R 2 4W<>PVP,, pV^, pVP R V R
V R24VEFwr<>VPV 4p T ;'dRV ,R,;'gRp T ;'d R;'gRp \V
4p
VP'd!V
P!4P#RR4p
V
P%R4pVRRF<>pVP W<>,V ,4W@P, pVP R4VP'd<WV,^8Xd/VP R W0P, R
V RV RV R 2 4V^, pVP R V R
V R24K<> VP W<>R,,V ,4EK<> VP R 4VP'gVP R4R#R#)z<>
Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
tuples and write it into ``outfile``.
For our implementation we put all lines in their own 'line group'.
z<?xml version="1.0" encoding="z"?>
z<?xml version="1.0"?>
zk<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
z)<svg xmlns="http://www.w3.org/2000/svg">
z<g font-family="z " font-size="z">
z <text x="z" y="z" z text-anchor="end">z</text>z" xml:space="preserve">z<tspanr
<00>z</tspan><3E> z&#160;<3B>
Nz</text>
z" text-anchor="end" z </g></svg>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)rrr<00>encoding<6E>writerrr!r"<00>
_get_stylerr r#rrr<00>
expandtabsr <00>split)r,<00> tokensource<63>outfile<6C>x<>y<>counter<65> counter_step<65> counter_style<6C>line_x<5F>ttype<70>value<75>style<6C>tspan<61>tspanend<6E>parts<74>parts&&& r<00>format_unencoded<65>SvgFormatter.format_unencodedss<><00><00> <11>L<EFBFBD>L<EFBFBD><01> <10>L<EFBFBD>L<EFBFBD><01><13>{<7B>{<7B>{<7B><13>}<7D>}<7D>}<7D><17> <0A> <0A> ><3E>t<EFBFBD>}<7D>}<7D>o<EFBFBD>U<EFBFBD>S<>T<><17> <0A> <0A>7<>8<> <13>M<EFBFBD>M<EFBFBD>*<2A> +<2B> <14>M<EFBFBD>M<EFBFBD>F<> G<> <13>M<EFBFBD>M<EFBFBD>,<2C>T<EFBFBD>_<EFBFBD>_<EFBFBD>,=<3D>]<5D>4<EFBFBD>=<3D>=<3D>/<2F>Y]<5D>^<5E> _<><16>"<22>"<22><07><1B><EFBFBD><EFBFBD> <0C><1C><0F><0F><07>0<> <0A><12><06> <0F><<3C><<3C><<3C><16>%<25><11>*<2A><17> <0A> <0A> <09>!<21>,<<3C>,<<3C>*<<3C>)=<3D>U<EFBFBD>1<EFBFBD>#<23>R<EFBFBD> <0A><EFBFBD>Vi<56>jq<6A>ir<69>ry<72>z<>{<7B> <12>&<26>&<26><14><1A><1A>3<> 3<>F<EFBFBD> <13>q<EFBFBD>L<EFBFBD>G<EFBFBD><0F> <0A> <0A> <09>&<26><18><15>q<EFBFBD>c<EFBFBD>1H<31>I<>J<>'<27>L<EFBFBD>E<EFBFBD><18>O<EFBFBD>O<EFBFBD>E<EFBFBD>*<2A>E<EFBFBD><19>4<>4<>h<EFBFBD><15>.<2E><13>4<>:<3A>:<3A><02>E<EFBFBD><1C>+<2B>+<2B><1A>1<>1<>r<EFBFBD>H<EFBFBD><1F><05>&<26>E<EFBFBD><13>~<7E>~<7E>~<7E><1D>(<28>(<28>*<2A>2<>2<>3<EFBFBD><08>A<><05><19>K<EFBFBD>K<EFBFBD><04>%<25>E<EFBFBD><1D>c<EFBFBD>r<EFBFBD>
<EFBFBD><04><17> <0A> <0A>e<EFBFBD>l<EFBFBD>X<EFBFBD>5<>6<><11>Z<EFBFBD>Z<EFBFBD><0F><01><17> <0A> <0A>k<EFBFBD>*<2A><17><<3C><<3C><<3C>G<EFBFBD>$:<3A>a<EFBFBD>$?<3F><1B>M<EFBFBD>M<EFBFBD>I<EFBFBD>a<EFBFBD>0@<40>0@<40>.@<40>-A<><15>q<EFBFBD>c<EFBFBD>I]<5D>^k<>]l<>lm<6C>nu<6E>mv<6D>v}<7D>"~<7E><><17>1<EFBFBD> <0C><07><17> <0A> <0A> <09>&<26><18><15>q<EFBFBD>c<EFBFBD>9T<39>T<>U<>#<23> <14>M<EFBFBD>M<EFBFBD>%<25><02>)<29>+<2B>h<EFBFBD>6<> 7<>#(<28>$ <10> <0A> <0A>i<EFBFBD> <20><13>{<7B>{<7B>{<7B> <13>M<EFBFBD>M<EFBFBD>.<2E> )<29>rc<08><><00>WP9dVPV,#TpVPPV4'gVPpK/VPP V4pRpVR,'dRVR,,R,pVR,'d
VR, pVR,'d
VR, pW@PV&V#)r2<00>colorz fill="#r <00>boldz font-weight="bold"<22>italicz font-style="italic")r+rE<00> styles_token<65>parent<6E>style_for_token)r,<00> tokentype<70>
otokentyperD<00>results&& rr8<00>SvgFormatter._get_style<6C>s<><00><00> <14>(<28>(<28> (<28><17>#<23>#<23>I<EFBFBD>.<2E> .<2E><1E>
<EFBFBD><16>*<2A>*<2A>)<29>)<29>)<29>4<>4<>!<21>(<28>(<28>I<EFBFBD><14>
<EFBFBD>
<EFBFBD>*<2A>*<2A>9<EFBFBD>5<><05><13><06> <10><17>><3E>><3E><1F>%<25><07>.<2E>0<>3<EFBFBD>6<>F<EFBFBD> <10><16>=<3D>=<3D> <12>+<2B> +<2B>F<EFBFBD> <10><18>?<3F>?<3F> <12>,<2C> ,<2C>F<EFBFBD>'-<2D><18><18><1A>$<24><15> r) r+rrr r!r"r#rrrrrN) <0A>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__firstlineno__<5F>__doc__<5F>name<6D>aliases<65> filenamesr%rJr8<00>__static_attributes__<5F>__classdictcell__)<01> __classdict__s@rrrs5<00><><00><00>:<08>v <11>D<EFBFBD><14>g<EFBFBD>G<EFBFBD><18> <09>I<EFBFBD><1E>,5*<2A>n<16>rN) r[<00>pygments.formatterr<00>pygments.tokenr<00> pygments.utilrr<00>__all__r<00> class2styler<00>rr<00><module>rhs7<00><01><04>)<29>"<22>3<> <19>
<1A><07>&<26><11> <0B>\<16>9<EFBFBD>\r