summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJovansonlee Cesar <ivanceras@gmail.com>2020-02-03 11:22:17 +0800
committerJovansonlee Cesar <ivanceras@gmail.com>2020-02-03 11:22:17 +0800
commitd2a5f3d25f544466455b0151b8c148588ddd2f63 (patch)
tree78b19c74559d5de77088e52eae2320cb0ac12f09
parent7086bae9567510b99bb748ecff4e72e94fafce50 (diff)
Merge the rearchitecture code into the main svgbob code
-rw-r--r--.gitignore1
-rw-r--r--Cargo.lock978
-rw-r--r--Cargo.toml5
-rw-r--r--screenshots/vim.svg538
-rw-r--r--svgbob/Behavior.md (renamed from Behavior.md)0
-rw-r--r--svgbob/Cargo.lock900
-rw-r--r--svgbob/Cargo.toml25
-rw-r--r--svgbob/Changelog.md8
-rw-r--r--svgbob/LICENSE (renamed from LICENSE)0
-rw-r--r--svgbob/README.md (renamed from README.md)0
-rw-r--r--svgbob/TODO.md (renamed from TODO.md)0
-rw-r--r--svgbob/concepts.md11
-rw-r--r--svgbob/examples/circuits.rs20
-rw-r--r--svgbob/examples/circuits.svg334
-rw-r--r--svgbob/examples/demo.bob296
-rw-r--r--svgbob/examples/demo.rs19
-rw-r--r--svgbob/examples/demo.svg4601
-rw-r--r--svgbob/examples/grid.rs8
-rw-r--r--svgbob/examples/issue19.rs25
-rw-r--r--svgbob/examples/issue19.svg66
-rw-r--r--svgbob/examples/issue25.rs25
-rw-r--r--svgbob/examples/issue25.svg42
-rw-r--r--svgbob/examples/long.rs20
-rw-r--r--svgbob/examples/long.svg21170
-rw-r--r--svgbob/examples/simple.rs12
-rw-r--r--svgbob/examples/spec1.rs17
-rw-r--r--svgbob/examples/spec1.svg45
-rwxr-xr-xsvgbob/run_demo.sh1
-rwxr-xr-xsvgbob/run_long.sh1
-rwxr-xr-xsvgbob/run_simple.sh1
-rwxr-xr-xsvgbob/run_svg_to_ascii.sh1
-rw-r--r--svgbob/spec.md (renamed from spec.md)0
-rw-r--r--svgbob/src/block.rs31
-rw-r--r--svgbob/src/box_drawing.rs225
-rw-r--r--svgbob/src/buffer.rs9
-rw-r--r--svgbob/src/buffer/cell_buffer.rs497
-rw-r--r--svgbob/src/buffer/cell_buffer/cell.rs433
-rw-r--r--svgbob/src/buffer/cell_buffer/cell/cell_grid.rs210
-rw-r--r--svgbob/src/buffer/cell_buffer/contacts.rs67
-rw-r--r--svgbob/src/buffer/cell_buffer/endorse.rs212
-rw-r--r--svgbob/src/buffer/cell_buffer/settings.rs37
-rw-r--r--svgbob/src/buffer/cell_buffer/span.rs591
-rw-r--r--svgbob/src/buffer/fragment_buffer.rs173
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment.rs735
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/arc.rs273
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/circle.rs91
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/line.rs734
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/marker_line.rs179
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/polygon.rs163
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/rect.rs142
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment/text.rs275
-rw-r--r--svgbob/src/buffer/fragment_buffer/fragment_tree.rs210
-rw-r--r--svgbob/src/buffer/property_buffer.rs347
-rw-r--r--svgbob/src/buffer/property_buffer/property.rs281
-rw-r--r--svgbob/src/buffer/string_buffer.rs107
-rw-r--r--svgbob/src/element.rs360
-rw-r--r--svgbob/src/enhance.rs380
-rw-r--r--svgbob/src/enhance_circle.rs583
-rw-r--r--svgbob/src/focus_char.rs431
-rw-r--r--svgbob/src/fragments.rs60
-rw-r--r--svgbob/src/grid.rs646
-rw-r--r--svgbob/src/lib.rs90
-rw-r--r--svgbob/src/loc.rs150
-rw-r--r--svgbob/src/loc_block.rs231
-rw-r--r--svgbob/src/location.rs165
-rw-r--r--svgbob/src/map.rs6
-rw-r--r--svgbob/src/map/ascii_map.rs908
-rw-r--r--svgbob/src/map/circle_map.rs475
-rw-r--r--svgbob/src/map/unicode_map.rs346
-rw-r--r--svgbob/src/optimizer.rs198
-rw-r--r--svgbob/src/options.rs18
-rw-r--r--svgbob/src/point.rs140
-rw-r--r--svgbob/src/point_block.rs48
-rw-r--r--svgbob/src/properties.rs1750
-rw-r--r--svgbob/src/settings.rs49
-rw-r--r--svgbob/src/svg_element.rs23
-rw-r--r--svgbob/src/tests.rs116
-rw-r--r--svgbob/src/util.rs413
-rwxr-xr-xsvgbob/test.sh1
-rw-r--r--svgbob/test_data/circuits.bob (renamed from svgbob/examples/circuits.bob)0
-rw-r--r--svgbob/test_data/demo.bob943
-rw-r--r--svgbob/test_data/long.bob (renamed from svgbob/examples/long.bob)669
-rw-r--r--svgbob/test_data/simple.bob57
-rw-r--r--svgbob_cli/Cargo.lock873
-rw-r--r--svgbob_cli/Cargo.toml9
-rw-r--r--svgbob_cli/examples/ascii_art.bob267
-rw-r--r--svgbob_cli/examples/ascii_art.rs36
-rw-r--r--svgbob_cli/examples/comic.bob33
-rw-r--r--svgbob_cli/examples/comic.rs33
-rw-r--r--svgbob_cli/examples/demo.rs129
-rw-r--r--svgbob_cli/examples/demo.svg330
-rw-r--r--svgbob_cli/examples/demo_clean.svg1
-rw-r--r--svgbob_cli/examples/long.bob472
-rwxr-xr-xsvgbob_cli/examples/long.sh2
-rw-r--r--svgbob_cli/examples/long.svg3871
-rw-r--r--svgbob_cli/examples/memes.bob570
-rw-r--r--svgbob_cli/examples/memes2.bob450
-rw-r--r--svgbob_cli/examples/memes2.rs33
-rw-r--r--svgbob_cli/examples/memes3.bob436
-rw-r--r--svgbob_cli/examples/memes3.rs33
-rw-r--r--svgbob_cli/examples/nice_to_have.bob63
-rw-r--r--svgbob_cli/examples/render.rs33
-rw-r--r--svgbob_cli/examples/schematic.bob609
-rw-r--r--svgbob_cli/examples/schematic.svg2717
-rw-r--r--svgbob_cli/examples/simple.rs10
-rw-r--r--svgbob_cli/src/main.rs33
106 files changed, 12111 insertions, 43380 deletions
diff --git a/.gitignore b/.gitignore
index 2b2b90f..9be293f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ public/
parts/
prime/
snap/
+**/out/*
stage/
*.snap*
*.tar*
diff --git a/Cargo.lock b/Cargo.lock
index 3addd36..e49388f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,249 +1,1023 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "alga"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "658f9468113d34781f6ca9d014d174c74b73de870f1e0e3ad32079bbab253b19"
+dependencies = [
+ "approx",
+ "libm",
+ "num-complex",
+ "num-traits",
+]
+
[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "anyhow"
+version = "1.0.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c"
+
+[[package]]
+name = "approx"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3"
dependencies = [
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "num-traits",
]
[[package]]
name = "atty"
-version = "0.2.11"
+version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
- "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
- "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "hermit-abi",
+ "libc",
+ "winapi",
]
[[package]]
+name = "autocfg"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2"
+
+[[package]]
+name = "autocfg"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
+
+[[package]]
name = "bitflags"
-version = "1.0.3"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
-name = "cc"
-version = "1.0.18"
+name = "bumpalo"
+version = "3.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4"
[[package]]
name = "cfg-if"
-version = "0.1.5"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]]
name = "clap"
-version = "2.32.0"
+version = "2.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
dependencies = [
- "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "ansi_term",
+ "atty",
+ "bitflags",
+ "strsim",
+ "textwrap",
+ "unicode-width",
+ "vec_map",
]
[[package]]
-name = "difference"
-version = "1.0.0"
+name = "cloudabi"
+version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "downcast-rs"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6"
+
+[[package]]
+name = "either"
+version = "1.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
+
+[[package]]
+name = "fixedbitset"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33"
+
+[[package]]
+name = "fuchsia-cprng"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
+
+[[package]]
+name = "futf"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c9c1ce3fa9336301af935ab852c437817d14cd33690446569392e65170aac3b"
+dependencies = [
+ "mac",
+ "new_debug_unreachable",
+]
+
+[[package]]
+name = "generic-array"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
+dependencies = [
+ "typenum",
+]
+
+[[package]]
+name = "getopts"
+version = "0.2.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
+dependencies = [
+ "unicode-width",
+]
[[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 = "heck"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
+dependencies = [
+ "unicode-segmentation",
+]
+
+[[package]]
+name = "hermit-abi"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eff2656d88f158ce120947499e971d743c05dbcbed62e5bd2f38f1698bbc3772"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "html5ever"
+version = "0.23.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ce65ac8028cf5a287a7dbf6c4e0a6cf2dcf022ed5b167a81bae66ebf599a8b7"
+dependencies = [
+ "log 0.4.8",
+ "mac",
+ "markup5ever",
+ "proc-macro2 0.4.30",
+ "quote 0.6.13",
+ "syn 0.15.44",
+]
+
+[[package]]
+name = "itertools"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
dependencies = [
- "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
+ "either",
]
[[package]]
+name = "itoa"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum