Ë ›Yç1ª­Ã·ãóV—dZddlmZddlmZddlmZmZdgZd„Z iZ Gd„de«Z y) zÌ pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. é)Ú Formatter)ÚComment)Ú get_bool_optÚ get_int_optÚ SvgFormattercó¦—|jdd«jdd«jdd«jdd«jd d «S) z as well as single and double quotes for HTML.Ú&z&Úz>Ú"z"Ú'z')Úreplace)Útexts ú`` element with explicit ``x`` and ``y`` coordinates containing ```` elements with the individual token styles. By default, this formatter outputs a full SVG document including doctype declaration and the ```` root element. .. versionadded:: 0.9 Additional options accepted: `nowrap` Don't wrap the SVG ```` elements in ```` 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 ```` element's ``font-family`` attribute, defaults to ``"monospace"``. `fontsize` The value to give the wrapping ```` 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 `` ``, 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``. ÚSVGÚsvgz*.svgc�������������� ���ó¤��—�t��������j������������������|�fi�|¤Ž�t��������|dd«������|�_��������|j ������������������dd«������|�_��������|j ������������������dd«������|�_��������t��������|dd«������|�_��������|�j ������������������j������������������«�������}|j������������������d «������r|d�d �j������������������«�������} �t��������|«������}t��������|d |«������|�_ ��������t��������|d |dz���«������|�_ ��������t��������|dd«������|�_��������t��������|dd«������|�_��������t��������|dd«������|�_��������t��������|dd«������|�_��������t��������|dd|�j������������������z��«������|�_��������i�|�_��������y�#��d }Y�ŒœxY�w)NÚnowrapFÚ fontfamilyÚ monospaceÚfontsizeÚ14pxÚxoffsetr���Úpxéþÿÿÿé���ÚyoffsetÚystepé���Ú spacehackTÚlinenosÚ linenostarté���Ú linenostepÚ linenowidthé���)r���Ú__init__r���r���Úgetr���r���r���r���ÚstripÚendswithÚintr ���r!���r#���r$���r%���r'���r(���Ú _stylecache)ÚselfÚoptionsÚfsÚint_fss��� r���r*���zSvgFormatter.__init__]���s)��€�Ü×ј4Ñ+ 7Ò+Ü" 7¨H°eÓ<ˆŒ Ø!Ÿ+™+ l°KÓ@ˆŒØŸ ™  J°Ó7ˆŒ Ü" 7¨I°qÓ9ˆŒ Ø �]‰]× Ñ Ó "ˆØ �;‰;�tÔ  2 c r 7§=¡=£?˜bð ܘ“WˆFô�# 7¨I°vÓ>ˆŒ Ü  ¨'°6¸A±:Ó>ˆŒ Ü% g¨{¸DÓAˆŒÜ# G¨I°eÓ<ˆŒ Ü& w¨}¸QÓ?ˆÔÜ% g¨l¸1Ó=ˆŒÜ& w¨}¸aÀÇ Á ¹lÓKˆÔØˆÕøð ØŠFús ���Â( E �Å Ec����������� ������óx��—�|�j�������������������}|�j������������������}|�j������������������sŠ|�j������������������r|j ������������������d|�j������������������z��«�������n|j ������������������d«�������|j ������������������d«�������|j ������������������d«�������|j ������������������d|�j ������������������›d|�j ������������������›d�«�������|�j������������������}|�j������������������}|�j������������������t��������«������}|}|�j������������������rT||z��dk(��r+|j ������������������d ||�j������������������z���›d |›d |›d |›d � «�������||�j������������������|�j������������������z���z ��}|dz ��}|j ������������������d |›d |›d�«�������|D��]0��\��} } |�j������������������| «������} | xr�d| z���dz���xs�d} | xr�dxs�d} t��������| «������} |�j������������������r | j!������������������«�������j#������������������dd«������} | j%������������������d«������}|dd�D�]•��}|j ������������������| |z���| z���«�������||�j������������������z ��}|j ������������������d«�������|�j������������������r3||z��dk(��r+|j ������������������d ||�j������������������z���›d |›d|›d|›d � «�������|dz ��}|j ������������������d |›d |›d�«�������Œ—�|j ������������������| |d���z���| z���«��������Œ3�|j ������������������d «�������|�j������������������s|j ������������������d«�������yy)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$ z zk z) z r���z zr&���z" xml:space="preserve">zÚ z Ú Néÿÿÿÿz z" text-anchor="end" z )rr rÚencodingÚwriterrr%r'Ú _get_stylerr$r(r!rr#Ú expandtabsrÚsplit)r0Ú tokensourceÚoutfileÚxÚyÚcounterÚ counter_stepÚ counter_styleÚline_xÚttypeÚvalueÚstyleÚtspanÚtspanendÚpartsÚparts rÚformat_unencodedzSvgFormatter.format_unencodedrsy€ð �L‰LˆØ �L‰LˆØ�{Š{Ø�}Š}Ø— ‘ ÐEØ"Ÿm™mñ,õ-ð— ‘ Ð7Ô8Ø �M‰Mð*ô +ð �M‰MÐFÔ GØ �MŠMØŸ?›?¨D¯M«Mð;ô <ð×"Ñ"ˆØ—‘ˆ ØŸ™¬Ó0ˆ ؈à �<Š<ؘÑ%¨Ò*Ø— ’ Ø�t×'Ñ'Ó'ªª-ºðAôBà �d×&Ñ&¨¯©Ñ3Ñ 3ˆFØ �q‰LˆGà� Š ÂVÊQÐOÔPÜ'‰LˆE�5Ø—O‘O EÓ*ˆEØÒ4˜h¨Ñ.°Ñ4Ò:¸ˆEØÒ+ Ò1¨rˆHÜ Ó&ˆEØ�~Š~Ø×(Ñ(Ó*×2Ñ2°3¸ÓA�Ø—K‘K Ó%ˆEؘc˜r› �Ø— ‘ ˜e d™l¨XÑ5Ô6Ø�T—Z‘Z‘�Ø— ‘ ˜kÔ*Ø—<’< G¨lÑ$:¸aÒ$?Ø—M’Mؘ4×+Ñ+Ó+ªAªmºGð#EôFð˜1‘ �Ø— ’ ÒPVÒWXÐYÕZð#ð �M‰M˜% %¨¡)Ñ+¨hÑ6Ö 7ð%(ð& � ‰ �iÔ à�{Š{Ø �M‰M˜.Õ )ðrcój—||jvr|j|S|}|jj|«s(|j}|jj|«sŒ(|jj |«}d}|dr d|dzdz}|dr|dz }|dr|dz }||j|<|S) Nr5Úcolorz fill="#r Úboldz font-weight="bold"Úitalicz font-style="italic")r/rHÚ styles_tokenÚparentÚstyle_for_token)r0Ú tokentypeÚ otokentyperGÚresults rr;zSvgFormatter._get_style­sÃ€Ø ˜×(Ñ(Ñ (Ø×#Ñ# IÑ.Ð .؈ Ø—*‘*×)Ñ)¨)Ô4Ø!×(Ñ(ˆIð—*‘*×)Ñ)¨)Õ4à— ‘ ×*Ñ*¨9Ó5ˆØˆØ �Š>Ø %¨¡.Ñ0°3Ñ6ˆFØ �Š=Ø Ð+Ñ +ˆFØ �Š?Ø Ð,Ñ ,ˆFØ'-ˆ×јÑ$؈ rN) Ú__name__Ú __module__Ú __qualname__Ú__doc__ÚnameÚaliasesÚ filenamesr*rMr;©rrrrs-„ñ:ðv €D؈g€GØ� €Iòò*9*óvrN) r[Úpygments.formatterrÚpygments.tokenrÚ pygments.utilrrÚ__all__rÚ class2stylerr_rrÚres7ðñõ)Ý"ß3à Ð €ò&ð€ ô_�9õ_r