Giter Club home page Giter Club logo

svgbob's People

Contributors

althonos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

brodokk 5l1v3r1

svgbob's Issues

Support UTF-8 encoding

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:

with open(outfile, mode="w") as f:

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>

CSS theming support

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.