diff options
author | Jovansonlee Cesar <ivanceras@gmail.com> | 2020-02-14 18:02:31 +0800 |
---|---|---|
committer | Jovansonlee Cesar <ivanceras@gmail.com> | 2020-02-14 18:02:31 +0800 |
commit | f8d41a7d19447e46b6c5cf6f6e93c4a09203c48f (patch) | |
tree | 4e08e7115c235e0d4e4a9272d3dbbeb1e5b50613 | |
parent | e999f995e0cdb57aa0c91c84c5a0660652c4bfd3 (diff) |
Prepare release 0.5.0-alpha.0rewrite3-vectorize
-rw-r--r-- | Cargo.lock | 77 | ||||
-rw-r--r-- | README.md | 342 | ||||
-rw-r--r-- | deny.toml (renamed from svgbob/deny.toml) | 0 | ||||
-rw-r--r-- | svgbob/Cargo.toml | 12 | ||||
-rw-r--r-- | svgbob_cli/Cargo.toml | 5 |
5 files changed, 12 insertions, 424 deletions
@@ -123,18 +123,6 @@ dependencies = [ ] [[package]] -name = "handlebars" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937e9d49d65ffb5f70e95710a6c8539addf40200275ad8b6cdba0f0a59d5814d" -dependencies = [ - "log 0.3.9", - "pest", - "quick-error", - "rustc-serialize", -] - -[[package]] name = "hermit-abi" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -153,12 +141,6 @@ dependencies = [ ] [[package]] -name = "itoa" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" - -[[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -178,15 +160,6 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.8", -] - -[[package]] -name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" @@ -292,12 +265,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" [[package]] -name = "pest" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8" - -[[package]] name = "petgraph" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -314,12 +281,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef5cf7f52c12da93c26b63ee0d9f012bc82fb071851c546c030dc6ecb5f2994b" [[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] name = "rand" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -441,18 +402,6 @@ dependencies = [ ] [[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" - -[[package]] -name = "ryu" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" - -[[package]] name = "sauron" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -460,7 +409,7 @@ checksum = "ee92eb275e1c4dd3d2f314cf162d67f9db7916436a59aebf93715c40d6818c16" dependencies = [ "cfg-if", "lazy_static", - "log 0.4.8", + "log", "sauron_vdom", ] @@ -470,24 +419,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce9de12db6e3f973366706550ff4a3a2a3396d5dd4398ec666dd8d3552eb5ebe" dependencies = [ - "log 0.4.8", -] - -[[package]] -name = "serde" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" - -[[package]] -name = "serde_json" -version = "1.0.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b01d7f0288608a01dca632cf1df859df6fd6ffa885300fc275ce2ba6221953" -dependencies = [ - "itoa", - "ryu", - "serde", + "log", ] [[package]] @@ -513,7 +445,7 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "svgbob" -version = "0.5.0" +version = "0.5.0-alpha.0" dependencies = [ "itertools", "lazy_static", @@ -521,8 +453,6 @@ dependencies = [ "ncollide2d", "pom", "sauron", - "sauron_vdom", - "serde_json", "unicode-width", ] @@ -531,7 +461,6 @@ name = "svgbob_cli" version = "0.5.0" dependencies = [ "clap", - "handlebars", "svgbob", ] @@ -4,345 +4,7 @@ <img src="https://api.travis-ci.org/ivanceras/svgbob.svg"/> </a> -Svgbob is an ascii to svg converter. +Svgbob transform your ascii diagrams into a nice svg representation. -There is a Work-in-Progress spec [here](https://github.com/ivanceras/svgbob/blob/master/spec.md) -Contribution to the spec is welcomed. - -#### Please support this project: - [![Become a patron](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/ivanceras) - - -[Demo](http://ivanceras.github.io/svgbob-editor/) - -[Docs](https://docs.rs/svgbob) - - -# Using in command line - -`cargo install svgbob_cli` - -`svgbob` normally operates on stdin and stdout: -```console -$ svgbob < examples/long.bob > long.svg -``` -produces an SVG in `long.svg` similar to the one produced by the old `main` binary. `svgbob` also allows passing arguments instead: -```console -$ svgbob examples/long.bob -o long.svg -``` -And you can mix and match: -```console -$ svgbob -o long.svg < examples/long.bob -$ svgbob examples/long.bob > long.svg -``` - -You can pipe string from the output of other program: -```console -echo -e "+--+\n| |\n+--+" | svgbob -``` -You can also pass an inline string: -```console -svgbob -s -- "+--+\n| |\n+--+" -``` - -This is also documented in the output of `svgbob --help`: -```console - -svgbob 0.2.5 -SvgBobRus is an ascii to svg converter - -USAGE: - svgbob [FLAGS] [OPTIONS] [input] [SUBCOMMAND] - -FLAGS: - -h, --help Prints help information - -s parse an inline string - -V, --version Prints version information - -OPTIONS: - --font-family <font-family> text will be rendered with this font (default: 'arial') - --font-size <font-size> text will be rendered with this font size (default: 14) - -o, --output <output> where to write svg output [default: STDOUT] - --scale <scale> scale the entire svg (dimensions, font size, stroke width) by this factor - (default: 1) - --stroke-width <stroke-width> stroke width for all lines (default: 2) - -ARGS: - <input> svgbob text file or inline string to parse [default: STDIN] - -SUBCOMMANDS: - build Batch convert files to svg. - help Prints this message or the help of the given subcommand(s) - -``` - - - - -<img src="https://ivanceras.github.io/svgbob/svgbob/examples/demo.svg"/> - -The SVG image is generated from the ascii text below. - -```bob - -Svgbob is a diagramming model -which uses a set of typing characters -to approximate the intended shape. - - .---. - /-o-/-- - .-/ / /-> - ( * \/ - '-. \ - \ / - ' -It uses a combination of these characters -"which are readily available on your keyboards". - -What can it do? - - o-> Basic shapes - . - +------+ .------. .------. /\ .' `. - | | | | ( ) / \ .' `. - +------+ '------' '------' '----' `. .' - _______ ________ `.' ^ / - / \ /\ \ \ ----> | ^ / / - / \ / \ ) ) <---- | | / v - \ / \ / /_______/ v | - \_______/ \/ - - .-----------. . <. .> . ^ \ - ( ) ( ) ( ) \ \ - '-----+ ,---' `> ' ` <' \ v - |/ - - - o-> Quick logo scribbles - .---. _ - /-o-/-- .--. |-| .--. - .-/ / /-> /--. \ .--)-| .--.-. //.-.\ - ( * \/ / O )| | |-| |->| | (+(-*-)) - '-. \ /\ |-// . * | '--'-' \\'-'/ - \ / \ '+'/ \__/ '--' - ' '--' - - o-> Even unicode box drawing characters are supported - ┌─┬┐ ╔═╦╗ ╓─╥╖ ╒═╤╕ - ├─┼┤ ╠═╬╣ ╟─╫╢ ╞═╪╡ - └─┴┘ ╚═╩╝ ╙─╨╜ ╘═╧╛ - - - o-> Sequence Diagrams - - .---> F - A B C D / - *-------*-----*---*----*-----> E - \ ^ \ - v / '---> G - B --> C -' - - - o-> Statistical charts - - - E +-------------------------*--+ E | o - D |-------------------*--*--|--* D | o o | o - C |-------------*--* | | | | C | o o | | | | - B |-------*--* | | | | | | B | o o | | | | | | - A +-*--*--+--+--+--+--+--+--+--+ A +-o--o--+--+--+--+--+--+--+--+ - 5 10 15 20 25 30 35 40 45 50 5 10 15 20 25 30 35 40 45 50 - - - - - - - - - - - o-> Flow charts - .--. .---. .---. .---. .---. .---. .---. - | | OS API '---' '---' '---' '---' '---' '---' - v | | | | | | | - .-. .-. .-. | v v | v | v - .-->'-' '-' '-' | .------------. | .-----------. | .-----. - | \ | / | | Filesystem | | | Scheduler | | | MMU | - | v . v | '------------' | '-----------' | '-----' - '_______/ \_____| | | | | - \ / v | | v - | ____ .----. | | .---------. - '--> /___/ | IO |<----' | | Network | - '----' | '---------' - | | | - v v v - .---------------------------------------. - | HAL | - '---------------------------------------' - - - o-> Block diagrams - - .-,( ),-. - ___ _ .-( )-. - [___]|=| -->( ) __________ - /::/ |_| '-( ).-' --->[_...__...°] - '-.( ).-' - \ ____ __ - '--->| | |==| - |____| | | - /::::/ |__| - - o-> Mindmaps - - .--> Alpha - / - .----> Initial Release - Planning *-------. / \ - \ / '---> Patch 1 - Initial research \ / \ - * \ / '--> Patch 2 - \ \ .---------> Beta - \ \ / - \ o o _______ - \ .---. o--.___ / \ - '------> ( ) '----*---> . Release . - `---' o \_______/ - o o o \ - / \ \ \ - .--' \ \ \ - / \ \ '----+-> Push backs - . \ \ \ - /| \ \ '----> Setbacks - / . \ \ - V /| \ '-----> Reception - Team / . \ - v /| \ - Worklaod / . '-->> Career change - V / - PTO / - V - Bug - - - o-> It can do complex stuff such as circuit diagrams - - - +10-15V ___0,047R - *------o------o-|___|-o--o---------o----o-------. - | | | | | | | - --- | | .+. | | | - 470uF ### | | | | 2k2 | | | - | + | | | | | | .+. - *------o '--. | '+' .+. | '-' - | |6 |7 |8 1k | | | | - GND .-+----+--+--. | | | | - | | '+' | | - | |1 | |/ BC | - | +------o--+ 547 | - | | | |`> | - | | ,+. | | - | | 220R| | o----||-+ IRF9Z34 - | | | | | |+-> - | MC34063 | `+' | ||-+ - | | | | | BYV29 -12V6 - | | '----' o--|<-o----o--X OUT - | |2 | | | - | |--o C| | | - | | GND 30uH C| | --- 470 - | |3 1nF C| | ### uF - | |-------||--. | | | + - '-----+----+-' | GND | GND - 5| 4| | | - | '-------------o-------------o - | ___ | - '------/\/\/------------o--|___|-' - | 1k0 - .+. - | | 5k6 + 3k3 - | | in Serie - '+' - | - GND - - .-------------. - / Advantages: / -'-------------' - -* Plain text format - Ultimately portable, backward compatible and future proof. - -* Degrades gracefully - Even when not using a graphical renderer, it would still looks good - as text based diagrams. Paste the text in your source code. - -* Easiest to use. Anyone knows how to edit text. - - - About Svgbob editor: -======================= - - -> The editor is a plain text editor in replace and block mode - with smarter prediction on where you intended to type next. - i.e: typing / will move the cursor north east to continue the line. - -> The editor also has an xray lens that reveals the underlying characters - underneath that comprises the graph. Move the mouse around to see the characters - that build up which image, while holding the mouse down - momentarily cancels the xray - - .------------------------------. -( This page is editable. Try it! ) - '------------------------------' - -+----------+ -| FAQ: | -+----------+ - - Q: "Why is there too much spacing on words" - A: It is an intended behaviour as all the text are meant - for labels. Each words of sentences corresponds to each separate text - elements in the SVG output in order to maintain - "a bit of alignment closes to their original location. *[0]" - - Q: Do people really type in diagrams in text, isn't that tedious? - A: Using simple text editors to make text diagrams like these are really - "tedious. Power users of vim or emacs can make diagrams with ease.*[1]" - - Q: Your editor sucks! - A: That's the beauty of plain text. - Use whatever editor you like. - - Q: "How to integrate this in markdown?" - A: "There is a project called [Spongedown](https://ivanceras.github.io/spongedown)" - which specifically does that. The svgbob diagramming feature is guarded - with ```bob code block so as not to pollute the markdown syntax. - - -"Footnotes:" -"*[0]: Fonts mostly condensed words to look" - and render nicely. Monospace fonts should have solved this - problem, however the monospace fonts used in browsers - are not really monospaced (i.e CJK full-width characters - are only rendered 1.5x larger than ascii characters, - "instead of 2x larger). In the terminal however, full-width" - characters are rendered 2x larger using either monospace - or non-monspaced fonts. - - .------------. | .-----------. | .-----. Look at that - | 文件系统 | | | 调度器 | | | MMU | --------------> - '------------' | '-----------' | '-----' monospace eh? - - Also using monofont on final output document makes it look like meant - "something for devs, instead of documents for all." - For a more heavy usage of text just use markdown format, - "there is also [Spongedown](https://ivanceras.github.io/spongedown)" - which allow you to write in markdown, combine it with svgbob diagrams, - "together some other features like csv and math equations." - -"*[1] In vim, there is a drawIt plugin which helps you easily draw ascii" - diagrams. For vim without using any plugins, you can use combination - "of BLOCK mode editing(CTRL-v), REPLACE mode(SHIFT-r)", - :set virtualedit=all to easily move the cursor everywhere, - "cut, copy and paste text in block mode (<C-v> jjll 1vp)". - For emacs: there is artist mode. - -``` +[**Demo**](http://ivanceras.github.io/svgbob-editor/) diff --git a/svgbob/deny.toml b/deny.toml index f5b62e0..f5b62e0 100644 --- a/svgbob/deny.toml +++ b/deny.toml diff --git a/svgbob/Cargo.toml b/svgbob/Cargo.toml index 24055d4..287b509 100644 --- a/svgbob/Cargo.toml +++ b/svgbob/Cargo.toml @@ -1,9 +1,12 @@ [package] name = "svgbob" -version = "0.5.0" -authors = ["lee"] +version = "0.5.0-alpha.0" +authors = ["Jovansonlee Cesar <ivanceras@gmail.com>"] edition = "2018" -publish = true +description = "Transform your ascii diagrams into happy little SVG" +repository = "https://github.com/ivanceras/svgbob" +documentation = "https://docs.rs/svgbob" +keywords = ["ascii","plain","text", "svg", "bob"] license = "Apache-2.0" [dependencies] @@ -15,7 +18,4 @@ unicode-width = "0.1.5" itertools = "0.8.0" pom = { version = "3.1.0" } -[dev-dependencies] -sauron_vdom = {version = "0.21.0"} -serde_json = "1.0.41" diff --git a/svgbob_cli/Cargo.toml b/svgbob_cli/Cargo.toml index 028f0a3..857cec5 100644 --- a/svgbob_cli/Cargo.toml +++ b/svgbob_cli/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["ascii", "svg", "convert", "bob"] license = "Apache-2.0" [dependencies] -svgbob = { version = "0.5.0", path = "../svgbob" } +svgbob = { version = "0.5.0-alpha.0", path = "../svgbob" } clap = "2.16" @@ -18,6 +18,3 @@ clap = "2.16" name = "svgbob" path = "src/main.rs" -[dev-dependencies] -handlebars = "0.21" - |