sphinx-contrib / svgbob Goto Github PK
View Code? Open in Web Editor NEWA Sphinx extension to convert ASCII diagrams to SVGs with Svgbob.
Home Page: https://pypi.org/project/sphinxcontrib-svgbob
License: MIT License
A Sphinx extension to convert ASCII diagrams to SVGs with Svgbob.
Home Page: https://pypi.org/project/sphinxcontrib-svgbob
License: MIT License
Please publish wheels for Python 3.10 and consider publishing wheels for 3.11 as well
SVGBob supports UTF-8 box drawing characters, which arguably look a lot better than what ASCII looks like in a (modern) text editor.
I think you need to explicitly add an encoding="utf-8"
here:
svgbob/sphinxcontrib/svgbob/transform.py
Line 68 in ee7b0fb
based on the tracebox in the error log Sphinx created:
Traceback (most recent call last):
File "venv\lib\site-packages\sphinx\cmd\build.py", line 277, in build_main
app.build(args.force_all, filenames)
File "venv\lib\site-packages\sphinx\application.py", line 349, in build
self.builder.build_update()
File "venv\lib\site-packages\sphinx\builders\__init__.py", line 301, in build_update
self.build(to_build,
File "venv\lib\site-packages\sphinx\builders\__init__.py", line 317, in build
updated_docnames = set(self.read())
File "venv\lib\site-packages\sphinx\builders\__init__.py", line 424, in read
self._read_serial(docnames)
File "venv\lib\site-packages\sphinx\builders\__init__.py", line 445, in _read_serial
self.read_doc(docname)
File "venv\lib\site-packages\sphinx\builders\__init__.py", line 498, in read_doc
publisher.publish()
File "venv\lib\site-packages\docutils\core.py", line 219, in publish
self.apply_transforms()
File "venv\lib\site-packages\docutils\core.py", line 200, in apply_transforms
self.document.transformer.apply_transforms()
File "venv\lib\site-packages\sphinx\transforms\__init__.py", line 80, in apply_transforms
super().apply_transforms()
File "venv\lib\site-packages\docutils\transforms\__init__.py", line 171, in apply_transforms
transform.apply(**kwargs)
File "venv\lib\site-packages\sphinxcontrib\svgbob\transform.py", line 45, in apply
out = self.render(node, options)
File "venv\lib\site-packages\sphinxcontrib\svgbob\transform.py", line 69, in render
f.write(to_svg(node["code"], **options)) # type: ignore
File "Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 2864: character maps to <undefined>
Hello,
I wanted to have a custom text color support but after some research of how svgbob work I figured out that it's a problem from the rust library and not this project. While I could see for add support over there I notice that, at least for html rendering, the theming of the svg didn't work via an svg in an image but work with an inline svg I decided to try and fork the project.
I read the contribution note and instead of create a pull request directly I'v open this issue. Now I have worked on an implementation on my own (See directly the diff on my fork here: main...brodokk:svgbob:css_theming_support) but I feel I have a problem with it. While the support of custom theming via css work fine I encounter an issue with the support of the align
option. Since I'm trying to user a container to change alignment of the svg I'v tried to use the node container
of sphinx but it doesn't seems that I can add a custom parameter to the div without creating a new node.
So my solution was to add a custom container node, div, but now the problem is the tests are not working anymore while the command make man
work fine. I suppose the test are also not correct, so I've patched the tests for make it work.
Another thing, is this normal that the builder for latex
and text
are broken without my modification? Are they supported?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.