Git Product home page Git Product logo

soda's Introduction

Very funny heading (previous was not funny, yes)

I'm 22, I'm a person, living in cold and snowy Siberia Tbilisi, Georgia.
Here's some random facts about me:

  • Writing Python code since 2018.
  • Previous point doesn't mean I want to use Django. Never ever.
  • Sometimes I use JavaScript/TypeScript (at work, for example), mostly with React
  • Interested in math, languages, graphics and many more things. Doesn't mean I'm good at those, though.

Projects

My website / CV

Libraries

Extensions / Tools

Some small stuff / experiments

  • wtfl - Well-Designed Text-based Friendly Language
  • chessbyte - FEN-like binary format for chess board and its implementation in Python.
  • tabler - text table generation (also in Python).
  • birp - Big Russian Python (that's obviously a joke, yes).
  • newyear - A website with a countdown to New Year (so original and creative)

Archived

  • github_dark - dark theme for GitHub (archived because GitHub now has a dark theme)
  • vk-tweaks - UserCSS with different vk.com tweaks (now in vk-schemes)

Some other non-Github stuff

Where you can find me

soda's People

Stargazers

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

Watchers

 avatar

Forkers

liaozhaoyan

soda's Issues

How to create attributes with hyphens in it?

I try to create text boxes and would like to specify svg attributes with hypens in them (like "font-size" or "stroke-width")
Unfortunately e.g. font-size is no valid python name for a function parameter.

How would I do this in Python without construtcing to unescaped text?

xmlns attribute

Should an SVG file have a xmlns="http://www.w3.org/2000/svg" declaration in the root?

(Without it, Gapplin and PyCharm warn me the file is invalid and won't display it. Illustrator and InkScape render it happily, though.)

If so, should Soda somehow support the inclusion of it? Something like:

from:

        root = Root(
            viewBox="-400 -400 800 800",
            xmlns="http://www.w3.org/2000/svg"
        )

to:

        root = Root(
            viewBox="-400 -400 800 800",
            namespace = True
        )

(My apologies if this doesn't make sense. And thanks for the very practical library!)

Add the ability to render Fragment as top-level node and ability to alter tag brackets

From #3

I've removed the root attributes to keep it short.

Speaking of, I'm currently using

...
svg = root.render(pretty=True)
with open("svg.svg", "wt", encoding='utf-8') as f:
    f.write('<?xml version="1.0" encoding="UTF-8"?>')
    f.write(svg)

to build a valid file. Do you think including an option to prepend the XML declaration or supply a custom preamble string makes sense?

It seems that some XMLDeclaration tag could be convenient, like this:

from soda import Root, Fragment, XMLDeclaration

Fragment(
    XMLDeclaration(),
    Root(...)
).render()

Although right now this won't work because of two things:

  • Fragment raises an exception if its .render() method is called (I genuinely don't know why it should be that way)
  • XML declaration uses non-standard tag brackets, and a custom component would need to reimplement .build() to circumvent this

Path: quadratic Bezier continuation always returns zero coordinates (ignores parameters)

Something seems to be going wrong in https://github.com/evtn/soda/blob/lord/soda/paths.py#L76

from soda import Tag, Root, Path

commands = (
    Path.M(1, 2),
    Path.q(3, 4, 5, 6),
    Path.t( 7, 8),
    Path.Z()
)
p = Tag.path()(d=Path.build(*commands, sep=" "))

root = Root()(p)
print( root.render(pretty=True) )

Output

<svg
>
  <path
    d="M 1 2 q 3 4 5 6 t 0 0 Z"
  />
</svg>

Same with T:

<svg><path d="M 1 2 q 3 4 5 6 T 0 0 Z"/></svg>

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.