akavel / ditaa

Go port/fork of ditaa. ditaa is a small command-line utility that can convert diagrams drawn using ascii art ('drawings' that contain characters that resemble lines like | / - ), into proper bitmap graphics.
GNU General Public License v2.0
53 stars 5 forks source link

support additional command line parameters #7

Open splitbrain opened 7 years ago

splitbrain commented 7 years ago

The original supports some command line parameters influencing the rendering style:

-E,--no-separation  Prevents the separation of common edges of
                            shapes.
-r,--round-corners         Causes all corners to be rendered as round
                            corners.
 -s,--scale <SCALE>         A natural number that determines the size of
                            the rendered image. The units are fractions of
                            the default size (2.5 renders 1.5 times bigger
                            than the default).
 -S,--no-shadows            Turns off the drop-shadow effect.

It would be nice to have these supported in the go version as well.

akavel commented 7 years ago

For first version, I implemented only the default path, so additional code would be needed. If you or someone else sends a PR, I'd be happy to merge, as long as the default path is not broken (i.e. the "visual tests" at https://akavel.github.com/ditaa still render correctly), and after we work through a review. Code need not be perfect, esp. given that the current body of code is very imperfect, but I might still have some comments during review.

Personally, I'm not planning to develop on ditaa in close future; I have it where I wanted it to be. And if I were to, I'd probably rather try to understand the code and clean it up (and ideally rewrite some inefficient algorithms to more efficient approaches), so adding options is a perfect task for potential contributors. I'm adding an up-for-grabs label. If anyone is interested, please send implementation of each option in a separate PR. If you need any help, you're more than welcome to ask here! Even a "how do I start?" question is ok, as it would help me feel somebody's interested and motivate myself to write some hints.

I'd expect a contributor to port code implementing the options from the original Java code. Please use the GPL2+ version of the code, which can be browsed in directory orig-java/ in commit aa96fb21 or any older commit - don't use the current GPL3+ version of Java ditaa. (I think the git tag "orig-java" may point to this commit, but I don't remember for sure already, sorry.)

Good luck! :)