Comments (6)
Make sure you installed svgbob_cli via cargo install -f svgbob_cli
.
Invoke the command with svgbob
Trying out your example:
$> echo "+--+\n| |\n+--+" | svgbob
<svg class="bob" font-family="arial" font-size="14" height="16" width="120" xmlns="http://www.w3.org/2000/svg">
<defs>
<marker id="triangle" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="15" refY="10" viewBox="0 0 50 20">
<path d="M 0 0 L 30 10 L 0 20 z"/>
</marker>
</defs>
<style>
line, path {
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
circle {
stroke: black;
stroke-width: 2;
stroke-opacity: 1;
fill-opacity: 1;
stroke-linecap: round;
stroke-linejoin: miter;
}
circle.solid {
fill:black;
}
circle.open {
fill:transparent;
}
tspan.head{
fill: none;
stroke: none;
}
</style>
<path d=" M 4 8 L 8 8 L 16 8 M 8 8 L 16 8 L 24 8 M 16 8 L 24 8 M 28 8 L 24 8 M 40 16 L 32 0 L 40 16 M 68 0 L 68 16 M 68 0 L 68 16 M 80 16 L 72 0 L 80 16 M 92 8 L 96 8 L 104 8 M 96 8 L 104 8 L 112 8 M 104 8 L 112 8 M 116 8 L 112 8" fill="none"/>
<path d="" fill="none" stroke-dasharray="3 3"/>
<text x="41" y="12">
n|
</text>
<text x="81" y="12">
n
</text>
</svg>
from svgbob.
Thanks for looking into that. I also get some result with the example you tested, but here is what the svg you posted looks like :
(in the svg you can also see that the \n
are actually written as <text>n</text>
)
When using an external file (with actual newline characters) :
I get something slightly different with the same command line, so I will perform the installation like you said, but I think the newline character will still be handled the same way :
from svgbob.
Hi, it looks like a huge bug, probably with the added "
as escaping character to be not interpreted as graphics. I've to look at this further.
from svgbob.
@yhql it looks like this is not an issue with svgbob at all, but echo is sending literal "\n". That needs to be an actual line. Try putting -e
instead with echo -e "+--+\n| |\n+--+" | svgbob
.
Alternatively you can also try printf "+--+\n| |\n+--+" | svgbob
as stated here https://stackoverflow.com/questions/8467424/echo-newline-in-bash-prints-literal-n
from svgbob.
Thanks for the info. Sadly as I'm on windows the echo
command does not have any special flags that would help.
I did try the following trick :
echo "+--+" & echo "| |" & echo "+--+" | svgbob
which almost does the job : the drawing is correct but there seems to be no way of getting rid of the "
characters in the result.
from svgbob.
If you're ok with it I could try to make svgbob
accept strings as first arguments so that it handles the \n
and others by itself, rather than let the terminal deal with it (because I don't see any way around on Windows).
from svgbob.
Related Issues (20)
- Styles are leaking HOT 2
- docs: radius 2.0 circle is iffy HOT 1
- Regressions in "Load Other Example"
- Choose a file extension for the new file format HOT 1
- Lines crossing issue HOT 3
- Online demo preview and SVG output don't match HOT 1
- Embed iosevka font in the svg image
- XML parsing errors on generated svg
- Scoping styles
- Maintain an official SVGBob WASM NPM package HOT 1
- Browsers' automatic dark mode theme generation breaks svgbob
- Comment in style section is not a CSS comment HOT 1
- Detection of O-Corner with two arrows fails
- Syntax for an arc HOT 2
- Triangle filling is not working HOT 3
- To easier the trial, add docker image
- "Basic Shapes" seems broken HOT 1
- Fails to parse quoting at end of line
- Question: create a bigger circles HOT 2
- Question: Change text color
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgbob.