├── .gitignore ├── .travis.yml ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── TODO.md ├── deploy.sh ├── index.html ├── index.md ├── md ├── Diwata.md ├── Diwata │ └── Architecture.md ├── Markdown-example.md ├── Resume.md ├── Rustorm.md ├── Spongedown.md ├── Svgbob.md ├── Svgbob │ ├── Architecture.md │ ├── Circles.md │ ├── Design-Implementation.md │ └── Specification.md ├── markdeep.md └── records.csv ├── minimal.css ├── serve.sh ├── serve_debug.sh └── src └── lib.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | target/ 4 | Cargo.lock 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: rust 2 | rust: 3 | - nightly 4 | 5 | script: 6 | - cargo build 7 | - cargo test 8 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "adler32" 5 | version = "1.0.4" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" 8 | 9 | [[package]] 10 | name = "aho-corasick" 11 | version = "0.7.10" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" 14 | dependencies = [ 15 | "memchr", 16 | ] 17 | 18 | [[package]] 19 | name = "alga" 20 | version = "0.9.3" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "4f823d037a7ec6ea2197046bafd4ae150e6bc36f9ca347404f46a46823fa84f2" 23 | dependencies = [ 24 | "approx", 25 | "num-complex", 26 | "num-traits", 27 | ] 28 | 29 | [[package]] 30 | name = "approx" 31 | version = "0.3.2" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" 34 | dependencies = [ 35 | "num-traits", 36 | ] 37 | 38 | [[package]] 39 | name = "autocfg" 40 | version = "0.1.7" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 43 | 44 | [[package]] 45 | name = "autocfg" 46 | version = "1.0.0" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 49 | 50 | [[package]] 51 | name = "base64" 52 | version = "0.10.1" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" 55 | dependencies = [ 56 | "byteorder", 57 | ] 58 | 59 | [[package]] 60 | name = "bincode" 61 | version = "1.2.1" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" 64 | dependencies = [ 65 | "byteorder", 66 | "serde", 67 | ] 68 | 69 | [[package]] 70 | name = "bit-set" 71 | version = "0.5.1" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" 74 | dependencies = [ 75 | "bit-vec", 76 | ] 77 | 78 | [[package]] 79 | name = "bit-vec" 80 | version = "0.5.1" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" 83 | 84 | [[package]] 85 | name = "bitflags" 86 | version = "1.2.1" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 89 | 90 | [[package]] 91 | name = "block-buffer" 92 | version = "0.7.3" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" 95 | dependencies = [ 96 | "block-padding", 97 | "byte-tools", 98 | "byteorder", 99 | "generic-array", 100 | ] 101 | 102 | [[package]] 103 | name = "block-padding" 104 | version = "0.1.5" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" 107 | dependencies = [ 108 | "byte-tools", 109 | ] 110 | 111 | [[package]] 112 | name = "bstr" 113 | version = "0.2.12" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41" 116 | dependencies = [ 117 | "lazy_static", 118 | "memchr", 119 | "regex-automata", 120 | "serde", 121 | ] 122 | 123 | [[package]] 124 | name = "bumpalo" 125 | version = "3.2.1" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" 128 | 129 | [[package]] 130 | name = "byte-tools" 131 | version = "0.3.1" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" 134 | 135 | [[package]] 136 | name = "byteorder" 137 | version = "1.3.4" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 140 | 141 | [[package]] 142 | name = "cfg-if" 143 | version = "0.1.10" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 146 | 147 | [[package]] 148 | name = "chrono" 149 | version = "0.4.11" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" 152 | dependencies = [ 153 | "num-integer", 154 | "num-traits", 155 | ] 156 | 157 | [[package]] 158 | name = "cloudabi" 159 | version = "0.0.3" 160 | source = "registry+https://github.com/rust-lang/crates.io-index" 161 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 162 | dependencies = [ 163 | "bitflags", 164 | ] 165 | 166 | [[package]] 167 | name = "comrak" 168 | version = "0.7.0" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "e17058cc536cf290563e88787d7b9e6030ce4742943017cc2ffb71f88034021c" 171 | dependencies = [ 172 | "entities", 173 | "lazy_static", 174 | "pest", 175 | "pest_derive", 176 | "regex", 177 | "twoway", 178 | "typed-arena", 179 | "unicode_categories", 180 | ] 181 | 182 | [[package]] 183 | name = "console_error_panic_hook" 184 | version = "0.1.6" 185 | source = "registry+https://github.com/rust-lang/crates.io-index" 186 | checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" 187 | dependencies = [ 188 | "cfg-if", 189 | "wasm-bindgen", 190 | ] 191 | 192 | [[package]] 193 | name = "console_log" 194 | version = "0.1.2" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "1e7871d2947441b0fdd8e2bd1ce2a2f75304f896582c0d572162d48290683c48" 197 | dependencies = [ 198 | "log", 199 | "web-sys", 200 | ] 201 | 202 | [[package]] 203 | name = "crc32fast" 204 | version = "1.2.0" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" 207 | dependencies = [ 208 | "cfg-if", 209 | ] 210 | 211 | [[package]] 212 | name = "csv" 213 | version = "1.1.3" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" 216 | dependencies = [ 217 | "bstr", 218 | "csv-core", 219 | "itoa", 220 | "ryu", 221 | "serde", 222 | ] 223 | 224 | [[package]] 225 | name = "csv-core" 226 | version = "0.1.10" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" 229 | dependencies = [ 230 | "memchr", 231 | ] 232 | 233 | [[package]] 234 | name = "digest" 235 | version = "0.8.1" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" 238 | dependencies = [ 239 | "generic-array", 240 | ] 241 | 242 | [[package]] 243 | name = "downcast-rs" 244 | version = "1.1.1" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" 247 | 248 | [[package]] 249 | name = "either" 250 | version = "1.5.3" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" 253 | 254 | [[package]] 255 | name = "entities" 256 | version = "1.0.1" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "b5320ae4c3782150d900b79807611a59a99fc9a1d61d686faafc24b93fc8d7ca" 259 | 260 | [[package]] 261 | name = "fake-simd" 262 | version = "0.1.2" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" 265 | 266 | [[package]] 267 | name = "fancy-regex" 268 | version = "0.3.3" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "b0e2de1b89ad299d536b7cefc5d177f5c005957fa2266ce58eca4d189e74bff5" 271 | dependencies = [ 272 | "bit-set", 273 | "regex", 274 | ] 275 | 276 | [[package]] 277 | name = "file" 278 | version = "1.1.2" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "072420e920a41e95a021116fb47c331d1199aab0f12ca1f77903d5c0ec65c37a" 281 | 282 | [[package]] 283 | name = "fixedbitset" 284 | version = "0.1.9" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" 287 | 288 | [[package]] 289 | name = "flate2" 290 | version = "1.0.14" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" 293 | dependencies = [ 294 | "cfg-if", 295 | "crc32fast", 296 | "libc", 297 | "miniz_oxide", 298 | ] 299 | 300 | [[package]] 301 | name = "fnv" 302 | version = "1.0.6" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 305 | 306 | [[package]] 307 | name = "fuchsia-cprng" 308 | version = "0.1.1" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 311 | 312 | [[package]] 313 | name = "generic-array" 314 | version = "0.12.3" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" 317 | dependencies = [ 318 | "typenum", 319 | ] 320 | 321 | [[package]] 322 | name = "idna" 323 | version = "0.1.5" 324 | source = "registry+https://github.com/rust-lang/crates.io-index" 325 | checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" 326 | dependencies = [ 327 | "matches", 328 | "unicode-bidi", 329 | "unicode-normalization", 330 | ] 331 | 332 | [[package]] 333 | name = "indexmap" 334 | version = "1.3.2" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" 337 | dependencies = [ 338 | "autocfg 1.0.0", 339 | ] 340 | 341 | [[package]] 342 | name = "itertools" 343 | version = "0.8.2" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" 346 | dependencies = [ 347 | "either", 348 | ] 349 | 350 | [[package]] 351 | name = "itoa" 352 | version = "0.4.5" 353 | source = "registry+https://github.com/rust-lang/crates.io-index" 354 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 355 | 356 | [[package]] 357 | name = "js-sys" 358 | version = "0.3.37" 359 | source = "registry+https://github.com/rust-lang/crates.io-index" 360 | checksum = "6a27d435371a2fa5b6d2b028a74bbdb1234f308da363226a2854ca3ff8ba7055" 361 | dependencies = [ 362 | "wasm-bindgen", 363 | ] 364 | 365 | [[package]] 366 | name = "lazy_static" 367 | version = "1.4.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 370 | 371 | [[package]] 372 | name = "lazycell" 373 | version = "1.2.1" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" 376 | 377 | [[package]] 378 | name = "libc" 379 | version = "0.2.69" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 382 | 383 | [[package]] 384 | name = "libm" 385 | version = "0.2.1" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" 388 | 389 | [[package]] 390 | name = "line-wrap" 391 | version = "0.1.1" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" 394 | dependencies = [ 395 | "safemem", 396 | ] 397 | 398 | [[package]] 399 | name = "linked-hash-map" 400 | version = "0.5.2" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" 403 | 404 | [[package]] 405 | name = "log" 406 | version = "0.4.8" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 409 | dependencies = [ 410 | "cfg-if", 411 | ] 412 | 413 | [[package]] 414 | name = "maplit" 415 | version = "1.0.2" 416 | source = "registry+https://github.com/rust-lang/crates.io-index" 417 | checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" 418 | 419 | [[package]] 420 | name = "matches" 421 | version = "0.1.8" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 424 | 425 | [[package]] 426 | name = "matrixmultiply" 427 | version = "0.2.3" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "d4f7ec66360130972f34830bfad9ef05c6610a43938a467bcc9ab9369ab3478f" 430 | dependencies = [ 431 | "rawpointer", 432 | ] 433 | 434 | [[package]] 435 | name = "maybe-uninit" 436 | version = "2.0.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 439 | 440 | [[package]] 441 | name = "memchr" 442 | version = "2.3.3" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 445 | 446 | [[package]] 447 | name = "memory_units" 448 | version = "0.4.0" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" 451 | 452 | [[package]] 453 | name = "miniz_oxide" 454 | version = "0.3.6" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5" 457 | dependencies = [ 458 | "adler32", 459 | ] 460 | 461 | [[package]] 462 | name = "nalgebra" 463 | version = "0.18.1" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "aaa9fddbc34c8c35dd2108515587b8ce0cab396f17977b8c738568e4edb521a2" 466 | dependencies = [ 467 | "alga", 468 | "approx", 469 | "generic-array", 470 | "matrixmultiply", 471 | "num-complex", 472 | "num-rational", 473 | "num-traits", 474 | "rand", 475 | "typenum", 476 | ] 477 | 478 | [[package]] 479 | name = "ncollide2d" 480 | version = "0.19.2" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "fd7791f03728b7fa45bd18af5adcb6f162a05e10853f273133547e9e12fa1910" 483 | dependencies = [ 484 | "alga", 485 | "approx", 486 | "bitflags", 487 | "downcast-rs", 488 | "either", 489 | "nalgebra", 490 | "num-traits", 491 | "petgraph", 492 | "rand", 493 | "slab", 494 | "smallvec 0.6.13", 495 | ] 496 | 497 | [[package]] 498 | name = "num-complex" 499 | version = "0.2.4" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" 502 | dependencies = [ 503 | "autocfg 1.0.0", 504 | "num-traits", 505 | ] 506 | 507 | [[package]] 508 | name = "num-integer" 509 | version = "0.1.42" 510 | source = "registry+https://github.com/rust-lang/crates.io-index" 511 | checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" 512 | dependencies = [ 513 | "autocfg 1.0.0", 514 | "num-traits", 515 | ] 516 | 517 | [[package]] 518 | name = "num-rational" 519 | version = "0.2.4" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" 522 | dependencies = [ 523 | "autocfg 1.0.0", 524 | "num-integer", 525 | "num-traits", 526 | ] 527 | 528 | [[package]] 529 | name = "num-traits" 530 | version = "0.2.11" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 533 | dependencies = [ 534 | "autocfg 1.0.0", 535 | "libm", 536 | ] 537 | 538 | [[package]] 539 | name = "opaque-debug" 540 | version = "0.2.3" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" 543 | 544 | [[package]] 545 | name = "ordermap" 546 | version = "0.3.5" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" 549 | 550 | [[package]] 551 | name = "percent-encoding" 552 | version = "1.0.1" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 555 | 556 | [[package]] 557 | name = "pest" 558 | version = "2.1.3" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" 561 | dependencies = [ 562 | "ucd-trie", 563 | ] 564 | 565 | [[package]] 566 | name = "pest_derive" 567 | version = "2.1.0" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" 570 | dependencies = [ 571 | "pest", 572 | "pest_generator", 573 | ] 574 | 575 | [[package]] 576 | name = "pest_generator" 577 | version = "2.1.3" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" 580 | dependencies = [ 581 | "pest", 582 | "pest_meta", 583 | "proc-macro2", 584 | "quote", 585 | "syn", 586 | ] 587 | 588 | [[package]] 589 | name = "pest_meta" 590 | version = "2.1.3" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" 593 | dependencies = [ 594 | "maplit", 595 | "pest", 596 | "sha-1", 597 | ] 598 | 599 | [[package]] 600 | name = "petgraph" 601 | version = "0.4.13" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" 604 | dependencies = [ 605 | "fixedbitset", 606 | "ordermap", 607 | ] 608 | 609 | [[package]] 610 | name = "plist" 611 | version = "0.5.5" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "9b59eb8d91dfa89208ec74a920e3b55f840476cf46568026c18dbaa2999e0d48" 614 | dependencies = [ 615 | "base64", 616 | "chrono", 617 | "indexmap", 618 | "line-wrap", 619 | "serde", 620 | "xml-rs", 621 | ] 622 | 623 | [[package]] 624 | name = "pom" 625 | version = "3.1.0" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "ef5cf7f52c12da93c26b63ee0d9f012bc82fb071851c546c030dc6ecb5f2994b" 628 | 629 | [[package]] 630 | name = "proc-macro2" 631 | version = "1.0.10" 632 | source = "registry+https://github.com/rust-lang/crates.io-index" 633 | checksum = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" 634 | dependencies = [ 635 | "unicode-xid", 636 | ] 637 | 638 | [[package]] 639 | name = "quote" 640 | version = "1.0.3" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" 643 | dependencies = [ 644 | "proc-macro2", 645 | ] 646 | 647 | [[package]] 648 | name = "rand" 649 | version = "0.6.5" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 652 | dependencies = [ 653 | "autocfg 0.1.7", 654 | "libc", 655 | "rand_chacha", 656 | "rand_core 0.4.2", 657 | "rand_hc", 658 | "rand_isaac", 659 | "rand_jitter", 660 | "rand_os", 661 | "rand_pcg", 662 | "rand_xorshift", 663 | "winapi", 664 | ] 665 | 666 | [[package]] 667 | name = "rand_chacha" 668 | version = "0.1.1" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 671 | dependencies = [ 672 | "autocfg 0.1.7", 673 | "rand_core 0.3.1", 674 | ] 675 | 676 | [[package]] 677 | name = "rand_core" 678 | version = "0.3.1" 679 | source = "registry+https://github.com/rust-lang/crates.io-index" 680 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 681 | dependencies = [ 682 | "rand_core 0.4.2", 683 | ] 684 | 685 | [[package]] 686 | name = "rand_core" 687 | version = "0.4.2" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 690 | 691 | [[package]] 692 | name = "rand_hc" 693 | version = "0.1.0" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 696 | dependencies = [ 697 | "rand_core 0.3.1", 698 | ] 699 | 700 | [[package]] 701 | name = "rand_isaac" 702 | version = "0.1.1" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 705 | dependencies = [ 706 | "rand_core 0.3.1", 707 | ] 708 | 709 | [[package]] 710 | name = "rand_jitter" 711 | version = "0.1.4" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 714 | dependencies = [ 715 | "libc", 716 | "rand_core 0.4.2", 717 | "winapi", 718 | ] 719 | 720 | [[package]] 721 | name = "rand_os" 722 | version = "0.1.3" 723 | source = "registry+https://github.com/rust-lang/crates.io-index" 724 | checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 725 | dependencies = [ 726 | "cloudabi", 727 | "fuchsia-cprng", 728 | "libc", 729 | "rand_core 0.4.2", 730 | "rdrand", 731 | "winapi", 732 | ] 733 | 734 | [[package]] 735 | name = "rand_pcg" 736 | version = "0.1.2" 737 | source = "registry+https://github.com/rust-lang/crates.io-index" 738 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 739 | dependencies = [ 740 | "autocfg 0.1.7", 741 | "rand_core 0.4.2", 742 | ] 743 | 744 | [[package]] 745 | name = "rand_xorshift" 746 | version = "0.1.1" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 749 | dependencies = [ 750 | "rand_core 0.3.1", 751 | ] 752 | 753 | [[package]] 754 | name = "rawpointer" 755 | version = "0.2.1" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" 758 | 759 | [[package]] 760 | name = "rdrand" 761 | version = "0.4.0" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 764 | dependencies = [ 765 | "rand_core 0.3.1", 766 | ] 767 | 768 | [[package]] 769 | name = "regex" 770 | version = "1.3.7" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" 773 | dependencies = [ 774 | "aho-corasick", 775 | "memchr", 776 | "regex-syntax", 777 | "thread_local", 778 | ] 779 | 780 | [[package]] 781 | name = "regex-automata" 782 | version = "0.1.9" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4" 785 | dependencies = [ 786 | "byteorder", 787 | ] 788 | 789 | [[package]] 790 | name = "regex-syntax" 791 | version = "0.6.17" 792 | source = "registry+https://github.com/rust-lang/crates.io-index" 793 | checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" 794 | 795 | [[package]] 796 | name = "ryu" 797 | version = "1.0.4" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 800 | 801 | [[package]] 802 | name = "safemem" 803 | version = "0.3.3" 804 | source = "registry+https://github.com/rust-lang/crates.io-index" 805 | checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" 806 | 807 | [[package]] 808 | name = "same-file" 809 | version = "1.0.6" 810 | source = "registry+https://github.com/rust-lang/crates.io-index" 811 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 812 | dependencies = [ 813 | "winapi-util", 814 | ] 815 | 816 | [[package]] 817 | name = "sauron" 818 | version = "0.24.0" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "2ac3055fbee8a35ca88282102f4d58a50b2465d52689b6fe06ae387c2c1525b6" 821 | dependencies = [ 822 | "cfg-if", 823 | "js-sys", 824 | "lazy_static", 825 | "log", 826 | "sauron_vdom", 827 | "thiserror", 828 | "wasm-bindgen", 829 | "web-sys", 830 | ] 831 | 832 | [[package]] 833 | name = "sauron_vdom" 834 | version = "0.24.0" 835 | source = "registry+https://github.com/rust-lang/crates.io-index" 836 | checksum = "65977ca10d0b763d57f2c586199d368dcd6bd422d0ad1ca43e3a20734a8adb7e" 837 | dependencies = [ 838 | "log", 839 | ] 840 | 841 | [[package]] 842 | name = "serde" 843 | version = "1.0.106" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" 846 | 847 | [[package]] 848 | name = "serde_derive" 849 | version = "1.0.106" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" 852 | dependencies = [ 853 | "proc-macro2", 854 | "quote", 855 | "syn", 856 | ] 857 | 858 | [[package]] 859 | name = "serde_json" 860 | version = "1.0.51" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "da07b57ee2623368351e9a0488bb0b261322a15a6e0ae53e243cbdc0f4208da9" 863 | dependencies = [ 864 | "itoa", 865 | "ryu", 866 | "serde", 867 | ] 868 | 869 | [[package]] 870 | name = "sha-1" 871 | version = "0.8.2" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" 874 | dependencies = [ 875 | "block-buffer", 876 | "digest", 877 | "fake-simd", 878 | "opaque-debug", 879 | ] 880 | 881 | [[package]] 882 | name = "slab" 883 | version = "0.4.2" 884 | source = "registry+https://github.com/rust-lang/crates.io-index" 885 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 886 | 887 | [[package]] 888 | name = "smallvec" 889 | version = "0.6.13" 890 | source = "registry+https://github.com/rust-lang/crates.io-index" 891 | checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" 892 | dependencies = [ 893 | "maybe-uninit", 894 | ] 895 | 896 | [[package]] 897 | name = "smallvec" 898 | version = "1.4.0" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" 901 | 902 | [[package]] 903 | name = "spongedown" 904 | version = "0.4.1" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "190b92714d8df5bf4d242aa13bb4beeea7e97bf923d0872de806f36bf1e38f58" 907 | dependencies = [ 908 | "comrak", 909 | "csv", 910 | "file", 911 | "log", 912 | "svgbob", 913 | "syntect", 914 | "typed-arena", 915 | "url", 916 | "url_path", 917 | ] 918 | 919 | [[package]] 920 | name = "svgbob" 921 | version = "0.5.0-alpha.4" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "c3cf0d4d92431e4bba595b8c981958fe7130e27b0b1fcc4ba492e70cce2a50fa" 924 | dependencies = [ 925 | "itertools", 926 | "lazy_static", 927 | "nalgebra", 928 | "ncollide2d", 929 | "pom", 930 | "sauron", 931 | "unicode-width", 932 | ] 933 | 934 | [[package]] 935 | name = "syn" 936 | version = "1.0.18" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" 939 | dependencies = [ 940 | "proc-macro2", 941 | "quote", 942 | "unicode-xid", 943 | ] 944 | 945 | [[package]] 946 | name = "syntect" 947 | version = "4.1.1" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "6bc79276a4d38e39fbeb83c5fd9c23fbd027eeec7c50ee6a3d07deee33d7f621" 950 | dependencies = [ 951 | "bincode", 952 | "bitflags", 953 | "fancy-regex", 954 | "flate2", 955 | "fnv", 956 | "lazy_static", 957 | "lazycell", 958 | "plist", 959 | "regex-syntax", 960 | "serde", 961 | "serde_derive", 962 | "serde_json", 963 | "walkdir", 964 | "yaml-rust", 965 | ] 966 | 967 | [[package]] 968 | name = "thiserror" 969 | version = "1.0.15" 970 | source = "registry+https://github.com/rust-lang/crates.io-index" 971 | checksum = "54b3d3d2ff68104100ab257bb6bb0cb26c901abe4bd4ba15961f3bf867924012" 972 | dependencies = [ 973 | "thiserror-impl", 974 | ] 975 | 976 | [[package]] 977 | name = "thiserror-impl" 978 | version = "1.0.15" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "ca972988113b7715266f91250ddb98070d033c62a011fa0fcc57434a649310dd" 981 | dependencies = [ 982 | "proc-macro2", 983 | "quote", 984 | "syn", 985 | ] 986 | 987 | [[package]] 988 | name = "thread_local" 989 | version = "1.0.1" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" 992 | dependencies = [ 993 | "lazy_static", 994 | ] 995 | 996 | [[package]] 997 | name = "tinki" 998 | version = "0.1.0" 999 | dependencies = [ 1000 | "console_error_panic_hook", 1001 | "console_log", 1002 | "log", 1003 | "sauron", 1004 | "spongedown", 1005 | "url_path", 1006 | "wasm-bindgen", 1007 | "wee_alloc", 1008 | ] 1009 | 1010 | [[package]] 1011 | name = "twoway" 1012 | version = "0.2.1" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" 1015 | dependencies = [ 1016 | "memchr", 1017 | "unchecked-index", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "typed-arena" 1022 | version = "1.7.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "a9b2228007eba4120145f785df0f6c92ea538f5a3635a612ecf4e334c8c1446d" 1025 | 1026 | [[package]] 1027 | name = "typenum" 1028 | version = "1.12.0" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 1031 | 1032 | [[package]] 1033 | name = "ucd-trie" 1034 | version = "0.1.3" 1035 | source = "registry+https://github.com/rust-lang/crates.io-index" 1036 | checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" 1037 | 1038 | [[package]] 1039 | name = "unchecked-index" 1040 | version = "0.2.2" 1041 | source = "registry+https://github.com/rust-lang/crates.io-index" 1042 | checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" 1043 | 1044 | [[package]] 1045 | name = "unicode-bidi" 1046 | version = "0.3.4" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1049 | dependencies = [ 1050 | "matches", 1051 | ] 1052 | 1053 | [[package]] 1054 | name = "unicode-normalization" 1055 | version = "0.1.12" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" 1058 | dependencies = [ 1059 | "smallvec 1.4.0", 1060 | ] 1061 | 1062 | [[package]] 1063 | name = "unicode-width" 1064 | version = "0.1.7" 1065 | source = "registry+https://github.com/rust-lang/crates.io-index" 1066 | checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" 1067 | 1068 | [[package]] 1069 | name = "unicode-xid" 1070 | version = "0.2.0" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1073 | 1074 | [[package]] 1075 | name = "unicode_categories" 1076 | version = "0.1.1" 1077 | source = "registry+https://github.com/rust-lang/crates.io-index" 1078 | checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" 1079 | 1080 | [[package]] 1081 | name = "url" 1082 | version = "1.7.2" 1083 | source = "registry+https://github.com/rust-lang/crates.io-index" 1084 | checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" 1085 | dependencies = [ 1086 | "idna", 1087 | "matches", 1088 | "percent-encoding", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "url_path" 1093 | version = "0.1.3" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "10477a8879b7fc3bb4fb54fa6adcfd6191de561b13d5413fec9cc0239fd1c882" 1096 | 1097 | [[package]] 1098 | name = "walkdir" 1099 | version = "2.3.1" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" 1102 | dependencies = [ 1103 | "same-file", 1104 | "winapi", 1105 | "winapi-util", 1106 | ] 1107 | 1108 | [[package]] 1109 | name = "wasm-bindgen" 1110 | version = "0.2.60" 1111 | source = "registry+https://github.com/rust-lang/crates.io-index" 1112 | checksum = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" 1113 | dependencies = [ 1114 | "cfg-if", 1115 | "wasm-bindgen-macro", 1116 | ] 1117 | 1118 | [[package]] 1119 | name = "wasm-bindgen-backend" 1120 | version = "0.2.60" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd" 1123 | dependencies = [ 1124 | "bumpalo", 1125 | "lazy_static", 1126 | "log", 1127 | "proc-macro2", 1128 | "quote", 1129 | "syn", 1130 | "wasm-bindgen-shared", 1131 | ] 1132 | 1133 | [[package]] 1134 | name = "wasm-bindgen-macro" 1135 | version = "0.2.60" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" 1138 | dependencies = [ 1139 | "quote", 1140 | "wasm-bindgen-macro-support", 1141 | ] 1142 | 1143 | [[package]] 1144 | name = "wasm-bindgen-macro-support" 1145 | version = "0.2.60" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" 1148 | dependencies = [ 1149 | "proc-macro2", 1150 | "quote", 1151 | "syn", 1152 | "wasm-bindgen-backend", 1153 | "wasm-bindgen-shared", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "wasm-bindgen-shared" 1158 | version = "0.2.60" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" 1161 | 1162 | [[package]] 1163 | name = "web-sys" 1164 | version = "0.3.37" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" 1167 | dependencies = [ 1168 | "js-sys", 1169 | "wasm-bindgen", 1170 | ] 1171 | 1172 | [[package]] 1173 | name = "wee_alloc" 1174 | version = "0.4.5" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" 1177 | dependencies = [ 1178 | "cfg-if", 1179 | "libc", 1180 | "memory_units", 1181 | "winapi", 1182 | ] 1183 | 1184 | [[package]] 1185 | name = "winapi" 1186 | version = "0.3.8" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 1189 | dependencies = [ 1190 | "winapi-i686-pc-windows-gnu", 1191 | "winapi-x86_64-pc-windows-gnu", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "winapi-i686-pc-windows-gnu" 1196 | version = "0.4.0" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1199 | 1200 | [[package]] 1201 | name = "winapi-util" 1202 | version = "0.1.5" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1205 | dependencies = [ 1206 | "winapi", 1207 | ] 1208 | 1209 | [[package]] 1210 | name = "winapi-x86_64-pc-windows-gnu" 1211 | version = "0.4.0" 1212 | source = "registry+https://github.com/rust-lang/crates.io-index" 1213 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1214 | 1215 | [[package]] 1216 | name = "xml-rs" 1217 | version = "0.8.2" 1218 | source = "registry+https://github.com/rust-lang/crates.io-index" 1219 | checksum = "2bb76e5c421bbbeb8924c60c030331b345555024d56261dae8f3e786ed817c23" 1220 | 1221 | [[package]] 1222 | name = "yaml-rust" 1223 | version = "0.4.3" 1224 | source = "registry+https://github.com/rust-lang/crates.io-index" 1225 | checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" 1226 | dependencies = [ 1227 | "linked-hash-map", 1228 | ] 1229 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tinki" 3 | version = "0.1.0" 4 | authors = [ "Jovansonlee Cesar " ] 5 | license = "MIT" 6 | edition = "2018" 7 | repository = "https://github.com/ivanceras/tinki" 8 | description = "Markdown based personal wiki" 9 | documentation = "https://docs.rs/tinki" 10 | keywords = ["markdown", "wiki", "svgbob"] 11 | 12 | [lib] 13 | crate-type = ["cdylib"] 14 | 15 | [dependencies] 16 | sauron = { version = "0.24.0", features = ["with-dom"] } 17 | url_path = "0.1.3" 18 | log = "0.4" 19 | console_log = "0.1" 20 | spongedown = "0.4.1" 21 | wasm-bindgen = "0.2.60" 22 | console_error_panic_hook = "0.1" 23 | wee_alloc = { version = "0.4.5"} 24 | 25 | [profile.release] 26 | opt-level = 'z' # Optimize for size. 27 | lto = true 28 | codegen-units = 1 29 | panic = 'abort' 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Jovansonlee Cesar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Tinki wiki 2 | 3 | [![Latest Version](https://img.shields.io/crates/v/tinki.svg)](https://crates.io/crates/tinki) 4 | [![Build Status](https://travis-ci.org/ivanceras/tinki.svg?branch=master)](https://travis-ci.org/ivanceras/tinki) 5 | [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) 6 | 7 | [WIP] Tinki is markdown base static wiki. 8 | 9 | ## Features 10 | - client-side rendering 11 | - text base diagrams using [svgbob](https://ivanceras.github.io/svgbob-editor/) 12 | - table rendering of csv data 13 | - automatic handling of internal and external urls. 14 | - ~100 lines of code, thanks to the following libraries 15 | - [sauron](https://github.com/ivanceras/sauron) 16 | - [spongedown](https://github.com/ivanceras/spongedown) 17 | - [svgbob](https://github.com/ivanceras/svgbob) 18 | 19 | 20 | [Demo](https://ivanceras.github.io/) 21 | 22 | 23 | # Requires nightly. 24 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | 2 | - [ ] common links such as github/gist/gitlab will be converted into raw conterparts if it ends with .md 3 | - [ ] absolute link with same domain will be converted into relative link 4 | - [ ] Determine if the external link is to be redirected or loaded here 5 | - [ ] Load if it ends with me 6 | - [ ] redirect otherwise 7 | - optimize spongedown to use pulldown-cmark and sauron for faster performance 8 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | 2 | set -v 3 | wasm-pack build --target no-modules --release 4 | 5 | dest_dir="../ivanceras.github.io/" 6 | 7 | cp -r ./pkg "${dest_dir}" 8 | cp index.html "${dest_dir}" 9 | cp index.md "${dest_dir}" 10 | cp -r ./md "${dest_dir}" 11 | cp minimal.css "${dest_dir}" 12 | rm "${dest_dir}pkg/.gitignore" 13 | 14 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Ivanceras 5 | 6 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | # Jovansonlee Cesar 2 | 3 | - [Github profile](https://github.com/ivanceras) 4 | - [Resume](md/Resume.md) 5 | 6 | #### Active Opensource projects 7 | 8 | - [Spongedown](md/Spongedown.md) 9 | - [Svgbob](md/Svgbob.md) 10 | - [Svgbob specification](md/Svgbob/Specification.md) 11 | - [Design architecture](md/Svgbob/Architecture.md) 12 | - [Design implementation](md/Svgbob/Design-Implementation.md) 13 | - [Diwata](md/Diwata.md) 14 | - [Rustorm](md/Rustorm.md) 15 | 16 | #### Projects Contributed to 17 | - [sqlparser-rs](https://github.com/andygrove/sqlparser-rs) - parse sql from supported dialects 18 | - [comrak](https://github.com/kivikakk/comrak) - parse markdown files and render to html 19 | - [term-table-rs](https://github.com/RyanBluth/term-table-rs) - display tables in terminal 20 | 21 | #### Little projects 22 | - [url_path](https://github.com/ivanceras/url_path) - Manipulates url canonicalization without requiring contraint to the file system 23 | - [r2d2-sqlite](https://github.com/ivanceras/r2d2-sqlite) - An r2d2 connection pooling for sqlite 24 | - [blob-uuid](https://github.com/ivanceras/blob-uuid) - convert uuid into a url friendly 22 character string blob, useful for making url slugs 25 | 26 | #### Inactive projects 27 | - [Balisong](https://github.com/ivanceras/balisong) - An attempt to create voxel base raytracing in rust. 28 | 29 | 30 | #### Code 31 | 32 | All content on this site (including the svg images) are made with markdown. 33 | Here is the [link to the files](https://github.com/ivanceras/ivanceras.github.io/tree/master/md) 34 | -------------------------------------------------------------------------------- /md/Diwata.md: -------------------------------------------------------------------------------- 1 | # Diwata 2 | 3 | Diwata is a user-friendly and content-aware database interface. 4 | 5 | 6 | #### Features 7 | - Automatic display of direct and indirect linked record 8 | - Freeze column and freeze rows 9 | - Infinite scrolling / loading of page on scrolling 10 | - User friendly granular search and filter 11 | - Diplay descriptive referred records. (ie: Instead of displaying the foreign_key value integer or uuid, display the referred records in such a way it is distinguisable by the user) 12 | - Well integrated with the browsers, clickable tables, records and tabs can be openned in a new window and displays the data as though clicking on it. 13 | 14 | [Diwata architecture](Diwata/Architecture.md) 15 | 16 | [Code Repository](https://github.com/ivanceras/diwata) 17 | -------------------------------------------------------------------------------- /md/Diwata/Architecture.md: -------------------------------------------------------------------------------- 1 | # Diwata Architecture 2 | 3 | #### Diwata is comprised with 3 major components 4 | 5 | 1. Rustorm 6 | 2. Intel 7 | 3. Client 8 | 9 | ```bob 10 | 11 | .----------. .- - - - - - - - - -. 12 | ( Rustorm ) <|- - - -! Database metadata ! 13 | `----------' `- - - - - - - - - -' 14 | | 15 | | 16 | | 17 | | 18 | v 19 | _________ 20 | / \ . - - - - - - - - - - . 21 | / Intel \ <|- - - -! Data interpretation ! 22 | \ / `- - - - - - - - - - -' 23 | \_________/ 24 | | 25 | | 26 | | 27 | | 28 | v 29 | +--------------------+ 30 | / \ 31 | / Client \ 32 | / \ 33 | /____________________________\ 34 | 35 | ``` 36 | 37 | #### Rustorm 38 | Rustorm is the database ORM that takes care of extract table meta data 39 | from the underlying database. 40 | 41 | #### Intel 42 | Intel is the intellisense of the system which does inference of an interpreting 43 | the data being instrospected. This contains the logic for determining the presentation 44 | of the data to the client. It fills the gap when there is not enough information 45 | extracted from the system. 46 | 47 | #### Client 48 | The client does pull the curtain API and display the content in a nice 49 | and structure presentation. Aside from just being a interactice Rich client application, 50 | the client is also responsible for mapping the URL to their corresponding application 51 | state and modules activated. Sharing the URL to other users with the same login 52 | credentials will show the same exact content. 53 | 54 | [Back to Diwata](../Diwata.md) 55 | -------------------------------------------------------------------------------- /md/Markdown-example.md: -------------------------------------------------------------------------------- 1 | An h1 header 2 | ============ 3 | 4 | Paragraphs are separated by a blank line. 5 | 6 | 2nd paragraph. *Italic*, **bold**, and `monospace`. Itemized lists 7 | look like: 8 | 9 | * this one 10 | * that one 11 | * the other one 12 | 13 | Note that --- not considering the asterisk --- the actual text 14 | content starts at 4-columns in. 15 | 16 | > Block quotes are 17 | > written like so. 18 | > 19 | > They can span multiple paragraphs, 20 | > if you like. 21 | 22 | Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all 23 | in chapters 12--14"). Three dots ... will be converted to an ellipsis. 24 | Unicode is supported. ☺ 25 | 26 | 27 | 28 | An h2 header 29 | ------------ 30 | 31 | Here's a numbered list: 32 | 33 | 1. first item 34 | 2. second item 35 | 3. third item 36 | 37 | Note again how the actual text starts at 4 columns in (4 characters 38 | from the left side). Here's a code sample: 39 | 40 | # Let me re-iterate ... 41 | for i in 1 .. 10 { do-something(i) } 42 | 43 | As you probably guessed, indented 4 spaces. By the way, instead of 44 | indenting the block, you can use delimited blocks, if you like: 45 | 46 | ~~~ 47 | define foobar() { 48 | print "Welcome to flavor country!"; 49 | } 50 | ~~~ 51 | 52 | (which makes copying & pasting easier). You can optionally mark the 53 | delimited block for Pandoc to syntax highlight it: 54 | 55 | ~~~python 56 | import time 57 | # Quick, count to ten! 58 | for i in range(10): 59 | # (but not *too* quick) 60 | time.sleep(0.5) 61 | print(i) 62 | ~~~ 63 | 64 | 65 | 66 | ### An h3 header ### 67 | 68 | Now a nested list: 69 | 70 | 1. First, get these ingredients: 71 | 72 | * carrots 73 | * celery 74 | * lentils 75 | 76 | 2. Boil some water. 77 | 78 | 3. Dump everything in the pot and follow 79 | this algorithm: 80 | 81 | find wooden spoon 82 | uncover pot 83 | stir 84 | cover pot 85 | balance wooden spoon precariously on pot handle 86 | wait 10 minutes 87 | goto first step (or shut off burner when done) 88 | 89 | #### Tables 90 | 91 | | Option | Description | 92 | | ------ | ----------- | 93 | | data | path to data files to supply the data that will be passed into templates. | 94 | | engine | engine to be used for processing templates. Handlebars is the default. | 95 | | ext | extension to be used for dest files. | 96 | 97 | [Back to Spongedown](Spongedown.md) 98 | -------------------------------------------------------------------------------- /md/Resume.md: -------------------------------------------------------------------------------- 1 | # Jovansonlee B. Cesar 2 | ## Senior Software Engineer 3 | 4 | Opensource programmer with passion for innovative technologies 5 | 6 | * mobile: +639156659318 7 | * email: ivanceras@gmail.com 8 | * skype: ivanceras 9 | 10 | ## Expertise 11 | 12 | * Data analytics and visualization 13 | * Heuristic programming on complex problems 14 | * High availability and scaling solutions 15 | * Code quality and code correctness 16 | * Research and development 17 | 18 | ## Preferred Technology Stack 19 | * Linux, Rust, PostgreSQL, Webassembly 20 | 21 | 22 | ## All Technology Stack 23 | * Linux, **Rust**, PostgreSQL, Java, Php, Bash/Shell, Docker 24 | * Javascript, HTML/CSS, **Elm**, **Webassembly**, React, React-native 25 | * **PostgreSQL**,Mysql,Oracle,SQLite, Hadoop/Hive/MapReduce 26 | * git, vim, Eclipse, IntelliJ 27 | * xls+ods+csv data processing 28 | 29 | 30 | ## Professional Work Experience 31 | 32 | * **Centrifuge Inc (March 2020 - Present)** 33 | - Centrifuge-chain protocol engineer 34 | - Responsibilities: 35 | - Build and integrate substrate pallet/modules into centrifuge-chain 36 | - Build and integrate monitoring tools for blockchain validators and nodes 37 | - Technologies used: 38 | - **rust**, blockchain, cryptography, **paritytech/substrate**, polkadot network, prometheus + grafana, bash scripting 39 | 40 | 41 | * **Freelancing and opensource (May 2019 - Dec 2019)** 42 | - Self study rust and freelance contracts. 43 | - Projects: 44 | - **dns gateway module** - an independent contract project which manages and automate acquisition of ssl certificates from lets-encrypt. 45 | - dynamically serve multiple domains in one server using the appropriate certificate for the requested domain. 46 | - involves low level parsing of tcp-packets, extracting the SNI/domain name in the handshake process. 47 | - **open-api parser** - generates rust source code from open-api spec. 48 | 49 | - Technolgoies used: 50 | - **rust**, tokio, actix-web, rustls 51 | 52 | * **Senior Software Engineer at Copyleft Solutions (Jun 2017 - Dec 2018)** 53 | 54 | - Involvement 55 | - Fix and maintain existing android applications 56 | - Port excel spreadsheet apps into web application 57 | - Prototype small experimental projects involving webcam and image processing 58 | - Screened and interview talented developers into the company 59 | 60 | - Technologies used 61 | - Android/Java, typescript 62 | - Rust, gtk 63 | 64 | * **Senior Software Engineer at TRUSTe/TrustArc (Jan 2012-Jun 2017)** 65 | 66 | - Projects 67 | - Multi-region database selective syncing setup. 68 | - Setup custom configuration to selectively sync certain data from EU-US region, while complying the EU regulations 69 | of which data is not allowed to move out of EU servers. 70 | - Created a custom lightweight ORM which doesn't allow loss of data in the event of database downtime up to several hours. 71 | 72 | - Involvement 73 | - Prototype and build critical products in the organization, such as the portal which links all the apps in the organization. 74 | - Design database schema for high throughput application, such as the backend for ads system. 75 | - Research and development on processing 1TB of logs per month into an analytical report, using appropriate BigData Analytics tools such as Hadoop/Hive. 76 | - Implemented a sophisticated requirement to do selective synchronization of data into multiple database instances from different regions, in accordance to US and EU data regulations. 77 | - Brought the database to terabyte scale, making it to the top 5 AWS apps in terms of page impression. 78 | - Data recovery and correction through scraping out logs from the production servers, in the event of unexpected data loss. 79 | - Completed an backend service for doing static and dynamic analysis of ios apps. 80 | - Implemented a project involving document search using amazon ElasticSearch. 81 | 82 | - Skills used 83 | - **Java**, GWT, Amazon EMR, Amazon SDK(lambda, s3, elasticsearch) 84 | - Javascript, Angularjs, jquery, bootstrap 85 | - PostgreSQL, SymmetricDS, SQLite 86 | - Rust, python, C, bash 87 | 88 | 89 | 90 | * **Senior Software Engineer at Cebu Machine Laboratories Inc. (Oct. 2010 - Jan. 2012)** 91 | 92 | - Involvement 93 | - Research and prototype an Interactive Comic Game for the Ipad when it first came out. 94 | - Using C, Objective-C and opengl, animate 2D assets created by the artist. 95 | 96 | - Accomplishments 97 | - Used stencil and svg overlay on the 2D images, presented as a very simple solution to animate 2D images for an interactive comic game. 98 | 99 | 100 | 101 | * **Junior Software Engineer at Cebu Mitsumi Inc. (Apr 2007 - Aug 2009)** 102 | 103 | - Involvement 104 | - Maintain and improve an existing Shop Floor Control/Manufacturing Management Software. 105 | - Improved the existing UI and UX to reduce the number of actions to accomplish tasks. 106 | - Improved the flexibility of the report generator to provide a more detailed view of the data into an interactive excel spreadsheet. 107 | 108 | - Skill used 109 | - Oracle 110 | - Powerbuilder, Powerscripts 111 | - MS Excel Spreadsheet, VBA scripts and macros. 112 | 113 | 114 | 115 | ## Education 116 | * **Bohol Island State University ( 2002-2007 ), C.P.G North Avenue, Tagbilaran City, Bohol** 117 | - Bachelor of Science in Computer Engineering 118 | - Learning highlights 119 | - Linux 120 | - C, Lowlevel-C Programming, PIC 121 | - Hardware interfacing 122 | - Self-taught: php, javascript, html/css. 123 | 124 | ## Desirable qualities 125 | - I do research, experiments, exploration on my free-time on just about anything 126 | ranging from database tools, neat algorithmns, learning programming languages, 127 | voxel-based raytracing, baremetal OS. 128 | - Incorporate these learnings into company products. 129 | 130 | ## Opensource project involvement 131 | 132 | * [Svgbob](https://github.com/ivanceras/svgbob) - converts inline ascii scribbles and diagrams into a nicely rendered svg, 133 | [demo](https://ivanceras.github.io/svgbob-editor/) 134 | * [Diwata](https://github.com/ivanceras/diwata) - A user-friendly web-based database administration tool for PostgreSQL and Sqlite 135 | * [Rustorm](https://github.com/ivanceras/rustorm) - an orm for rust, primarily used by the diwata project. 136 | * [Sauron](https://github.com/ivanceras/sauron) - A very fast library for building web apps, using the latest web technology: webassembly. 137 | * [Restq](https://github.com/ivanceras/restq) - An alternative to graphql which parses http url to express an api query. 138 | 139 | -------------------------------------------------------------------------------- /md/Rustorm.md: -------------------------------------------------------------------------------- 1 | # Rustorm 2 | 3 | Rustorm is an RDBMS orm with support for API 4 | in extracting data and the database metadata. 5 | 6 | #### Supported Database: 7 | - PostgreSQL 8 | - SQLite 9 | 10 | Rustorm is wholly used by [Diwata](Diwata.md) 11 | -------------------------------------------------------------------------------- /md/Spongedown.md: -------------------------------------------------------------------------------- 1 | # Spongedown 2 | 3 | Spongedown extends markdown with support for additional useful features. 4 | - svgbob diagrams 5 | - inline csv 6 | - embedding content 7 | 8 | 9 | #### Svgbob diagram 10 | [Svgbob](Svgbob.md) makes use of textual representation of diagram and creates and svg image out of it. 11 | 12 | This is an example of svgbob diagram 13 | 14 | ```bob 15 | 16 | +-----+------+ 17 | .---> |-----|------| 18 | / |-----|------| 19 | / +-----+------+ 20 | / .--. 21 | / | | 22 | / v | 23 | .-------. / .-. .-. .-. | 24 | | Table |-. / .-->'-' '-' '-' | 25 | '-------' \ / .-----> | \ | / | 26 | \ / / | v . v | 27 | .------------. \ / / |_______/ \_____| 28 | | Flowcharts |--. / / \ / 29 | '------------' \ / / | ____ 30 | v _______ / / '--> /___/ 31 | .--------. / \---' / 32 | | Graphs |------->/ Sponge \---'-. 33 | '--------' .->\ down /----. \ ^ . /\ .-. 34 | / .->\_______/-. \ \ |_/ \/ \/ \ 35 | .--------. / / \ \ `-------> +-------------> 36 | | Comics |--' / \ \ 37 | '--------' / \ \ +------------+ 38 | / \ \ | .-----. | 39 | .----------. \ \ | ( ) +------------+ 40 | | Diagrams | \ \ | `-, .-' | .-----. | 41 | '----------' \ `---> | /,' | ( ) | 42 | \ | /' | `-. .-' | 43 | \ | | `.\ | 44 | \ | ٩(̾●̮̮̃ ̾•̃̾)۶ | `\ | 45 | \ | | | 46 | \ +------------| (,⊙–⊙,)७ | 47 | `--. +------------+ 48 | \ 49 | v .-,( ),-. 50 | ___ _ .-( )-. 51 | [___]|=| -->( ) __________ 52 | /::/ |_| '-( ).-' --->[_...__...°] 53 | '-.( ).-' 54 | \ ____ __ 55 | '--->| | |==| 56 | |____| | | 57 | /::::/ |__| 58 | 59 | ``` 60 | 61 | #### CSV 62 | 63 | CSV data are rendered as tables 64 | 65 | 66 | ```csv 67 | foo,bar,baz 68 | apple,banana,carrots 69 | rust,haskel,c 70 | 1,2,3 71 | ``` 72 | 73 | 74 | 75 | ```csv 76 | foo,bar,baz 77 | apple,banana,carrots 78 | rust,haskel,c 79 | 1,2,3 80 | ``` 81 | 82 | #### Embedding content 83 | 84 | ```csv capture as input1 85 | what,ever,goes,here 86 | will,be,captured,and 87 | can,be,referenced,later 88 | on, 89 | ``` 90 | 91 | ![](records.csv) 92 | ![](image.jpg) 93 | 94 | ![```csv][input1] 95 | 96 | #### Markdown works as is. 97 | 98 | [Render and Example markdown](Markdown-example.md) 99 | 100 | 101 | #### Links 102 | - [Code Repository](https://github.com/ivanceras/spongedown) 103 | -------------------------------------------------------------------------------- /md/Svgbob.md: -------------------------------------------------------------------------------- 1 | # Svgbob 2 | 3 | Svgbob is a diagramming model 4 | which uses a set of typing characters 5 | to approximate the intended shape. 6 | 7 | ```bob 8 | .---. 9 | /-o-/-- 10 | .-/ / /-> 11 | ( * \/ 12 | '-. \ 13 | \ / 14 | ' 15 | ``` 16 | It uses a [combination of characters](Svgbob/Specification.md) 17 | which are readily available on your keyboards. 18 | 19 | What can it do? 20 | 21 | #### Basic shapes 22 | 23 | ```bob 24 | .- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -. 25 | ! . : 26 | ! +------+ .------. .------. /\ .' `. : 27 | ! | | | | ( ) / \ .' `. ^ : 28 | ! +------+ '------' '------' '----' `. .' / # : 29 | ! _______ ________ # `.' / ^ / : 30 | ! / \ /\ \ \ o----> | ^ # / / : 31 | ! / \ / \ ) ) <----# | | ^ : / v : 32 | ! \ / \ / /_______/ v | ! : : 33 | ! \_______/ \/ o. o ! V : 34 | ! `.~~~~. : 35 | ! '. O : 36 | ! .-----------. . <. .> . '. ^ \ : 37 | ! ( ) ( ) ( ) : \ \ : 38 | ! '-----+ ,---' `> ' ` <' '.~~~~> \ v : 39 | ! |/ * : 40 | ! ' _ __ : 41 | ! __ .-. .--. .--.--. .--. .' '. ,' '. : 42 | ! (_) (__) ( ) ( ) ( ( ) ) ( ) ( ) ( ) : 43 | ! '-' `--' `--'--' `--' `._.' `.__.' : 44 | ! ! 45 | ! ___ ____ ____ _____ ! 46 | ! ,' `. ,' `. .' `. ,' `. ! 47 | ! / \ / \ / \ / \ ! 48 | ! \ / \ / ( ) ( ) ! 49 | ! `.___.' `.____.' \ / \ / ! 50 | ! `.____.' `._____.' ! 51 | ! ______ ! 52 | ! ,' `. ! 53 | ! / \ .-----. .----. ! 54 | ! | | \ / \ \ ! 55 | ! | | \ / \ \ ! 56 | ! \ / ' '----' ! 57 | ! `.______.' ! 58 | ! ! 59 | `~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' 60 | ``` 61 | 62 | #### Quick logo scribbles 63 | 64 | ```bob 65 | .---. _ 66 | /-o-/-- .--. |-| .--. 67 | .-/ / /-> /--. \ .--)-| .--.-. //.-.\ 68 | ( * \/ / O )| | |-| |->| | (+(-*-)) 69 | '-. \ /\ |-// . * | '--'-' \\'-'/ 70 | \ / \ '+'/ \__/ '--' 71 | ' '--' 72 | 73 | .----. _ 74 | | | ,--(_) 75 | __|____|__ _/ .-. \ 76 | | ______--| (_)( ) ) 77 | `-/.::::.\-' \ `-'_/ 78 | `--------' `--(_) 79 | 80 | ``` 81 | #### Box drawing 82 | 83 | Even unicode box drawing characters are supported 84 | 85 | ```bob 86 | ┌─┬┐ ╔═╦╗ ╓─╥╖ ╒═╤╕ 87 | ├─┼┤ ╠═╬╣ ╟─╫╢ ╞═╪╡ 88 | └─┴┘ ╚═╩╝ ╙─╨╜ ╘═╧╛ 89 | ╭─┬╮ 90 | ├─┼┤ 91 | ╰─┴╯ 92 | ``` 93 | 94 | 95 | #### Grids 96 | 97 | ```bob 98 | 99 | 100 | .----. .----. 101 | / \ / \ .-----+-----+-----. 102 | + +----+ +----. | | | | .-----+-----+-----+-----+ 103 | \ / \ / \ | | | | / / / / / 104 | +----+ +----+ + +-----+-----+-----+ +-----+-----+-----+-----+ 105 | / \ / \ / | | | | / / / / / 106 | + +----+ +----+ | | | | +-----+-----+-----+-----+ 107 | \ / \ / \ +-----+-----+-----+ / / / / / 108 | '----+ +----+ + | | | | +-----+-----+-----+-----+ 109 | \ / \ / | | | | / / / / / 110 | '----' '----' '-----+-----+-----' '-----+-----+-----+-----+ 111 | 112 | 113 | 114 | 115 | 116 | ___ ___ .---+---+---+---+---. .---+---+---+---. .---. .---. 117 | ___/ \___/ \ | | | | | | / \ / \ / \ / \ / | +---+ | 118 | / \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ +---+ 119 | \___/ \___/ \ | | | | | | \ / \ / \ / \ / \ | +---+ | 120 | / \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ +---+ 121 | \___/ \___/ \ | | | | | | / \ / \ / \ / \ / | +---+ | 122 | \___/ \___/ '---+---+---+---+---' '---+---+---+---' '---' '---' 123 | 124 | ``` 125 | 126 | #### Graphics Diagram 127 | 128 | ```bob 129 | . 130 | 0 3 P * Eye / ^ / 131 | *-------* +y \ +) \ / Reflection 132 | 1 /| 2 /| ^ \ \ \ v 133 | *-------* | | v0 \ ^ v3 --------*-------- 134 | | |4 | |7 | ◄╮ *----\---/-* 135 | | *-----|-* ⤹ +-----> +x / v / \ .-.<-------- o 136 | |/ |/ / ⤴ / o \ ( / ) Refraction / \ 137 | *-------* v / \ '-' / \ 138 | 5 6 +z v1 *------------------* v2 | o-----o 139 | v 140 | 141 | ``` 142 | 143 | #### Sequence Diagrams 144 | 145 | ```bob 146 | 147 | .---> F 148 | A B C D / 149 | *-------*-----*---*----*-----> E 150 | \ ^ \ 151 | v / '---> G 152 | B --> C -' 153 | 154 | 155 | ,-. 156 | `-' 157 | /|\ 158 | ,---. | 159 | |Bob| / \ 160 | `-+-' Alice 161 | | hello | 162 | |-------------->| 163 | | | 164 | | Is it ok? | 165 | |<- - - - - - - | 166 | ,-+-. Alice 167 | |Bob| ,-. 168 | `---' `-' 169 | /|\ 170 | | 171 | / \ 172 | 173 | 174 | .─. 175 | ( 0 ) 176 | `-' 177 | / \ 178 | / \ 179 | V V 180 | .─. .─. 181 | ( 1 ) ( 4 ) 182 | `-' `-' . 183 | / \ | \ `. 184 | / \ | \ `. 185 | V V | \ `. 186 | .─. .─. V V V 187 | ( 2 ) ( 3 ) .─. .─. .─. 188 | `─' `─' ( 5 ) ( 6 ) ( 7 ) 189 | `─' `─' `─' 190 | 191 | ``` 192 | 193 | #### Railroad diagrams 194 | 195 | ```bob 196 | ┌------┐ .-. ┌---┐ 197 | o--╮---| elem |--( ; )-| n |--╭--o 198 | | └------┘ `-' └---┘ | 199 | | ╭------>------╮ | 200 | | | ┌---┐ | | 201 | ╰-╯-╭--| x |--╮-╰----------╯ 202 | | | └---┘ | | 203 | | | .-. | | 204 | | `--( , )--' ^ 205 | | `-' | 206 | | ╭-------->---------╮ | 207 | | | ┌---┐ .-. | | 208 | ╰--╰-╭-| x |--( , )-╮-╯----╯ 209 | | └---┘ `-' | 210 | `-------<------' 211 | .------------>---------------. 212 | ┌-------------┐ .-. .-. | ┌------┐ .-. ┌-----┐ | .-. ┌------┐ 213 | O____| struct_name |_( : )_( | )_◞__| name |_( : )__| tpe |___◟___( | )__| body |______O 214 | ◝ └-------------┘ `-' `-' ◜ └------┘ `-' └-----┘ ◝ `-' └------┘ ◜ 215 | | | .-. | | 216 | | `------------<------( , )--' | 217 | | `-' | 218 | `--------------------------------------------------------------------------------' 219 | 220 | ``` 221 | 222 | #### Statistical charts 223 | 224 | ```bob 225 | 226 | E +-------------------------*--+ E | o 227 | D |-------------------*--*--|--* D | o o | o 228 | C |-------------*--* | | | | C | o o | | | | 229 | B |-------*--* | | | | | | B | o o | | | | | | 230 | A +-*--*--+--+--+--+--+--+--+--+ A +-o--o--|--|--|--|--|--|--|--| 231 | 5 10 15 20 25 30 35 40 45 50 5 10 15 20 25 30 35 40 45 50 232 | 233 | 234 | 235 | 85.67 ┤ ╭╮ 236 | 78.20 ┤ ││ ╭╮ 237 | 70.73 ┤ ││ ╭╮ ╭╮ ╭╮ ╭╮ ╭╯╰─╮ 238 | 63.27 ┤ ╭╮ ╭─╮ ││ ╭╯╰╮│╰─╯╰╮╭╮│╰──╯ │╭ 239 | 55.80 ┤ ╭╮ ╭╮││╭╮ ╭╮╭╮ │ ╰─╯╰─╯ ││ ││││ ╰╯ 240 | 48.33 ┤ │╰╮ ╭──╮ │││││╰╮│╰╯│ │ ╰╯ ╰╯╰╯ 241 | 40.87 ┤╭╮ │ ╰╮╭╮ ╭╯ ╰─╮╭╮╭─╯╰╯╰╯ ╰╯ ╰──╯ 242 | 33.40 ┤││ │ ╰╯╰╮╭╯ ││╰╯ 243 | 25.93 ┤││╭╯ ╰╯ ╰╯ 244 | 18.47 ┼╯││ 245 | 11.00 ┤ ╰╯ 246 | └───────────┴───────────┴───────────┴───────────┴───────────┴──── 247 | 2011 2012 2013 2014 2015 2016 248 | 249 | 250 | ``` 251 | 252 | 253 | 254 | 255 | #### Flow charts 256 | 257 | ```bob 258 | .--. .---. .---. .---. .---. .---. .---. 259 | | | OS API '---' '---' '---' '---' '---' '---' 260 | v | | | | | | | 261 | .-. .-. .-. | v v | v | v 262 | .-->'-' '-' '-' | .------------. | .-----------. | .-----. 263 | | \ | / | | Filesystem | | | Scheduler | | | MMU | 264 | | v . v | '------------' | '-----------' | '-----' 265 | |_______/ \_____| | | | | 266 | \ / v | | v 267 | | ____ .----. | | .---------. 268 | '--> /___/ | IO |<----' | | Network | 269 | '----' | '---------' 270 | | | | 271 | v v v 272 | .---------------------------------------. 273 | | HAL | 274 | '---------------------------------------' 275 | 276 | 277 | .---. .---. .---. .---. .---. .---. 278 | OS API '---' '---' '---' '---' '---' '---' 279 | | | | | | | 280 | v v | v | v 281 | .------------. | .-----------. | .-----. 282 | | 文件系统 | | | 调度器 | | | MMU | 283 | '------------' | '-----------' | '-----' 284 | | | | | 285 | v | | v 286 | .----. | | .---------. 287 | | IO |<----' | | 网络 | 288 | '----' | '---------' 289 | | | | 290 | v v v 291 | .---------------------------------------. 292 | | 硬件抽象层 | 293 | '---------------------------------------' 294 | ``` 295 | 296 | #### Block diagrams 297 | 298 | ```bob 299 | 300 | vncviewer .-,( ),-. 301 | __ _ .-( )-. gateway vncserver 302 | [__]|=| ---->( internet )-------> __________ ------> ____ __ 303 | /⠶⠶ /|_| '-( ).-' [_...__...°] | | |==| 304 | '-.( ).-' |____| | | 305 | /⠶⠶⠶ / |__| 306 | 307 | 308 | Valveless --------. 309 | Pulsejet engine / 310 | V 311 | _________.------------------+ 312 | .---------' / --------> 313 | / .-------._________ \ thrust--> 314 | ( ( _________ `-----------o------+ --------> 315 | \ `----' '----' | 316 | `------._ __^___.----. | 317 | || | | 318 | fuel __^ || | ^__spark |GND 319 | intake || | plug | 320 | || | | 321 | || | | 322 | ____|| `------------. | 323 | / .---' | | 324 | | | | | +-+-+-+-+-+ 325 | .---| |---. __ | | |-+-+-+-+-| 326 | ___| +-+-+--|--o `---------*-----|--------------O-+-+-+-+-| 327 | .-------> ___ ||||||| | power | *--------------O-+-+-+-+-| 328 | \ | ||||||| | switch | | |-+-+-+-+-| 329 | Water `-+-+-+-+-' +--o-----o--+ +-+-+-+-+-+ 330 | intake HHO | | 331 | Generator | + - | Solar panel 332 | +-----------+ 333 | Battery 334 | 335 | ======= 336 | ===== symbolic antenna 337 | === 338 | = 339 | | 340 | | micro henry 341 | | coil w/tuning lug 342 | | .----. 343 | | (.-') | 344 | | (.-') | 345 | | (.-') | pico farad cap 346 | | (.-' | ___ (trimmable) 347 | | | | |___| 348 | PC -> .----'-----'---'---' 349 | Board `------------------- 350 | ground plane (foil) 351 | 352 | ``` 353 | 354 | 355 | #### Mindmaps 356 | 357 | ```bob 358 | 359 | .--> Alpha 360 | / 361 | .----> Initial Release 362 | Planning *-------. / \ 363 | \ / '---> Patch 1 364 | Initial research \ / \ 365 | * \ / '--> Patch 2 366 | \ \ .---------> Beta 367 | \ \ / 368 | \ o o _______ 369 | \ .---. *--.___ / \ 370 | '------> ( ) '------O-> . Release . 371 | `---' o \_______/ 372 | o o o \ 373 | / \ \ \ 374 | .--' \ \ \ 375 | / \ \ '----+-> Push backs 376 | . \ \ \ 377 | /| \ \ '----> Setbacks 378 | / . \ \ 379 | V /| \ '-----> Reception 380 | Team / . \ 381 | v /| \ 382 | Worklaod / . '-->> Career change 383 | V / 384 | PTO / 385 | V 386 | Bug 387 | 388 | ``` 389 | 390 | #### Circuit diagrams 391 | 392 | It can do complex stuff such as circuit diagrams 393 | 394 | ```bob 395 | 396 | +10-15V ___0,047R 397 | *---------o-----o-|___|-o--o---------o----o-------. 398 | + | | | | | | | | 399 | -===- _|_ | | .+. | | | 400 | -===- .-. | | | | 2k2 | | | 401 | -===- 470| + | | | | | | _|_ 402 | - | uF| '--. | '+' .+. | \ / LED 403 | +---------o |6 |7 |8 1k | | | -+- 404 | ___|___ .-+----+--+--. | | | | 405 | -═══- | | '+' | | 406 | - | |1 | |/ BC | 407 | GND | +------o--+ 547 | 408 | | | | |`> | 409 | | | ,+. | | 410 | .-------+ | 220R| | o----||-+ IRF9Z34 411 | | | | | | | |+-> 412 | | | MC34063 | `+' | ||-+ 413 | | | | | | | BYV29 -12V6 414 | | | | '----' o--|<-o----o--X OUT 415 | 6000 micro - | + | |2 | | | 416 | Farad, 40V ___|_____ | |--o C| | | 417 | Capacitor ~ ~ ~ ~ ~ | | GND 30uH C| | --- 470 418 | | | |3 1nF C| | ### uF 419 | | | |-------||--. | | | + 420 | | '-----+----+-' | GND | GND 421 | | 5| 4| | | 422 | | | '-------------o-------------o 423 | | | ___ | 424 | `-------------*------/\/\/------------o--|___|-' 425 | 2k | 1k0 426 | .+. 427 | | | 5k6 + 3k3 428 | | | in Serie 429 | '+' 430 | | 431 | GND 432 | 433 | ``` 434 | 435 | ### Advantages 436 | 437 | - Plain text format 438 | - Ultimately portable, backward compatible and future proof. 439 | - Degrades gracefully 440 | - Even when not using a graphical renderer, it would still looks good 441 | as text based diagrams. 442 | - Easiest to use. 443 | - Anyone knows how to edit text. 444 | 445 | ### Goal 446 | - Make the rendered shape closely resembles to that of the textual representation. 447 | 448 | ### NON-goals 449 | - To be able to make graphs and diagrams with less effort. 450 | - To replace standard diagramming tools. 451 | 452 | 453 | #### Links 454 | - [Svgbob specification](Svgbob/Specification.md) 455 | - [Circle specification](Svgbob/Circles.md) 456 | - [Design architecture](Svgbob/Architecture.md) 457 | - [Design implementation](Svgbob/Design-Implementation.md) 458 | - [Code Respository](https://github.com/ivanceras/svgbob) 459 | - [Svgbob live editor](https://ivanceras.github.io/svgbob-editor) - an online editor which lets you easily create svgbob drawing 460 | -------------------------------------------------------------------------------- /md/Svgbob/Architecture.md: -------------------------------------------------------------------------------- 1 | # Svgbob Architecture and Design phases 2 | 3 | Svgbob creates an svg drawing based on the input ascii art diagrams. 4 | It achieves this by creating a corresponding fragment for each character, and then this little fragments 5 | are then merged to form lines and arcs. The lines and arcs are then endorsed into high level shapes such as rect, circles. 6 | 7 | ### Name inspiration: 8 | - svg for svg document and drawing. 9 | - bob for Alice and Bob as common characters in most diagrams 10 | Bob Ross - a painter who like to draws happy little trees. 11 | 12 | ### Library used 13 | - [nalgebra](https://www.nalgebra.org/) and [ncollide2d](https://ncollide.org/) for geometric function calculations such as calculating whether lines are intersecting, collinear. Computing the clipping of lines and boxes. 14 | - [pom](https://github.com/J-F-Liu/pom) for parsing the styling directives(Legend) at the bottom of the document 15 | - [sauron](https://github.com/ivanceras/sauron) for building the svg document object tree. 16 | 17 | 18 | ### **Iterations, re-architecture rewrites** 19 | 20 | #### Phase 1 21 | Exploding if statements. This was in elm 22 | [fullcode](https://github.com/ivanceras/elm-examples/blob/master/elm-bot-lines/Grid.elm) 23 | 24 | ```elm 25 | getElement x y model = 26 | let 27 | char = get x y model 28 | in 29 | case char of 30 | Just char -> 31 | if isVertical char 32 | && not (isNeighbor left isAlphaNumeric) 33 | && not (isNeighbor right isAlphaNumeric) then 34 | Just Vertical 35 | else if isHorizontal char 36 | && not (isNeighbor left isAlphaNumeric) 37 | && not (isNeighbor right isAlphaNumeric) then 38 | Just Horizontal 39 | else if isIntersection char then 40 | let 41 | isVerticalJunctionLeft = 42 | isNeighbor top isVertical 43 | && isNeighbor(bottomOf x y model) isVertical 44 | && isNeighbor(leftOf x y model) isHorizontal 45 | 46 | isVerticalJunctionRight = 47 | isNeighbor top isVertical 48 | && isNeighbor bottom isVertical 49 | && isNeighbor right isHorizontal 50 | 51 | isHorizontalJunctionTop = 52 | isNeighbor left isHorizontal 53 | && isNeighbor right isHorizontal 54 | && isNeighbor top isVertical 55 | 56 | isHorizontalJunctionBot = 57 | isNeighbor left isHorizontal 58 | && isNeighbor right isHorizontal 59 | && isNeighbor bottom isVertical 60 | 61 | isTopLeftIntersection = 62 | isNeighbor bottom isVertical && isNeighbor right isHorizontal 63 | 64 | isTopRightIntersection = 65 | isNeighbor bottom isVertical && isNeighbor left isHorizontal 66 | 67 | isBottomRightIntersection = 68 | isNeighbor top isVertical && isNeighbor left isHorizontal 69 | 70 | isBottomLeftIntersection = 71 | isNeighbor top isVertical && isNeighbor right isHorizontal 72 | 73 | isCrossIntersection = 74 | isNeighbor top isVertical 75 | && isNeighbor bottom isVertical 76 | && isNeighbor left isHorizontal 77 | && isNeighbor right isHorizontal 78 | 79 | ... 200 more lines... 80 | 81 | ``` 82 | Though elm is fast, but if you throw a lot of conditional branching to it, it will slow it down. 83 | At least I don't get to have runtime errors here if it was written in js. 84 | Adding an edgecase is just appending a new if else statement at the bottom of the statements. 85 | 86 | **Pros:** Very simple design. Just if statements and return the appropriate shape the character will take form 87 | Adding edge case behaviour is just appending an `else if` to the nearest conditional(`if`) behavior. 88 | 89 | **Caveats:** The fragments/drawing elements are named. Naming is hard, we can not name all of them. Consistency is broken. 90 | 91 | 92 | 93 | 94 | #### Phase2: 95 | Now in rust. The character behavior is stored in a `Vec<(condition, drawing_elements)>` 96 | This is already close to the current architecture. 97 | 98 | **Improvements:** 99 | - Runs a lot faster than elm. Converting the code from elm to rust, accelerate my learning of the usage of functional programming in rust. 100 | - Consumed elements, if certain group of elements matches a higher level shapes, those elements are consumed/remove from the grid to 101 | avoid generating additional drawing elements when iterated with the rest of the characters in the grid. 102 | 103 | 104 | ```rust 105 | //get the paths in the location x,y 106 | //if non path, then see if it can return a text path 107 | fn get_elements(&self, x:isize, y:isize, settings: &Settings) -> Option>{ 108 | ... 109 | //common path lines 110 | let vertical = Element::solid_line(center_top, center_bottom); 111 | let horizontal = Element::solid_line(mid_left, mid_right); 112 | let slant_left = Element::solid_line(high_left, low_right); 113 | let slant_right = Element::solid_line(low_left, high_right); 114 | let low_horizontal = Element::solid_line(low_left, low_right); 115 | 116 | 117 | let match_list: Vec<(bool, Vec)> = 118 | vec![ 119 | /* 120 | .- 121 | | 122 | */ 123 | (self.is_char(this, is_round) 124 | && self.is_char(right, is_horizontal) 125 | && self.is_char(bottom, is_vertical), 126 | vec![cxdy_cxey.clone(), arc_excy_cxdy.clone()] 127 | ), 128 | /* 129 | -. 130 | | 131 | */ 132 | (self.is_char(this, is_round) 133 | && self.is_char(left, is_horizontal) 134 | && self.is_char(bottom, is_vertical), 135 | vec![cxdy_cxey.clone(), arc_cxdy_axcy.clone()] 136 | ), 137 | /* 138 | | 139 | '- 140 | */ 141 | (self.is_char(this, is_round) 142 | && self.is_char(right, is_horizontal) 143 | && self.is_char(top, is_vertical), 144 | vec![cxay_cxby.clone(), arc_cxby_excy.clone()] 145 | ), 146 | /* 147 | | 148 | -' 149 | */ 150 | (self.is_char(this, is_round) 151 | && self.is_char(left, is_horizontal) 152 | && self.is_char(top, is_vertical), 153 | vec![cxay_cxby.clone(), arc_axcy_cxby.clone()] 154 | ), 155 | /* 156 | .- 157 | / 158 | */ 159 | (self.is_char(this, is_round) 160 | && self.is_char(right, is_horizontal) 161 | && self.is_char(bottom_left, is_slant_right), 162 | vec![axey_bxdy.clone(), arc_excy_bxdy.clone()] 163 | ), 164 | /* 165 | -. 166 | \ 167 | */ 168 | (self.is_char(this, is_round) 169 | && self.is_char(left, is_horizontal) 170 | && self.is_char(bottom_right, is_slant_left), 171 | vec![exey_dxdy.clone(), arc_dxdy_axcy.clone()] 172 | ), 173 | /* 174 | -. 175 | / 176 | */ 177 | (self.is_char(this, is_round) 178 | && self.is_char(left, is_horizontal) 179 | && self.is_char(bottom_left, is_slant_right), 180 | vec![axey_bxdy.clone(), arc_bxdy_axcy.clone()] 181 | ), 182 | /* 183 | .- 184 | \ 185 | */ 186 | (self.is_char(this, is_round) 187 | && self.is_char(right, is_horizontal) 188 | && self.is_char(bottom_right, is_slant_left), 189 | vec![exey_dxdy.clone(), arc_excy_dxdy.clone()] 190 | ), 191 | /* 192 | \ 193 | '- 194 | */ 195 | (self.is_char(this, is_round) 196 | && self.is_char(right, is_horizontal) 197 | && self.is_char(top_left, is_slant_left), 198 | vec![axay_bxby.clone(), arc_bxby_excy.clone()] 199 | ), 200 | /* 201 | / 202 | '- 203 | */ 204 | (self.is_char(this, is_round) 205 | && self.is_char(right, is_horizontal) 206 | && self.is_char(top_right, is_slant_right), 207 | vec![dxby_exay.clone(), arc_dxby_excy.clone()] 208 | ), 209 | /* 210 | \ 211 | -' 212 | */ 213 | (self.is_char(this, is_round) 214 | && self.is_char(left, is_horizontal) 215 | && self.is_char(top_left, is_slant_left), 216 | vec![axay_bxby.clone(), arc_axcy_bxby.clone()] 217 | ), 218 | /* 219 | / 220 | -' 221 | */ 222 | (self.is_char(this, is_round) 223 | && self.is_char(left, is_horizontal) 224 | && self.is_char(top_right, is_slant_right), 225 | vec![dxby_exay.clone(), arc_axcy_dxby.clone()] 226 | ), 227 | ] 228 | ``` 229 | 230 | ```rust 231 | 232 | // Circle 12 233 | // _ 234 | // .' '. 235 | // ( + ) 236 | // `._.' 237 | if self.in_left(3).is('(') 238 | && self.in_right(3).is(')') 239 | && self.in_top(2).is('_') 240 | && self.bottom().is('_') 241 | && self.top().in_left(2).any(",.") 242 | && self.top_left().is('\'') 243 | && self.top_right().any("`'") 244 | && self.top().in_right(2).is('.') 245 | && self.bottom().in_left(2).any("`'") 246 | && self.bottom_left().is('.') 247 | && self.bottom_right().any(".,") 248 | && self.bottom().in_right(2).is('\'') 249 | { 250 | elm.push(open_circle(m, 12)); 251 | consumed.extend(vec![ 252 | left3(), 253 | right3(), 254 | top2(), 255 | bottom(), 256 | top_left2(), 257 | top_left(), 258 | top_right(), 259 | top_right2(), 260 | bottom_left2(), 261 | bottom_left(), 262 | bottom_right(), 263 | bottom_right2(), 264 | ]); 265 | } 266 | ``` 267 | **Caveats:** 268 | - Merging of small fragments requires checking against all the other fragments of the entire grid. Runtime complexity is at least O(n^2) 269 | - Endorsing to shapes requires a lot of if statement comparisons and every cell is checked even for cell that has only a few elements that couldn't form into a certain shapes is tested. 270 | - Processing high level stage and low level fragment stage is one execution. 271 | - Drawing elements are still named. 272 | 273 | 274 | 275 | 276 | #### Phase 3: 277 | Attempts to add a signal strength to characters depending on their 278 | neighboring character whether they should connect or not. This makes the dynamic behavior flexible 279 | but the control flow is not very intuitive. 280 | 281 | - Strong + Strong should connect 282 | - Medium + Medium connects 283 | - Medium + Weak may connect 284 | - Weak + Weak should not connect. 285 | 286 | ```rust 287 | 288 | /// get the characteristic of a character 289 | /// it's behavior and the intended behavior 290 | /// 291 | /// ┌─┬─┬─┬─┬─┐ 292 | /// │a│b│c│d│e│ 293 | /// ├─┼─┼─┼─┼─┤ 294 | /// │f│g│h│i│j│ 295 | /// ├─┼─┼─┼─┼─┤ 296 | /// │k│l│m│n│o│ 297 | /// ├─┼─┼─┼─┼─┤ 298 | /// │p│q│r│s│t│ 299 | /// ├─┼─┼─┼─┼─┤ 300 | /// │u│v│w│x│y│ 301 | /// └─┴─┴─┴─┴─┘ 302 | /// 303 | fn get_characteristic(&self) -> Option { 304 | /////////////////////////// 305 | // 306 | // ., dot or period and comma 307 | // 308 | /////////////////////////// 309 | if self.any(".,") { 310 | Some(Characteristic { 311 | is_static: false, 312 | intensify: vec![ 313 | // -. +. 314 | ( 315 | K, 316 | Condition { 317 | loc: left(), 318 | can: ConnectTo(O, Medium), 319 | }, 320 | ), 321 | // .- .+ 322 | ( 323 | O, 324 | Condition { 325 | loc: right(), 326 | can: ConnectTo(K, Medium), 327 | }, 328 | ), 329 | // _. 330 | ( 331 | U, 332 | Condition { 333 | loc: left(), 334 | can: ConnectTo(Y, Strong), 335 | }, 336 | ), 337 | // ._ 338 | ( 339 | Y, 340 | Condition { 341 | loc: right(), 342 | can: ConnectTo(U, Strong), 343 | }, 344 | ), 345 | // . 346 | // / 347 | ( 348 | U, 349 | Condition { 350 | loc: bottom_left(), 351 | can: ConnectTo(E, Strong), 352 | }, 353 | ), 354 | // / only for / else _ 355 | // . . will connect 356 | ( 357 | E, 358 | Condition { 359 | loc: top_right(), 360 | can: IsStrongAll(vec![E, U]), 361 | }, 362 | ), 363 | // . 364 | // \ 365 | ( 366 | Y, 367 | Condition { 368 | loc: bottom_right(), 369 | can: ConnectTo(A, Strong), 370 | }, 371 | ), 372 | ... 373 | ], 374 | intended_behavior: vec![ 375 | // .- 376 | // / 377 | (vec![O, U], vec![arc(o, q, 4), line(q, u)]), 378 | // .- 379 | // \ 380 | (vec![O, Y], vec![arc(o, s, 4), line(s, y)]), 381 | // -. 382 | // \ 383 | (vec![K, Y], vec![arc(s, k, 4), line(s, y)]), 384 | // -. 385 | // / 386 | (vec![K, U], vec![line(u, q), arc(q, k, 2)]), 387 | // / 388 | // . 389 | // / 390 | (vec![U, E], vec![line(u, e)]), 391 | // \ 392 | // . 393 | // \ 394 | ... 395 | ], 396 | properties: vec![ 397 | (O, Weak, vec![arc(o, r, 2)]), 398 | (K, Weak, vec![arc(r, k, 2)]), 399 | (W, Medium, vec![line(r, w)]), 400 | (U, Weak, vec![line(q, u)]), 401 | (Y, Weak, vec![line(s, y)]), 402 | (A, Weak, vec![line(m, a)]), 403 | (E, Weak, vec![line(m, e)]), 404 | (F, Weak, vec![line(m, f)]), 405 | (J, Weak, vec![line(m, j)]), 406 | ], 407 | }) 408 | } 409 | ``` 410 | 411 | **Pros:** 412 | - Characters are assigned with certain properties. This allows similar characters such as dash(-) and line drawing (-) to have the same behavior 413 | without explicitly coding for each of those variations. 414 | 415 | 416 | #### Phase 4. 417 | 418 | **Improvements:** 419 | - Uses of Buffers 420 | - StringBuffer, input strings are slices into rows and columns 421 | - CellBuffer, which cells contains which character. 422 | - FragmentBuffer, which cell contains what fragments(drawing elements) 423 | - PropertyBuffer, what is the property of each cell based on the the character it contains. 424 | 425 | PropertyBuffer is calculated only once for each character, so the succeeding lookup should not waste execution time to recompute. 426 | 427 | 428 | **How the fragments are conceived based on a character?** 429 | 430 | **Neighbor character:** There are 8 neighbors of a character and each character on the input is checked agains this 8 neighbor for appropriate drawing element 431 | 432 | ```bob 433 | +---------+ +------+ +--------+ 434 | | TopLeft| | Top | |TopRight| 435 | +---------+ +------+ +--------+ 436 | +---------+ +------+ +--------+ 437 | | Left | |(char)| | Right | 438 | +---------+ +------+ +--------+ 439 | +----------+ +------+ +-----------+ 440 | |BottomLeft| |Bottom| |BottomRight| 441 | +----------+ +------+ +-----------+ 442 | ``` 443 | 444 | **Character Grid:** a 5x5 grid which covers the most significant points for a character to be converted into drawing elements. 445 | 446 | Character grid: / is the line connecting E to U. Dash is connecting K to O, etc. 447 | ```bob 448 | 449 | 0 1 2 3 4 B C D 450 | 0┌─┬─┬─┬─┐ A┌─┬─┬─┬─┐E 451 | 1├─┼─┼─┼─┤ │ │ │ │ │ 452 | 2├─┼─┼─┼─┤ F├─G─H─I─┤J 453 | 3├─┼─┼─┼─┤ │ │ │ │ │ 454 | 4├─┼─┼─┼─┤ K├─L─M─N─┤O 455 | 5├─┼─┼─┼─┤ │ │ │ │ │ 456 | 6├─┼─┼─┼─┤ P├─Q─R─S─┤T 457 | 7├─┼─┼─┼─┤ │ │ │ │ │ 458 | 8└─┴─┴─┴─┘ U└─┴─┴─┴─┘Y 459 | V W X 460 | 461 | ``` 462 | These fragments are processed such as merging collinear lines that are touching their endpoints. 463 | 464 | ```bob 465 | 466 | +--------------+ +------------+ +----------------+ +-----------------+ 467 | | StringBuffer |------> | CellBuffer |-------->| FragmentBuffer |--------->| Svg drawing | 468 | +--------------+ +------------+ +----------------+ +-----------------+ 469 | \ ^ 470 | \ +-------+ / 471 | `-->| Spans | / 472 | +-------+ / 473 | \ / 474 | \ +---------------+ .----------------. / 475 | `-->|Contact groups |---/ endorse shapes /--' 476 | +---------------+ '----------------' 477 | ``` 478 | 479 | - **Optimizations.** 480 | - Usage of span and contact groups. 481 | Span group together that are neighbors. Contact groups group together fragments 482 | that are touching together. Cells don't need to be checked against other cells 483 | when they are far from each other. Merging of fragments such as lines into longer 484 | lines needs to interact only elements that are within its group. 485 | - Endorsing group of fragments into higher level shapes. 486 | - rect, rounded rect, circles, arcs are higher level shapes that are from small fragment components: arc,lines, 487 | 488 | - **Tagging shapes.** 489 | Text inside of a shape with the pattern "{", "}" will become a tag of the enclosing shape. 490 | At the DOM level, the shape is an svg dom element such as: rect,circle,path and the tag is the element `class` 491 | which you can use css to apply a style to the element. The legend part at the bottom of the document is parsed 492 | and converted into css which is then appended to the svg document. 493 | 494 | ```rust 495 | 496 | /// 497 | /// 0 1 2 3 4 B C D 498 | /// 0┌─┬─┬─┬─┐ A┌─┬─┬─┬─┐E 499 | /// 1├─┼─┼─┼─┤ │ │ │ │ │ 500 | /// 2├─┼─┼─┼─┤ F├─G─H─I─┤J 501 | /// 3├─┼─┼─┼─┤ │ │ │ │ │ 502 | /// 4├─┼─┼─┼─┤ K├─L─M─N─┤O 503 | /// 5├─┼─┼─┼─┤ │ │ │ │ │ 504 | /// 6├─┼─┼─┼─┤ P├─Q─R─S─┤T 505 | /// 7├─┼─┼─┼─┤ │ │ │ │ │ 506 | /// 8└─┴─┴─┴─┘ U└─┴─┴─┴─┘Y 507 | /// V W X 508 | pub static ref ASCII_PROPERTIES: BTreeMap = { 509 | 510 | ... 511 | 512 | vec![ 513 | 514 | ////////////////////// 515 | // dot period . 516 | ////////////////////// 517 | ( 518 | '.', 519 | vec![ 520 | (Medium, vec![line(m,w)]), // connects down 521 | (Weak, vec![line(m,k)]), // connects left 522 | (Weak, vec![line(m,o)]), // connects right 523 | ], 524 | Arc::new( 525 | move|top_left, top, top_right, left, right, bottom_left, bottom, bottom_right| { 526 | vec![ 527 | // . 528 | // | 529 | (bottom.line_strongly_overlap(c,h), vec![line(r,w)]), 530 | // . 531 | // / \ 532 | (bottom_left.line_strongly_overlap(e,i) && bottom_right.line_strongly_overlap(a,g), vec![line(m,u), line(m,y)]), 533 | // .- 534 | // | 535 | (right.line_overlap(k,l) && bottom.line_overlap(c,h), vec![arc(o,r,unit2), line(r,w)]), 536 | // .- 537 | // | 538 | (right.line_overlap(k,l) && bottom_left.line_overlap(c,h), vec![arc(m,cell.bottom_left().c(),unit4), line(m,o)]), 539 | // -. 540 | // | 541 | (left.line_overlap(n,o) && bottom.line_overlap(c,h), vec![arc(r,k,unit2), line(r,w)]), 542 | // -. 543 | // | 544 | // exemption that bottom right is not a backquote 545 | (!bottom_right.is('`') && left.line_overlap(n,o) && bottom_right.line_overlap(c,h), vec![arc(cell.bottom_right().c(),m,unit4), line(k,m)]), 546 | // .- 547 | // / 548 | (right.line_overlap(k,l) && bottom_left.line_overlap(e,i), vec![arc(o, q, unit4), line(q, u)]), 549 | // .- 550 | // \ 551 | (right.line_overlap(k,l) && bottom_right.line_overlap(a,g) , vec![arc(o, s, between1_2), line(s, y)]), 552 | // -. 553 | // \ 554 | (left.line_overlap(n,o) && bottom_right.line_overlap(a,g), vec![arc(s, k, unit4), line(s, y)]), 555 | // -. 556 | // / 557 | (left.line_overlap(n,o) && bottom_left.line_overlap(e,i), vec![arc(q, k, between1_2), line(u, q)]), 558 | 559 | ... 560 | ]} 561 | ) 562 | ), 563 | ``` 564 | 565 | #### **Endorse to higher level shapes** 566 | 567 | ```rust 568 | 569 | /// First phase of endorsing to shapes, in this case, rects and rounded_rects 570 | /// 571 | /// This function is calling on endorse methods that is applicable 572 | /// to fragments that are touching, to be promoted to a shape. 573 | /// These includes: rect, roundedrect, 574 | fn endorse_rects(groups: Vec) -> (Vec, Vec) { 575 | let mut fragments = vec![]; 576 | let mut un_endorsed_rect: Vec = vec![]; 577 | for group in groups { 578 | if let Some(fragment) = is_rect(group) { 579 | fragments.push(fragment); 580 | } else { 581 | un_endorsed_rect.push(group); 582 | } 583 | } 584 | (fragments, un_endorsed_rect) 585 | } 586 | 587 | ... 588 | 589 | /// group of fragments can be check if they form: 590 | /// - rectangle 591 | fn is_rect(fragments: &Vec) -> bool { 592 | if fragments.len() == 4 { 593 | let parallels = parallel_aabb_group(fragments); 594 | if parallels.len() == 2 { 595 | let (a1, a2) = parallels[0]; 596 | let (b1, b2) = parallels[1]; 597 | let line_a1 = fragments[a1].as_line(); 598 | let line_b1 = fragments[b1].as_line(); 599 | let line_a2 = fragments[a2].as_line(); 600 | let line_b2 = fragments[b2].as_line(); 601 | line_a1.is_touching_aabb_perpendicular(line_b1) 602 | && line_a2.is_touching_aabb_perpendicular(line_b2) 603 | } else { 604 | false 605 | } 606 | } else { 607 | false 608 | } 609 | } 610 | 611 | ... 612 | 613 | /// [X](Done) TODO: search only the subset of contacts that matches the circle. 614 | /// if it is a subset then the circle is matched and the non-matching ones are returned 615 | pub fn endorse_circle(search: &Vec) -> Option<(&Circle, Vec)> { 616 | FRAGMENTS_CIRCLE.iter().rev().find_map(|(contacts, circle)| { 617 | let (matched, unmatched) = is_subset_of(contacts, search); 618 | if matched { Some((circle, unmatched)) } else { None } 619 | }) 620 | } 621 | 622 | ... 623 | 624 | /// This function is calling on endorse algorithmn on fragments that 625 | /// are neighbors, but not necessarily touching to be promoted to a shape. 626 | /// These includes: circle, arc, and line with arrow heads. 627 | fn endorse_circles_and_arcs(groups: Vec) -> (Vec, Vec) { 628 | let mut fragments = vec![]; 629 | let mut un_endorsed_circles: Vec = vec![]; 630 | if let Some((circle, unmatched)) = circle_map::endorse_circle(&groups) { 631 | fragments.push(circle.clone().into()); 632 | for um in unmatched { 633 | un_endorsed_circles.push(groups[um].clone()); 634 | } 635 | } else if let Some(arc) = circle_map::endorse_arc(&groups) { 636 | fragments.push(arc.clone().into()); 637 | } else { 638 | un_endorsed_circles.extend(groups) 639 | } 640 | (fragments, un_endorsed_circles) 641 | } 642 | ``` 643 | 644 | ```rust 645 | 646 | // ascii art, Center Cell, Center Point, radius 647 | pub static ref CIRCLE_MAP: Vec<(&'static str, Cell, Point, f32)> = 648 | vec![ 649 | // CIRCLE_1 650 | //center 0,0,o, radius = 0.5 651 | (r#" 652 | () 653 | "#, Cell::new(0,0), Cell::new(0,0).o(), 0.5), 654 | 655 | ... 656 | 657 | // CIRCLE_4 658 | //center: 2,1,m radius: 2.0 659 | (r#" 660 | ,-. 661 | ( ) 662 | `-' 663 | "#, Cell::new(2,1), Cell::new(2,1).m(), 2.0), 664 | 665 | 666 | // CIRCLE_12 667 | //center:6,3,m radius: 6.0 668 | (r#" 669 | _____ 670 | ,' `. 671 | / \ 672 | ( ) 673 | \ / 674 | `._____.' 675 | "#, Cell::new(6,3), Cell::new(6,3).m(), 6.0), 676 | 677 | // CIRCLE_17 678 | //center: 8,4,o radius: 8.5 679 | (r#" 680 | .--------. 681 | ,' `. 682 | / \ 683 | | | 684 | | | 685 | | | 686 | \ / 687 | `. .' 688 | `--------' 689 | "#, Cell::new(8,4), Cell::new(8,4).o(), 8.5), 690 | 691 | 692 | ... 693 | 694 | // CIRCLE_20 695 | // center: 10,5,m radius: 10 696 | (r#" 697 | _.-'''''''-._ 698 | ,' `. 699 | / \ 700 | . . 701 | | | 702 | | | 703 | | | 704 | \ / 705 | `._ _.' 706 | '-.......-' 707 | "#, Cell::new(10,5), Cell::new(10,5).m(), 10.0), 708 | ]; 709 | 710 | ``` 711 | 712 | #### Flexibility: 713 | - Adding behaviours and edge-cases is still simple 714 | - Due to the grouping of spans and contacts, it is now more efficient to check whether a combination 715 | of fragments can be endorsed into a high level shapes. 716 | - Behavior can be coded according to the properties of their neighboring characters, 717 | and/or can also specify that a neighbor should match a specific character. (ie: neighboring character top should be a caret `^`, then this is the behavior) 718 | 719 | #### Modular: 720 | - Adding more shapes it can endorse to, such as in the circle map is merely putting the ascii art 721 | to right next to the existing ones, as oppused to the multiple if-statements in Phase 2 722 | - Adding endorse code to certain shapes is merely describing the filter rules on the combination of the fragments 723 | 724 | #### Extensiblity: 725 | - Since the new architecture is now implemented through the use of Buffers. It opens to a lot of possible improvements. 726 | - Shapes are now properly endorsed, which can be styled with css standard. Which means, users can add crazy css-animation to the shapes. 727 | - Making the cell buffer as a canvas. Meaning you can draw lines and shapes on it, while the system will try to match 728 | the closest character appropriate to the input shape. A possibility of generating an ascii drawing from svg diagrams. 729 | The reverse of the functionality of svgbob. 730 | 731 | #### Adaption of svgbob 732 | - As archlinux [package](https://aur.archlinux.org/packages/svgbob-git/) 733 | - As diagram module for [asciidoctor](https://asciidoctor.org/docs/asciidoctor-diagram/) 734 | - [Asciigrid](https://gitlab.com/mbarkhau/asciigrid/) 735 | - [kroki.io](https://kroki.io/) 736 | 737 | -------------------------------------------------------------------------------- /md/Svgbob/Circles.md: -------------------------------------------------------------------------------- 1 | ## Circles 2 | 3 | #### Radius 1 4 | 5 |
6 |
7 | 8 | ```none 9 | _ 10 | (_) 11 | 12 | ``` 13 |
14 |
15 | 16 | ```bob 17 | _ 18 | (_) 19 | 20 | ``` 21 |
22 |
23 | 24 |
25 |
26 | 27 | ```none 28 | 29 | ``` 30 |
31 |
32 | 33 | ```bob 34 | 35 | ``` 36 |
37 |
38 | 39 | 40 | #### Radius 2 41 | 42 |
43 |
44 | 45 | ```none 46 | __ 47 | (__) 48 | 49 | ``` 50 |
51 |
52 | 53 | ```bob 54 | __ 55 | (__) 56 | 57 | ``` 58 |
59 |
60 | 61 | 62 | #### Radius 3 63 | 64 |
65 |
66 | 67 | ```none 68 | 69 | .-. 70 | ( ) 71 | `-' 72 | 73 | ``` 74 |
75 |
76 | 77 | ```bob 78 | 79 | .-. 80 | ( ) 81 | `-' 82 | 83 | ``` 84 |
85 |
86 | 87 | #### Radius 4 88 | 89 |
90 |
91 | 92 | ```none 93 | 94 | .--. 95 | ( ) 96 | `--' 97 | 98 | ``` 99 |
100 |
101 | 102 | ```bob 103 | 104 | .--. 105 | ( ) 106 | `--' 107 | ``` 108 |
109 |
110 | 111 | #### Radius 5 112 | 113 |
114 |
115 | 116 | ```none 117 | _ 118 | .' '. 119 | ( ) 120 | `._.' 121 | 122 | ``` 123 |
124 |
125 | 126 | ```bob 127 | 128 | _ 129 | .' '. 130 | ( ) 131 | `._.' 132 | 133 | ``` 134 |
135 |
136 | 137 | #### Radius 6 138 | 139 |
140 |
141 | 142 | ```none 143 | 144 | __ 145 | ,' `. 146 | ( ) 147 | `.__,' 148 | 149 | ``` 150 |
151 |
152 | 153 | ```bob 154 | 155 | __ 156 | ,' `. 157 | ( ) 158 | `.__,' 159 | 160 | ``` 161 |
162 |
163 | 164 | #### Radius 7 165 | 166 |
167 |
168 | 169 | ```none 170 | 171 | ___ 172 | ,' `. 173 | / \ 174 | \ / 175 | `.___,' 176 | 177 | ``` 178 |
179 |
180 | 181 | ```bob 182 | 183 | ___ 184 | ,' `. 185 | / \ 186 | \ / 187 | `.___,' 188 | 189 | ``` 190 |
191 |
192 | 193 | #### Radius 8 194 | 195 |
196 |
197 | 198 | ```none 199 | 200 | ____ 201 | ,' `. 202 | / \ 203 | \ / 204 | `.____,' 205 | 206 | ``` 207 |
208 |
209 | 210 | ```bob 211 | 212 | ____ 213 | ,' `. 214 | / \ 215 | \ / 216 | `.____,' 217 | 218 | ``` 219 |
220 |
221 | 222 | #### Radius 9 223 | 224 |
225 |
226 | 227 | ```none 228 | 229 | ____ 230 | ,' `. 231 | / \ 232 | ( ) 233 | \ / 234 | `.____,' 235 | 236 | ``` 237 |
238 |
239 | 240 | ```bob 241 | 242 | ____ 243 | ,' `. 244 | / \ 245 | ( ) 246 | \ / 247 | `.____,' 248 | 249 | ``` 250 |
251 |
252 | 253 | #### Radius 10 254 | 255 |
256 |
257 | 258 | ```none 259 | 260 | _____ 261 | ,' `. 262 | / \ 263 | ( ) 264 | \ / 265 | `._____,' 266 | 267 | ``` 268 |
269 |
270 | 271 | ```bob 272 | 273 | _____ 274 | ,' `. 275 | / \ 276 | ( ) 277 | \ / 278 | `._____,' 279 | 280 | ``` 281 |
282 |
283 | 284 | #### Radius 11 285 | 286 | 287 |
288 |
289 | 290 | ```none 291 | 292 | ______ 293 | ,' `. 294 | / \ 295 | | | 296 | | | 297 | \ / 298 | `.______,' 299 | 300 | ``` 301 |
302 |
303 | 304 | ```bob 305 | 306 | ______ 307 | ,' `. 308 | / \ 309 | | | 310 | | | 311 | \ / 312 | `.______,' 313 | 314 | ``` 315 |
316 |
317 | 318 | #### Radius 12 319 | 320 |
321 |
322 | 323 | ```none 324 | 325 | ________ 326 | ,' `. 327 | / \ 328 | | | 329 | | | 330 | \ / 331 | `.________,' 332 | 333 | ``` 334 |
335 |
336 | 337 | ```bob 338 | 339 | ________ 340 | ,' `. 341 | / \ 342 | | | 343 | | | 344 | \ / 345 | `.________,' 346 | 347 | ``` 348 |
349 |
350 | 351 | #### Radius 13 352 | 353 |
354 |
355 | 356 | ```none 357 | ________ 358 | ,' `. 359 | / \ 360 | | | 361 | | | 362 | | | 363 | \ / 364 | `.________,' 365 | 366 | ``` 367 |
368 |
369 | 370 | ```bob 371 | ________ 372 | ,' `. 373 | / \ 374 | | | 375 | | | 376 | | | 377 | \ / 378 | `.________,' 379 | 380 | ``` 381 |
382 |
383 | 384 | #### Radius 14 385 | 386 |
387 |
388 | 389 | ```none 390 | 391 | _________ 392 | ,' `. 393 | / \ 394 | | | 395 | | | 396 | | | 397 | \ / 398 | `._________,' 399 | 400 | ``` 401 |
402 |
403 | 404 | ```bob 405 | 406 | _________ 407 | ,' `. 408 | / \ 409 | | | 410 | | | 411 | | | 412 | \ / 413 | `._________,' 414 | ``` 415 |
416 |
417 | 418 | #### Radius 15 419 | 420 |
421 |
422 | 423 | ```none 424 | 425 | _.-'''''-._ 426 | ,' `. 427 | / \ 428 | . . 429 | | | 430 | | | 431 | | | 432 | \ / 433 | `._ _,' 434 | '-.....-' 435 | 436 | ``` 437 |
438 |
439 | 440 | ```bob 441 | 442 | _.-'''''-._ 443 | ,' `. 444 | / \ 445 | . . 446 | | | 447 | | | 448 | | | 449 | \ / 450 | `._ _,' 451 | '-.....-' 452 | 453 | ``` 454 |
455 |
456 | 457 | [Back to Svgbob](../Svgbob.md) 458 | -------------------------------------------------------------------------------- /md/Svgbob/Design-Implementation.md: -------------------------------------------------------------------------------- 1 | # Design Implementation 2 | 3 | Svgbob converts characters into a graphical element, however listing every possible combination of characters for each of the 8 neighbors 4 | would be exhausting and impractical. 5 | 6 | For each character, we will subdivide it into 25 blocks at 5x5 cells. 7 | 8 | ```bob 9 | 10 | ┌─┬─┬─┬─┬─┐ 11 | │a│b│c│d│e│ 12 | ├─┼─┼─┼─┼─┤ 13 | │f│g│h│i│j│ 14 | ├─┼─┼─┼─┼─┤ 15 | │k│l│m│n│o│ 16 | ├─┼─┼─┼─┼─┤ 17 | │p│q│r│s│t│ 18 | ├─┼─┼─┼─┼─┤ 19 | │u│v│w│x│y│ 20 | └─┴─┴─┴─┴─┘ 21 | 22 | ``` 23 | 24 | So, a character like `-` it will be line connecting from block `k` to block `o` 25 | -------------------------------------------------------------------------------- /md/Svgbob/Specification.md: -------------------------------------------------------------------------------- 1 | # Svgbob Specification 2 | 3 | #### Characters 4 | Svgbob relies on set of characters that are easily accessible on your keypad. 5 | Each of these character has certain set of behaviors depending on the neighbor character. 6 | 7 | These are the most common characters that are used. 8 | ```csv 9 | Character, Common Name 10 | ., period or dot 11 | ",", comma 12 | `, backtick or backquote 13 | ', quote or singlequote 14 | +,plus sign or cross 15 | *,asterisk 16 | o, letter o 17 | O, capital letter O 18 | -, dash or hypen 19 | |, vertical bar 20 | ~, tilde 21 | _, underscore 22 | :, colon 23 | !, exclamation mark 24 | <, less than sign 25 | >, greater than sign 26 | v, letter v 27 | V, capital letter V 28 | ^, caret 29 | /, Forward slash 30 | \, Backward slash 31 | """",Double quote 32 | 33 | 34 | 35 | ``` 36 | 37 | 38 | ## Character general behaviors 39 | 40 | #### Period `.` 41 | - Period makes a rounded corner on the top-left if a line connects to it from the bottom 42 | and from the right. 43 |
44 |
45 | 46 | ```none 47 | .-- 48 | | 49 | ``` 50 |
51 |
52 | 53 | ```bob 54 | .-- 55 | | 56 | ``` 57 |
58 |
59 | 60 | 61 | 62 | - Period makes a rounded corner on the top-right if a line connects to it from the bottom 63 | and from the left. 64 |
65 |
66 | 67 | 68 | ```none 69 | --. 70 | | 71 | ``` 72 |
73 |
74 | 75 | ```bob 76 | --. 77 | | 78 | ``` 79 |
80 |
81 | 82 | 83 | 84 | #### Comma `,` 85 | Comma makes a rounded corner on the top-left if a line connects to it from the bottom 86 | and from the right. 87 |
88 |
89 | 90 | ```none 91 | ,-- 92 | | 93 | ``` 94 |
95 |
96 | 97 | ```bob 98 | ,-- 99 | | 100 | ``` 101 |
102 |
103 | 104 | 105 | 106 | #### Backtick `` ` `` 107 | Backtick makes a rounded corner on the bottom-left if a line connects to it from the top 108 | and from the right. 109 |
110 |
111 | 112 | ```none 113 | | 114 | `-- 115 | ``` 116 |
117 |
118 | 119 | ```bob 120 | | 121 | `-- 122 | ``` 123 |
124 |
125 | 126 | 127 | 128 | #### Single quote `'` 129 | - Single quote makes a rounded corner on the bottom-left if a line connects to it from the top 130 | and from the right. 131 |
132 |
133 | 134 | ```none 135 | | 136 | '-- 137 | ``` 138 |
139 |
140 | 141 | ```bob 142 | | 143 | '-- 144 | ``` 145 |
146 |
147 | 148 | 149 | 150 | - Single quote makes a rounded corner on the bottom-right if a line connects to it from the top 151 | and from the left. 152 |
153 |
154 | 155 | ```none 156 | | 157 | --' 158 | ``` 159 |
160 |
161 | 162 | ```bob 163 | | 164 | --' 165 | ``` 166 |
167 |
168 | 169 | 170 | 171 | #### Plus sign `+` 172 | - Plus sign makes a sharp corner when connected from 2 perpendicular lines. 173 |
174 |
175 | 176 | ```none 177 | +-- --+ 178 | | | 179 | 180 | | | 181 | +-- --+ 182 | ``` 183 |
184 |
185 | 186 | ```bob 187 | +-- --+ 188 | | | 189 | 190 | | | 191 | +-- --+ 192 | ``` 193 |
194 |
195 | 196 | 197 | - Plus sign makes an intersection when connected from 4 directions (top, right, bottom, left) 198 |
199 |
200 | 201 | ```none 202 | | 203 | --+-- 204 | | 205 | ``` 206 |
207 |
208 | 209 | ```bob 210 | | 211 | --+-- 212 | | 213 | ``` 214 |
215 |
216 | 217 | 218 | 219 | #### Asterisk `*` 220 | Asterisk makes small solid circle when connected to a line 221 |
222 |
223 | 224 | ```none 225 | *--- ---* 226 | ``` 227 |
228 |
229 | 230 | ```bob 231 | *--- ---* 232 | ``` 233 |
234 |
235 | 236 | 237 | 238 | #### Small letter `o` 239 | The letter **o** makes small clear circle when connected to a line 240 |
241 |
242 | 243 | ```none 244 | o--- ---o 245 | ``` 246 |
247 |
248 | 249 | ```bob 250 | o--- ---o 251 | ``` 252 |
253 |
254 | 255 | 256 | 257 | #### Big letter `O` 258 | The big letter **O** makes bigger clear circle when connected to a line 259 |
260 |
261 | 262 | ```none 263 | O--- ---O--- 264 | ``` 265 |
266 |
267 | 268 | ```bob 269 | O--- ---O--- 270 | ``` 271 |
272 |
273 | 274 | 275 | 276 | #### Dash `-` 277 | Dash makes a solid line. Place them next to each other to form a longer line 278 |
279 |
280 | 281 | ```none 282 | --------------- 283 | ``` 284 |
285 |
286 | 287 | 288 | ```bob 289 | --------------- 290 | ``` 291 |
292 |
293 | 294 | 295 | 296 | #### Broken line `- - -` 297 | 3 dash line with space in-between them (ie: `- - -`) makes a broken line 298 |
299 |
300 | 301 | ```none 302 | - - - - - - - - - - - 303 | ``` 304 |
305 |
306 | 307 | ```bob 308 | - - - - - - - - - - - 309 | ``` 310 |
311 |
312 | 313 | 314 | 315 | #### Vertical bar `|` 316 | Vertical bar makes a vertical line 317 |
318 |
319 | 320 | ```none 321 | | 322 | | 323 | ``` 324 |
325 |
326 | 327 | ```bob 328 | | 329 | | 330 | ``` 331 |
332 |
333 | 334 | 335 | 336 | #### Tilde `~` 337 | Tilde makes a broken line 338 |
339 |
340 | 341 | ```none 342 | ~~~~~~~~~~~~~ 343 | ``` 344 |
345 |
346 | 347 | ```bob 348 | ~~~~~~~~~~~~~ 349 | ``` 350 |
351 |
352 | 353 | 354 | 355 | #### Underscore `_` 356 | Underscore makes lowered solid line 357 |
358 |
359 | 360 | ```none 361 | ________________ 362 | ``` 363 |
364 |
365 | 366 | ```bob 367 | ________________ 368 | ``` 369 |
370 |
371 | 372 | 373 | 374 | #### Colon `:` 375 | Colon makes vertical broken line 376 |
377 |
378 | 379 | ```none 380 | : 381 | : 382 | ``` 383 |
384 |
385 | 386 | ```bob 387 | : 388 | : 389 | ``` 390 |
391 |
392 | 393 | 394 | 395 | #### Exclamation mark `!` 396 | Exclamation mark makes a vertical broken line 397 |
398 |
399 | 400 | ```none 401 | ! 402 | ! 403 | ``` 404 |
405 |
406 | 407 | ```bob 408 | ! 409 | ! 410 | ``` 411 |
412 |
413 | 414 | 415 | 416 | #### Less than sign `<` 417 | Less than sign makes an arrow to the left if a line connects to it from the right 418 |
419 |
420 | 421 | ```none 422 | <----- 423 | ``` 424 |
425 |
426 | 427 | ```bob 428 | <----- 429 | ``` 430 |
431 |
432 | 433 | 434 | 435 | #### Greater than sign `>` 436 | Greather than sign makes an arrow to the right if a line connects to it from left 437 |
438 |
439 | 440 | ```none 441 | -----> 442 | ``` 443 |
444 |
445 | 446 | ```bob 447 | -----> 448 | ``` 449 |
450 |
451 | 452 | 453 | 454 | #### Letter `V` (both lowercase and capital) 455 | - Letter `V` makes an arrow pointing bottom if a line connects to it from the top 456 |
457 |
458 | 459 | ```none 460 | | 461 | V 462 | ``` 463 |
464 |
465 | 466 | 467 | ```bob 468 | | 469 | V 470 | ``` 471 |
472 |
473 | 474 | 475 | 476 | - Letter `V` makes an arrow pointing bottom-left if a line connects to it from the top-right 477 |
478 |
479 | 480 | ```none 481 | / 482 | V 483 | ``` 484 |
485 |
486 | 487 | ```bob 488 | / 489 | V 490 | ``` 491 |
492 |
493 | 494 | 495 | - Letter `V` makes an arrow pointing bottom-right if a line connects to it from the top-left 496 |
497 |
498 | 499 | ```none 500 | \ 501 | V 502 | ``` 503 |
504 |
505 | 506 | 507 | ```bob 508 | \ 509 | V 510 | ``` 511 |
512 |
513 | 514 | 515 | 516 | #### Caret `^` 517 | - makes an upward arrow if a line connects to it from the bottom 518 |
519 |
520 | 521 | ```none 522 | ^ 523 | | 524 | ``` 525 |
526 |
527 | 528 | ```bob 529 | ^ 530 | | 531 | ``` 532 |
533 |
534 | 535 | 536 | - makes an arrow pointing top-left if a line connects to it from the bottom-right 537 |
538 |
539 | 540 | ```none 541 | ^ 542 | \ 543 | ``` 544 |
545 |
546 | 547 | ```bob 548 | ^ 549 | \ 550 | ``` 551 |
552 |
553 | 554 | 555 | 556 | - makes an arrow pointing top-right if a line connects to it from the bottom-left 557 |
558 |
559 | 560 | ```none 561 | ^ 562 | / 563 | ``` 564 |
565 |
566 | 567 | ```bob 568 | ^ 569 | / 570 | ``` 571 |
572 |
573 | 574 | #### Forward slash 575 | 576 | Forward slash makes a 60 degree angled lines 577 | 578 |
579 |
580 | 581 | ```none 582 | / 583 | / 584 | ``` 585 |
586 |
587 | 588 | ```bob 589 | / 590 | / 591 | ``` 592 |
593 |
594 | 595 | #### Backslash 596 | 597 | Backslash makes a 120 desgree angled lines 598 | 599 |
600 |
601 | 602 | ```none 603 | \ 604 | \ 605 | ``` 606 |
607 |
608 | 609 | ```bob 610 | \ 611 | \ 612 | ``` 613 |
614 |
615 | 616 | #### Double quotes 617 | 618 | Double quotes is used as an escape to prevent svgbob from interpreting the characters as drawing character and use them as text instead. 619 | 620 |
621 |
622 | 623 | ```none 624 | ".----------------." 625 | "| Don't draw me |" 626 | "`----------------'" 627 | 628 | .--------------. 629 | | Ok, draw me | 630 | `--------------' 631 | ``` 632 |
633 |
634 | 635 | ```bob 636 | ".----------------." 637 | "| Don't draw me |" 638 | "`----------------'" 639 | 640 | .--------------. 641 | | Ok, draw me | 642 | `--------------' 643 | ``` 644 | 645 |
646 |
647 | 648 | ## Combination of characters 649 | 650 | #### Period and slash 651 | 652 |
653 |
654 | 655 | ```none 656 | .-- --. \ / 657 | \ / `-- --' 658 | ``` 659 |
660 |
661 | 662 | ```bob 663 | .-- --. \ / 664 | \ / `-- --' 665 | ``` 666 |
667 |
668 | 669 | #### Plus and slash 670 | 671 |
672 |
673 | 674 | ```none 675 | +-- --+ \ / 676 | \ / +-- --+ 677 | ``` 678 |
679 |
680 | 681 | ```bob 682 | +-- --+ \ / 683 | \ / +-- --+ 684 | ``` 685 |
686 |
687 | 688 | #### Underscore and vertical lines 689 | 690 | 691 |
692 |
693 | 694 | ```none 695 | | __ 696 | |__ | 697 | | 698 | 699 | ``` 700 |
701 |
702 | 703 | ```bob 704 | | __ 705 | |__ | 706 | | 707 | 708 | ``` 709 |
710 |
711 | 712 | #### Parenthesis, period and quote 713 | 714 | 715 |
716 |
717 | 718 | ```none 719 | . . 720 | ( ) 721 | ` ' 722 | ``` 723 |
724 |
725 | 726 | ```bob 727 | . . 728 | ( ) 729 | ` ' 730 | ``` 731 |
732 |
733 | 734 | [Circle specification](Circles.md) 735 | 736 | [Back to Svgbob](../Svgbob.md) 737 | -------------------------------------------------------------------------------- /md/markdeep.md: -------------------------------------------------------------------------------- 1 | **Markdeep Feature Demo** 2 | Morgan McGuire 3 | 4 | This demonstration documents the features of 5 | [Markdeep](http://casual-effects.com/markdeep) and acts as a test for 6 | it. Markdeep is a text formatting syntax that extends Markdown, and a 7 | Javascript program for making it work in browsers. The two most 8 | powerful features are its ability to run in any **web browser** on the 9 | client side and the inclusion of **diagrams**. 10 | 11 | [Click here](https://casual-effects.com/markdeep/features.md.html?noformat) 12 | to see this document without automatic formatting. 13 | 14 | Markdeep is free and easy to use. It doesn't need a plugin, or 15 | Internet connection. There's nothing to install. Just start 16 | writing in Vi, Nodepad, Zed, Emacs, Visual Studio, Atom, or another 17 | editor! You don't have to export, compile, or otherwise process 18 | your document. 19 | 20 | If you want to support development of Markdeep, just buy my 21 | [Graphics Codex](http://graphicscodex.com) book for $10 on Amazon. Revenue from that funds my 22 | open source projects. 23 | 24 | Basic Formatting 25 | ======================================================================================= 26 | Text formatting: 27 | 28 | Source | Result 29 | -----------------------------------------|------------------------------ 30 | `**bold**` | **bold** 31 | `__bold__` | __bold__ 32 | `*italic*` | *italic* 33 | `_italic_` | _italic_ 34 | `~~strikethrough~~` | ~~strikethrough~~ 35 | `inline code` | `inline code` 36 | `5 kg/m^3` | 5 kg/m^3 37 | 38 | You can add CSS to change the styles. See the Custom Formatting section 39 | for some examples. 40 | 41 | Formatted text may **cross 42 | lines** and be as small as **a** single character. It can _also 43 | be indented and 44 | split across lines_ simultaneously. 45 | 46 | Markdeep intelligently does not apply bold or italic formatting to 47 | math expressions such as x = 3 * y - 2 * z or WORDS_WITH_INTERNAL_UNDERSCORES. 48 | It also protects HTML `` in code blocks from disappearing. 49 | 50 | If you _want_ italics or bold inside of a word, for example in: SCUBA = Self Contained 51 | Underwater Breathing Apparatus, then just use HTML `` and `` 52 | tags---a markdown syntax won't be any more readable in that case. 53 | 54 | Exponents only work for positive and negative integers. For arbitrary exponents, 55 | use LaTeX notation: `$x^y$` ==> $x^y$, or HTML tags: `xy` ==> xy. 56 | 57 | Links 58 | --------------------------------------------------------------------------------------- 59 | There are many forms of implicit and explicit links: 60 | 61 | 62 | Source | Result 63 | -------------------------------------------|--------------------------------------------- 64 | `[hyperlink](http://casual-effects.com)` | [hyperlink](http://casual-effects.com) 65 | `[hyperlink]("http://casual-effects.com")` | [hyperlink]("http://casual-effects.com") 66 | `` | 67 | `http://casual-effects.com` | http://casual-effects.com 68 | `morgan@casual-effects.com` | morgan@casual-effects.com 69 | `test@foo.co.uk` | test@foo.co.uk 70 | `` | 71 | `Lists section` | Lists section 72 | `Tiny Grids subsection` | Tiny Grids subsection 73 | `Section [Lists]` | Section [Lists] 74 | `sec. [lists]` | sec. [lists] 75 | `subsection [lists]` | subsection [lists] 76 | `table [states]` | table [states] 77 | `tbl. [states]` | tbl. [states] 78 | `Table [states]` | Table [states] 79 | `figure [robot]` | figure [robot] 80 | `fig. [robot]` | fig. [robot] 81 | `Figure [robot]` | Figure [robot] 82 | `lst. [sort]` | lst. [sort] 83 | `listing [sort]` | listing [sort] 84 | `Listing [sort]` | Listing [sort] 85 | `[New York Times][nyt]` | [New York Times][nyt] 86 | `[Google][]` | [Google][] 87 | `footnote [^syntax]` | footnote [^syntax] 88 | `[#Kajiya86]` | [#Kajiya86] 89 | 90 | Any section header name followed by "section", "subsection", or "sec." will automatically be 91 | linked to that section. To link by number, use one of those key words followed by the section 92 | name in brackets. This won't work if you use the actual word "section" _as the title of a 93 | section_...but it would be unexpected to have a section named "section" in a real document 94 | anyway. 95 | 96 | You can also insert HTML anchor (``) tags to create arbitrary internal links. 97 | 98 | Reference-style links include arbitrary formatted text in brackets 99 | followed by a case-insensitive symbolic name that must be defined 100 | elsewhere in the document: 101 | 102 | - Example using a symbolic name: [New York Times][nyt] 103 | - Example using the text as its own symbol: [Google][] 104 | 105 | Put the definitions at a convenient location elsewhere in the document: 106 | 107 | ~~~~~~~~~~~~none 108 | [nyt]: http://nytimes.com 109 | [google]: http://google.com 110 | ~~~~~~~~~~~~ 111 | 112 | Markdeep also supports footnotes, endnotes [^syntax], and citations 113 | [#Kajiya86] using a similar syntax. The actual notes and bibliography 114 | may be placed at the bottom of the document: 115 | 116 | ~~~~~~~~~~~~~~~~none 117 | [#Kajiya86]: James T. Kajiya. 1986 ... 118 | 119 | [^syntax]: Endnotes look like ... 120 | ~~~~~~~~~~~~~~~~ 121 | 122 | Regular links may also have attributes, for example, 123 | [this link will directly download](http://casual-effects.com/markdeep/robot.jpg download). 124 | 125 | URLs in explicit links may be surrounded by optional `"` quotation `"` marks. If your URL 126 | contains parentheses, then it _must_ be surrounded in quotation marks to make it unambigious: 127 | 128 | - [a link with parens]("http://casual-effects.com(bar)") 129 | - []("http://casual-effects.com(bar)") 130 | 131 | URLs with various forms of special characters are handled well even without quotation marks: 132 | 133 | - [hyperlinks to URLs with underscores](https://archive.org/stream/Bazin_Andre_What_Is_Cinema_Volume_1/Bazin_Andre_What_Is_Cinema_Volume_1_djvu.txt) 134 | - https://archive.org/stream/Bazin_Andre_What_Is_Cinema_Volume_1/Bazin_Andre_What_Is_Cinema_Volume_1_djvu.txt 135 | 136 | You can also use the CommonMark angle bracket syntax 137 | `` ==> 138 | provided that your URL only 139 | contains lower-case letters. Otherwise the browser interprets it 140 | as a tag and converts it to lowercase before Markdeep runs. 141 | 142 | **Bibliography**: 143 | [#Kajiya86]: James T. Kajiya. 1986. The Rendering Equation. 144 | In _Proceedings of Computer Graphics and Interactive Techniques 145 | (SIGGRAPH '86)_, ACM, 143-150. http://dx.doi.org/10.1145/15922.15902 146 | 147 | 148 | [^syntax]: Endnotes look like reference-style links with an empty text 149 | field. Endnotes may not contain multiple paragraphs (sorry, David 150 | Foster Wallace), although they may refer to _other_ endnotes. 151 | 152 | 153 | [nyt]: http://nytimes.com 154 | [google]: http://google.com 155 | 156 | 157 | Lists 158 | --------------------------------------------------------------------------------------- 159 | 160 | A blank line or line ending in a colon must precede lists. Lists have lines that begin with a 161 | number (which is not required to increment) and a period, or a bullet character (-, *, +). They 162 | can also be nested. Example: 163 | 164 | ~~~~~~~~~~~~~~~~~~~~~~~ 165 | 1. Monday 166 | 2. Tuesday 167 | 1. Morning 168 | 2. Afternoon 169 | 3. Wednesday 170 | - Bullets 171 | - Bullets 172 | 1. Thursday 173 | + Bullets 174 | + Bullets 175 | 1. Friday 176 | * Bullets 177 | ~~~~~~~~~~~~~~~~~~~~~~~ 178 | 179 | Examples of lists and floating diagrams: 180 | ***************************** 181 | 1. Monday * A B C * 182 | 2. Tuesday * *-------->o<------->o * 183 | 1. Morning * ^ / ^ | * 184 | 2. Afternoon * | v \ v * 185 | 3. Wednesday * o----->o---->o<---->* * 186 | - Bullets * D E F G * 187 | - Bullets ***************************** 188 | 4. Thursday 189 | 5. Friday 190 | 191 | 192 | A list with just bullets: 193 | - Bread 194 | - Fish 195 | - Milk 196 | - Cheese 197 | 198 | 199 | A list containing a code block: 200 | 201 | 1. This is the first list item. 202 | 203 | ~~~~~~ 204 | // This is a code block 205 | if (x > 0) printf("hello!\n"); 206 | ~~~~~~ 207 | 208 | 1. This is the second list item. 209 | 210 | 211 | - Level 1 212 | - Level 2 213 | - Level 3 214 | - Level 1 again 215 | 216 | 217 | - 1 218 | - 1.a 219 | - 1.a.i 220 | - 1.a.ii 221 | - 1.b 222 | 223 | Lists can also: 224 | 225 | * Use asterisks 226 | * Instead of 227 | * Minus signs 228 | * `or have code` 229 | * *and* other formatting 230 | 231 | or 232 | 233 | + Use plus 234 | + Signs 235 | 236 | 237 | Lists with blank lines between the elements are formatted with more spacing. There's actually 238 | nothing special about this...that's just the regular paragraph separator. 239 | 240 | 241 | 1. Here's a list with some large elements that I chose to format by putting a blank line 242 | between the elements to make them more visually distinguished. 243 | 244 | 2. That's necessary with paragraph-sized elements; otherwise the 245 | text would appear to run together into a wall of text! 246 | 247 | - You can also 248 | - Nest lists within lists with spaces 249 | 250 | 251 | Lists that begin with a number other than 1 use that number as the start index. The subsequent 252 | numbers are irrelevant and automatically replaced with ascending numbers: 253 | 254 | 6. A list that starts at six! 255 | 1. and just 256 | 1. keeps going... 257 | 258 | 259 | Task Lists 260 | ------------------------------------------------------------------------------ 261 | 262 | You can use the strikethrough syntax for task lists: 263 | 264 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 265 | 1. ~~completed~~ 266 | 1. ~~subtask~~ 267 | 1. uncompleted 268 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 269 | 270 | which will format as: 271 | 272 | 1. ~~completed~~ 273 | 1. ~~subtask~~ 274 | 1. uncompleted 275 | 276 | or, use github or streamlined checkbox syntax for task lists : 277 | 278 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 279 | github: 280 | - [x] completed 281 | - [x] subtask 282 | - [ ] uncompleted 283 | 284 | streamlined: 285 | [x] completed 286 | [x] subtask 287 | [ ] uncompleted 288 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 289 | 290 | github: 291 | - [x] completed 292 | - [x] subtask 293 | - [ ] uncompleted 294 | 295 | streamlined: 296 | [x] completed 297 | [x] subtask 298 | [ ] uncompleted 299 | 300 | 301 | 302 | Definition Lists 303 | ------------------------------------------------------------------------------ 304 | 305 | Apple 306 | : Pomaceous fruit of plants of the genus Malus in 307 | the family Rosaceae. 308 | 309 | Multiple paragraphs are supported. 310 | 311 | Orange 312 | : The fruit of an evergreen tree of the genus Citrus. 313 | 314 | - Can also 315 | - Put lists 316 | - In definitions 317 | 318 | Definition lists with short definitions are formatted more tersely: 319 | 320 | Grapes 321 | : Available in purple ("red") and green ("white") varieties. 322 | 323 | Bananas 324 | : Only yellow. 325 | 326 | Schedule Lists 327 | ------------------------------------------------------------------------------ 328 | 329 | Schedule lists contain titles that begin with a valid date. After the 330 | title, arbitrary indented content appears, including lists, text, and 331 | equations: 332 | 333 | ~~~~~~~~~~~~none 334 | Tuesday Feb 16, 2016: Project Launch 335 | - Create specifications 336 | - Initialize revision control system 337 | 338 | Friday Feb 19, 2016: Build Milestone 339 | - Build system fully functional 340 | - Placeholder unit tests committed 341 | ⋮ 342 | 343 | (Monday Feb 29, 2016): Office Closed 344 | ~~~~~~~~~~~~ 345 | 346 | If the schedule is sufficiently long and dense, then a calendar preview 347 | is shown before it. Entries in parenthesis with no further details 348 | are formatted with a more subtle style. 349 | 350 | Formatted schedule lists 351 | look like: 352 | 353 | Tuesday Feb 16, 2016: Project Launch 354 | - Create specifications 355 | - Initialize revision control system 356 | 357 | Friday Feb 19, 2016: Build Milestone 358 | - Build system fully functional 359 | - Placeholder unit tests committed 360 | 361 | _Plan for weekend overtime if we miss this milestone_ 362 | 363 | Wednesday Feb 24, 2016: Site Visit 364 | **Whole team vistits client**. Dress appropriately. 365 | 366 | Friday Feb 26, 2016: Demo Milestone 367 | - Internal demonstrations for management 368 | - QA reports due 369 | 370 | (Monday Feb 29, 2016): Office Closed 371 | 372 | Tuesday Mar 1, 2016: Code Freeze 373 | - Commit final features before this date 374 | - Only priority 1 fixes with issue tracking numbers 375 | after this point 376 | 377 | Monday Mar 7, 2016: Beta 378 | 379 | Wednesday Mar 16, 2016: Gold 380 | 381 | Dates can be in any unambigous format that includes a month, day, and 382 | four-digit year between 1000 and 2999, such as: 383 | 384 | - 2001-03-01 385 | - 1 Apr. 1999 386 | - 4-07-1976 387 | - February 16, 2016 388 | - 2020 Jan. 15 389 | - May 15th, 1982 390 | 391 | The US date format MM/DD/YYYY is not supported because it is 392 | ambiguous. The date may include the name of a day of the week 393 | (e.g., Sunday). It will be replaced with the correct day. 394 | 395 | When months are given by name, they must match the localization 396 | settings. 397 | 398 | 399 | Block Quotes 400 | ------------------------------------------------------------------------------ 401 | 402 | Email-style indenting creates a blockquote: 403 | 404 | > This is an indented blockquote: Ut at felis diam. Aliquam massa odio, pharetra ut neque sed, commodo 405 | > dignissim orci. Curabitur quis velit gravida, blandit diam nec, 406 | > lacinia quam. Maecenas pharetra, velit in vestibulum auctor, diam 407 | > ipsum suscipit arcu, non sodales orci nibh sit amet leo. Nulla dictum 408 | 409 | Blockquotes formatted in the style of an actual quotation receive 410 | special treatment for fancy quoting: 411 | 412 | > "You want to make it seem alive and effortless and fun, but that's an 413 | > art that took me 25 years to really learn. I wanted to do it very much 414 | > 25 years ago, but I didn't know how." 415 | > 416 | > -- David O. Russell, director of American Hustle 417 | 418 | 419 | 420 | Tables 421 | ------------------------------------------------------------------------------ 422 | 423 | Source: 424 | ~~~~~~~~~~~~none 425 | Maine | Iowa | Colorado 426 | -------|------|---------- 427 | 1 | 4 | 10 428 | ME | IA | CO 429 | Blue | Red | Brown 430 | [Optional caption] 431 | 432 | Maine | Iowa | Colorado 433 | -------|------|---------- 434 | 1 | 4 | 10 435 | ME | IA | CO 436 | Blue | Red | Brown 437 | [Table [states]: Caption with label.] 438 | 439 | Item | Type | Cost 440 | ---- |:----:| ----: 441 | Fish | F | 1.00 442 | Axe | W | 3.25 443 | Gold | I |20.50 444 | 445 | 446 | | A | 447 | |---| 448 | | B | 449 | | C | 450 | | D | 451 | 452 | ~~~~~~~~~~~~ 453 | 454 | Result: 455 | 456 | Maine | Iowa | Colorado 457 | -------|------|---------- 458 | 1 | 4 | 10 459 | ME | IA | CO 460 | Blue | Red | Brown 461 | [Optional caption] 462 | 463 | 464 | Maine | Iowa | Colorado 465 | -------|------|---------- 466 | 1 | 4 | 10 467 | ME | IA | CO 468 | Blue | Red | Brown 469 | [Table [states]: Caption with label.] 470 | 471 | 472 | With alignment: 473 | 474 | Item | Type | Cost 475 | ---- |:----:| ----: 476 | Fish | F | 1.00 477 | Axe | W | 3.25 478 | Gold | I |20.50 479 | 480 | 481 | Single-column: 482 | 483 | | A | 484 | |---| 485 | | B | 486 | | C | 487 | | D | 488 | 489 | 490 | Page Breaks 491 | ------------------------------------------------------------------------------ 492 | 493 | To support other markdown conventions, `\pagebreak` and `\newpage` will insert a page break in 494 | a document when printed or converted to PDF. You can also use a pattern of a series of five `+` 495 | signs on their own line, which will form a horizontal rule on screen and a new page when 496 | printed. 497 | 498 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 499 | 500 | To make top-level section headers also force page breaks, add the following to your 501 | document or CSS file: 502 | 503 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 504 | <style>.md h1, .md .nonumberh1 {page-break-before:always}</style> 505 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 506 | 507 | Images 508 | ------------------------------------------------------------------------------ 509 | 510 | There's no natural way to embed an image into a document that is also readable as plain 511 | text. Markdeep follows markdown's somewhat reasonable syntax. The source 512 | 513 | ` ![A picture of a robot](robot.jpg)` 514 | 515 | becomes: 516 | 517 | ![A picture of a robot](robot.jpg) 518 | 519 | Optional labels may be applied: 520 | 521 | ` ![Figure [robot]: A picture of a robot](robot.jpg)` 522 | 523 | ![Figure [robot]: A picture of a robot](robot.jpg) 524 | 525 | Any text after the URL is used as HTML attributes. If the attributes 526 | include width or height specifications, then the image is linked to 527 | the original. 528 | 529 | ```` 530 | ![Figure [robot2]: A picture of a robot with a caption larger 531 | than it.](robot.jpg width="150px" border="1") 532 | ```` 533 | 534 | ![Figure [robot2]: A picture of a robot with a caption larger 535 | than it.](robot.jpg width="150px" border="1") 536 | 537 | 538 | ![Floating robot with a large caption.](robot.jpg width="20%") If the image is embedded in a 539 | paragraph and has a caption, then it floats right and any width 540 | specification is propagated to the full captioned image, for example, 541 | the image to the right of this paragraph. Use a space as your caption 542 | if you want this behavior but don't actually want a visible caption. 543 | 544 | You can also just use a raw HTML `` tag: 545 | 546 | ` ` 547 | 548 | 549 | 550 | Captionless images work as well. Source `![](robot.jpg)` becomes: 551 | 552 | ![](robot.jpg) 553 | 554 | Images are centered if they appear in their own paragraph block and inlined otherwise. Grids of 555 | images are recognized and laid out as grids using HTML tables: 556 | 557 | 558 | ![1](robot.jpg width=100) ![2](robot.jpg width=100) ![3](robot.jpg width=100) 559 | ![4](robot.jpg width=100) ![5](robot.jpg width=100) ![This image has a
long caption](robot.jpg width=100) 560 | 561 | 562 | Reference Images 563 | ---------------------------------------------------------------- 564 | 565 | Markdeep introduces a new feature called "reference images". These have several nice properties: 566 | 567 | * Put long image URLs elsewhere in the document for clarity 568 | * Indirection so that multiple images can reference a symbolic URL 569 | * Embed [base64 encoded images as data URIs](https://www.base64-image.de/) directly in a Markdeep text file 570 | 571 | 572 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 573 | ![This is a bas64 embedded reference image][hasselhoff.png] 574 | 575 | 576 | [hasselhoff.png]: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA... 577 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 578 | 579 | ![This is a base64 embedded reference image][hasselhoff.png] 580 | 581 | The syntax is the same as CommonMark reference _links_, just with square brackets. 582 | You can use all of the Markdeep image features with reference images, including 583 | image grids, floating images, and images with attributes. 584 | 585 | 586 | 587 | 588 | Videos 589 | ---------------------------------------------------------------- 590 | 591 | Video file extensions are automatically detected and will embed a small video 592 | player: 593 | 594 | ![A video](rocket.mp4) 595 | 596 | 597 | URLs for Youtube and Vimeo videos will also automatically embed a video player: 598 | 599 | ![State Zero](https://www.youtube.com/watch?v=QgPMyvZMBY0) 600 | 601 | ![Figure [fig:boy]: The Boy with a Camera For a Face](https://vimeo.com/channels/staffpicks/151493973) 602 | 603 | URLs for images may be surrounded in optional `"` quotation `"` marks. If your URL contains 604 | parentheses, then it _must_ be surrounded in quotation marks to make it unambigious. 605 | 606 | Recall that URLs are not permitted to contain spaces (by their specification), so to embed 607 | a local image whose filename has a space, either rename the file or replace the spaces 608 | with `%20` in the URL version of the name. 609 | 610 | 611 | Audio 612 | ------------------------------------------------------------------------------ 613 | 614 | MP3, WAV, OGG, etc. audio for music and podcasts are supported using the same 615 | syntax as for images and video: 616 | 617 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 618 | ![The Personal Best CBC Podcast](https://podcast-a.akamaihd.net/mp3/podcasts/personalbest-GRHHTnR3-20180415.mp3) 619 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 620 | 621 | Creates: 622 | ![The Personal Best CBC Podcast](https://podcast-a.akamaihd.net/mp3/podcasts/personalbest-GRHHTnR3-20180415.mp3) 623 | 624 | 625 | 626 | Symbol Substitutions 627 | ------------------------------------------------------------------------------ 628 | 629 | Markdeep converts `<->`, `<==>`, `->`, `-->`, `<-`, `<--`, `==>`, and `<==` to arrows if they 630 | aren't in a code block or latex expression and are surrounded by whitespace. Examples: 631 | 632 | - if this ==> then that 633 | - here <== there 634 | - this <==> that 635 | - A <- B 636 | - X -> Y 637 | - back <-> forth 638 | - long --> way 639 | - back <-- there 640 | 641 | Two or three minus signs are converted to an em dash--like that. 642 | 643 | An "x" between numbers, such as 1920x1080 or 3 x 4, will be converted to the times 644 | symbol. 645 | 646 | Negative numbers, such as -5 and minus signs between numbers such as 647 | 2 - 1, will have a minus sign instead of a hyphen. 648 | 649 | Degrees are reformatted to the degree symbol: 650 | 651 | - Cold, 37-degree F water. 652 | - A 45-degree angle. 653 | - A right angle's measure is 90 degrees. 654 | 655 | It doesn't reformat the word "degree" when not following digits: 656 | 657 | - Don't give me the third degree! 658 | - I have two degrees from MIT. 659 | 660 | "Smart quotes" are applied for double-quote marks based on position 661 | relative to whitespace: 662 | 663 | "a" b c 664 | 665 | a "b" c 666 | 667 | a b "c" 668 | 669 | a "b!" c 670 | 671 | a "b," c 672 | 673 | a "b". C 674 | 675 | a, "b" c 676 | 677 | a---"b"---c 678 | 679 | a ("b") c 680 | 681 | "error" ==> "correction" 682 | 683 | Inch or minute markers such as 3' 9" are not converted. Quotation 684 | marks in HTML attributes and 685 | in code blocks, e.g., `var x = "hello world"`, are not converted. 686 | 687 | 688 | Admonitions 689 | ----------------------------------------------------------------------------- 690 | 691 | Admonitions are small break-out boxes with notes, tips, warnings, etc. for the reader. They 692 | begin with a title line of a pattern of three exclaimation marks, an optional CSS class, and an 693 | optional title. All following lines that are indented at least three spaces are included in the 694 | body, which may include multiple paragraphs. 695 | 696 | The default stylesheet provides classes for "note" (default), "tip", "warning", and "error". 697 | These are case insensitive and ignore any colon after the CSS class. Here are some examples: 698 | 699 | ````````````````````````````````````````````````````````````` none 700 | !!! 701 | I'm a note. Don't mind me, I'm just sitting here. 702 | 703 | !!! note 704 | Another note. 705 | 706 | !!! Tip 707 | Close the door on the way out. 708 | 709 | !!! WARNING 710 | I'm a warning, perhaps. *Something might happen!* 711 | 712 | !!! ERROR: Seriously 713 | Watch out, something **bad** could happen. 714 | 715 | This is still more error text. 716 | ````````````````````````````````````````````````````````````` 717 | 718 | !!! 719 | I'm a note. Don't mind me, I'm just sitting here. 720 | 721 | !!! note 722 | Another note. 723 | 724 | !!! Tip 725 | Close the door on the way out. 726 | 727 | !!! WARNING 728 | I'm a warning, perhaps. *Something might happen!* 729 | 730 | !!! ERROR: Seriously 731 | Watch out, something **bad** could happen. 732 | 733 | This is still more error text. 734 | 735 | 736 | Fenced Code Blocks 737 | ------------------------------------------------------------------------------ 738 | 739 | Set off large blocks of code using equal-length strings of tilde `~` 740 | or back-tick ` characters. Each produces a different CSS 741 | class so that they can be styled differently. 742 | 743 | By default, tilde blocks have lines before and after them and are 744 | inset for use as code listings instead of large inline code 745 | blocks. Both styles receive syntax coloring and automatic programming 746 | language detection. 747 | 748 | You can override automatic programming language detection by putting 749 | the name of the language immediately following the first fence. You can 750 | specify a custom CSS class for a code block by placing its name after the 751 | language name. 752 | 753 |
 754 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C
 755 | void insertion_sort(int data[], int length) {
 756 |     for (int i = 0; i < length; ++i) {
 757 |        ...
 758 |     }
 759 | }
 760 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 761 | 
762 | 763 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C 764 | void insertion_sort(int data[], int length) { 765 | for (int i = 0; i < length; ++i) { 766 | ... 767 | } 768 | } 769 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 770 | 771 | 772 | Alternative back-tick markup: 773 | 774 | ```````````````````````````````````` 775 | def insertionSort(data): 776 | for i in range(0, len(data)): 777 | j = i; 778 | 779 | while (j > 0) and (data[j] < data[j - 1]): 780 | temp = data[j] 781 | data[j] = data[j - 1] 782 | data[j] = temp 783 | --j 784 | ```````````````````````````````````` 785 | 786 | ### HTML and LaTeX Blocks 787 | 788 | You can even have HTML in a code block: 789 | 790 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 791 | Show this HTML as source, 792 | not code. 793 | 794 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 795 | 796 | `` 797 | 798 | ````````` 799 | 800 | ````````` 801 | 802 | LaTeX and other languages that use dollar signs work fine inside code 803 | fences: 804 | 805 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 806 | $ \int_0^1 x^2 dx $ 807 | 808 | $$$a = $$$e 809 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 810 | 811 | ...and of course, Markdeep inside Markdeep: 812 | 813 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 814 | - Do not 815 | - Format 816 | - this as a **list**! 817 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 818 | 819 | ### Code Blocks with Captions 820 | 821 | Code listings may have captions: 822 | 823 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python 824 | def insertionSort(data): 825 | for i in range(0, len(data)): 826 | j = i; 827 | 828 | while (j > 0) and (data[j] < data[j - 1]): 829 | temp = data[j] 830 | data[j] = data[j - 1] 831 | data[j] = temp 832 | --j 833 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 834 | [Listing [sort]: An insertion sort] 835 | 836 | If you don't have a lot of exposition to share, then code blocks can be back to back: 837 | 838 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 839 | printf("Hello\n"); 840 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 841 | 842 | 843 | 844 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 845 | printf("World\n"); 846 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 847 | 848 | 849 | ### Line Numbers 850 | 851 | Adding the `linenumbers` CSS class to a listing makes line numbers appear: 852 | 853 | 854 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python linenumbers
 855 | def insertionSort(data):
 856 | ...
 857 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 858 | 
859 | 860 | 861 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python linenumbers 862 | def insertionSort(data): 863 | for i in range(0, len(data)): 864 | j = i; 865 | 866 | while (j > 0) and (data[j] < data[j - 1]): 867 | temp = data[j] 868 | data[j] = data[j - 1] 869 | data[j] = temp 870 | --j 871 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 872 | [Listing [sort2]: An insertion sort with line numbers] 873 | 874 | 875 | 876 | ### Multi-code Blocks and Custom CSS 877 | 878 | You can interlace different languages or CSS classes within a single code block, but each is required 879 | to specify the language in this case. This is convenient for highighting lines or showing the 880 | trace of an interactive session. 881 | 882 | An example of a fenced code block with a CSS class: 883 | 884 |
 885 | ~~~~~~~~~~~~~~ Python input
 886 | >>> x = [1, 2, 3, 4]
 887 | >>> [y * 2 for y in x]
 888 | ~~~~~~~~~~~~~~ none output
 889 | [2, 4, 6, 8]
 890 | ~~~~~~~~~~~~~~ Python input
 891 | >>> x + [5]
 892 | ~~~~~~~~~~~~~~ none output
 893 | [1, 2, 3, 4, 5]
 894 | ~~~~~~~~~~~~~
 895 | [This listing combines multiple code blocks to show the input and output of an interactive section.]
 896 | 
897 | 898 | And its result: 899 | 900 | ~~~~~~~~~~~~~~ Python input 901 | >>> x = [1, 2, 3, 4] 902 | >>> [y * 2 for y in x] 903 | ~~~~~~~~~~~~~~ none output 904 | [2, 4, 6, 8] 905 | ~~~~~~~~~~~~~~ Python input 906 | >>> x + [5] 907 | ~~~~~~~~~~~~~~ none output 908 | [1, 2, 3, 4, 5] 909 | ~~~~~~~~~~~~~~ 910 | [This listing combines multiple code blocks to show the input and output of an interactive section.] 911 | 912 | 913 | 917 | 918 | 919 | 920 | ### Less-than Signs in Code### 921 | #### Summary #### 922 | 923 | Less-than and greater-than signs (`<` and `>`) do not need to be escaped in diagrams or code 924 | as long as they do not appear immediately adjacent to a letter. Usually adding spaces or 925 | using inline code backquote escaping will suffice even in those cases. 926 | 927 | If you have trouble with less-than and greater-than signs right next to capitalized 928 | letters in code blocks, do _one_ of the following: 929 | 930 | - Put spaces after angle brackets: `std::vector< Capitalized >` 931 | - Use HTML entity escapes: `std::vector&ltCapitalized&gt` 932 | - Wrap code examples in `<script type="preformatted">...</script>` 933 | - Wrap your whole document in `<script type="preformatted">...</script>` 934 | 935 | 940 | 941 | You don't need to do this for legal HTML or XML in code blocks. 942 | 943 | #### Details #### 944 | Less-than and greater-than signs are allowed in code blocks 945 | (as well as anywhere else in Markdeep), and will be handled 946 | correctly if they are followed by a whitespace character. 947 | 948 | Likewise, legal HTML and XML are correctly processed as code 949 | when in code blocks. 950 | 951 | However, because browsers interpret "`<`" _immediately followed by_ 952 | a character as an HTML tag, less-than signs without a following space 953 | must be formatted more carefully in shell scripts and languages such 954 | as C++ and Java. 955 | 956 | If the character following the less-than sign is lower-case, for 957 | example in: "`std::vector<int>`", then no consideration is 958 | needed. If the character following less-than is a capital letter, then 959 | the browser will automatically make it lower case. If the following 960 | character is a slash, then the browser will interpret it as a stray 961 | tag and automatically remove it. 962 | 963 | If you care most about being able to read your document in a browser 964 | when the markdeep.js script is not available (due to no local copy and 965 | no Internet connection), then either use surrounding whitespace or 966 | use HTML entity codes to avoid incorrect processing of less-than signs. 967 | 968 | **Reformatted Examples:** 969 | 970 | ~~~~~~~~~~~~~~~~~~~~ 971 | #include <foo.h> 972 | ls < /dev/null 973 | ls&lt;/dev/null 974 | std::vector< Capitalized > array; 975 | std::vector&lt;Capitalized&gt; array; 976 | ~~~~~~~~~~~~~~~~~~~~ 977 | 978 | If care more about not having to reformat your code examples, then 979 | just include them in preformatted `<script>` blocks: 980 | 981 | **Script Block Examples:** 982 | 983 | 990 | 991 | You can also include your entire document in a preformatted script 992 | block to avoid the need for marking up each code (and inline code) 993 | example. 994 | 995 | 996 | 997 | Diagrams 998 | -------------------------------------------------------------------------------- 999 | 1000 | Diagrams can be inserted alongside, as in this **************************** 1001 | example, or between paragraphs of text as shown * .---------. * 1002 | below. * | Server |<------. * 1003 | * '----+----' | * 1004 | The diagram parser leaves symbols used as labels * | | * 1005 | unmodified, so characters like > and ( can appear * | DATA CYCLE | * 1006 | inside of the diagram. In fact, any plain text * v | * 1007 | may appear in the diagram. In addition to labels, * .-------. .----+----. * 1008 | any un-beautified text will remain in place for * | Security| | File | * 1009 | use as ASCII art. Thus, the diagram is rarely * | Policy +->| Manager | * 1010 | distored by the beautification process. * '-------' '---------' * 1011 | **************************** 1012 | 1013 | ************************************************************************************************* 1014 | *.-------------------. ^ .---. * 1015 | *| A Box |__.--.__ __.--> | | | * 1016 | *| | '--' v | | * 1017 | *'-------------------' | | * 1018 | * Round *---(-. | * 1019 | * .-----------------. .-------. .----------. .-------. | | | * 1020 | * | Mixed Rounded | | | / Diagonals \ | | | | | | * 1021 | * | & Square Corners | '--. .--' / \ |---+---| '-)-' .--------. * 1022 | * '--+------------+-' .--. | '-------+--------' | | | | / Search / * 1023 | * | | | | '---. | '-------' | '-+------' * 1024 | * |<---------->| | | | v Interior | ^ * 1025 | * ' <---' '----' .-----------. ---. .--- v | * 1026 | * .------------------. Diag line | .-------. +---. \ / . | * 1027 | * | if (a > b) +---. .--->| | | | | Curved line \ / / \ | * 1028 | * | obj->fcn() | \ / | '-------' |<--' + / \ | * 1029 | * '------------------' '--' '--+--------' .--. .--. | .-. +Done?+-' * 1030 | * .---+-----. | ^ |\ | | /| .--+ | | \ / * 1031 | * | | | Join | | Curved | \| |/ | | \ | \ / * 1032 | * | | +----> | '-' Vertical '--' '--' '-- '--' + .---. * 1033 | * '---+-----' | | | 3 | * 1034 | * v not:line 'quotes' .-' '---' * 1035 | * .---+--------. / A || B *bold* | ^ * 1036 | * | Not a dot | <---+---<-- A dash--is not a line v | * 1037 | * '---------+--' / Nor/is this. --- * 1038 | ************************************************************************************************* 1039 | [Figure [diagram]: Diagrams can also have captions] 1040 | 1041 | 1042 | Code with line-like symbols is allowed in diagrams and is parsed correctly so 1043 | long as you make it unambiguous: 1044 | 1045 | ********************************************** 1046 | * .-------------------------+--+--------. 1047 | * | --x; x->y |__| | 1048 | * | 0 __proto__ __FILE__ <= | 1049 | * | __ a | b --> foo | 1050 | * | |__| y--; x || y a + b <--o--+ 1051 | * |__|__|_______________________________| 1052 | ********************************************** 1053 | 1054 | 1055 | Here's a diagram on the left of some text: 1056 | 1057 | ************** _Song of Myself: 35_ 1058 | * | | * 1059 | * --+<---+-- * Would you hear of an old-time sea-fight?
1060 | * | ^ * Would you learn who won by the light of the moon and stars?
1061 | * v | * List to the yarn, as my grandmother's father the sailor told it to me. 1062 | * --+--->+-- * 1063 | * | | * Walt Whitman 1064 | ************** 1065 | 1066 | 1067 | If there is no leading text on the left except for whitespace, a diagram may omit the asterisks on the 1068 | right side for convenience: 1069 | 1070 | **************************************** 1071 | * .----. 1072 | * | | 1073 | * '----' .------------> 1074 | * | 1075 | * '------------- 1076 | **************************************** 1077 | 1078 | Below are some more examples of diagrams. 1079 | 1080 | Diagram Examples 1081 | ================================================================================ 1082 | 1083 | Lines with Decorations 1084 | -------------------------------------------------------------------------------- 1085 | ************************************************************************************************* 1086 | * ________ o * * .--------------. * 1087 | * *---+--. | | o o | ^ \ / | .----------. | * 1088 | * | | '--* -+- | | v / \ / | | <------. | | * 1089 | * | '-----> .---(---' --->*<--- / .+->*<--o----' | | | | | * 1090 | * <--' ^ ^ | | | | | ^ \ | '--------' | | * 1091 | * \/ *-----' o |<----->| '-----' |__| v '------------' | * 1092 | * /\ *---------------' * 1093 | ************************************************************************************************* 1094 | 1095 | Graph with Large Nodes 1096 | -------------------------------------------------------------------------------- 1097 | 1098 | ************************************************************************************************* 1099 | * * 1100 | * .---. .-. .-. .-. .-. * 1101 | * | A +----->| 1 +<---->| 2 |<----+ 4 +------------------. | 8 | * 1102 | * '---' '-' '+' '-' | '-' * 1103 | * | ^ | ^ * 1104 | * v | v | * 1105 | * .-. .-+-. .-. .-+-. .-. .+. .---. * 1106 | * | 3 +---->| B |<----->| 5 +---->| C +---->| 6 +---->| 7 |<---->| D | * 1107 | * '-' '---' '-' '---' '-' '-' '---' * 1108 | ************************************************************************************************* 1109 | 1110 | 1111 | 1112 | Graph with Small Nodes 1113 | -------------------------------------------------------------------------------- 1114 | 1115 | ************************************************************************************************* 1116 | * A 1 2 4 8 * 1117 | * *----->o<---->o<----o-----------. o * 1118 | * ^ ^ | ^ * 1119 | * | | | | * 1120 | * v | v | * 1121 | * o<--->*<---->o---->*---->o---->o<---->* * 1122 | * 3 B 5 C 6 7 D * 1123 | ************************************************************************************************* 1124 | 1125 | 1126 | Flow Chart 1127 | -------------------------------------------------------------------------------- 1128 | 1129 | ************************************************************************************************* 1130 | * . * 1131 | * .---------. / \ * 1132 | * | START | / \ .-+-------+-. ___________ * 1133 | * '----+----' .-------. A / \ B | |COMPLEX| | / \ .-. * 1134 | * | | END |<-----+CHOICE +----->| | | +--->+ PREPARATION +--->| X | * 1135 | * v '-------' \ / | |PROCESS| | \___________/ '-' * 1136 | * .---------. \ / '-+---+---+-' * 1137 | * / INPUT / \ / * 1138 | * '-----+---' ' * 1139 | * | ^ * 1140 | * v | * 1141 | * .-----------. .-----+-----. .-. * 1142 | * | PROCESS +---------------->| PROCESS |<------+ X | * 1143 | * '-----------' '-----------' '-' * 1144 | ************************************************************************************************* 1145 | 1146 | Line Ends 1147 | -------------------------------------------------------------------------------- 1148 | 1149 | 1150 | ************************************************************************************************* 1151 | * * 1152 | * o--o *--o / / * o o o o o * * * * o o o o * * * * o o o o * * * * * 1153 | * o--* *--* v v ^ ^ | | | | | | | | \ \ \ \ \ \ \ \ / / / / / / / / * 1154 | * o--> *--> * o / / o * v ' o * v ' o * v \ o * v \ o * v / o * v / * 1155 | * o--- *--- * 1156 | * ^ ^ ^ ^ . . . . ^ ^ ^ ^ \ \ \ \ ^ ^ ^ ^ / / / / * 1157 | * | | * o \ \ * o | | | | | | | | \ \ \ \ \ \ \ \ / / / / / / / / * 1158 | * v v ^ ^ v v ^ ^ o * v ' o * v ' o * v \ o * v \ o * v / o * v / * 1159 | * * o | | * o \ \ * 1160 | * * 1161 | * <--o <--* <--> <--- ---o ---* ---> ---- *<-- o<-- -->o -->* * 1162 | * * 1163 | ************************************************************************************************* 1164 | 1165 | Tests for some tough cases: 1166 | ************************************************ 1167 | * +-+ \ \ | / / * 1168 | * + + \ v v v / * 1169 | * +-+ \ .---------. / \ | / * 1170 | * v| |v vvv * 1171 | * +-+ --->| |<--- -->o<-- * 1172 | * | | ^| |^ ^^^ * 1173 | * +-+ / '---------' \ / | \ * 1174 | * / ^ ^ ^ \ * 1175 | * / / | \ \ * 1176 | ************************************************ 1177 | 1178 | Trees 1179 | -------------------------------------------------------------------------------- 1180 | 1181 | ************************************************************************************************* 1182 | * * 1183 | * . . . .--- 1 .-- 1 / 1 * 1184 | * / \ | | .---+ .-+ + * 1185 | * / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2 * 1186 | * + + | | | | ---+ ---+ + * 1187 | * / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3 * 1188 | * / \ / \ | | | | | | | | '---+ '-+ + * 1189 | * 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 * 1190 | * * 1191 | ************************************************************************************************* 1192 | 1193 | 1194 | Circuits 1195 | -------------------------------------------------------------------------------- 1196 | 1197 | ************************************************************************************************* 1198 | * ____ * * 1199 | * | |_____.---. | * 1200 | * o _____| )----------)-------. * 1201 | * / \ | '---' | __|__ * 1202 | * /___\ | | \ / * 1203 | * | '-------------. | \ / * 1204 | * A ----------------' | | o * 1205 | * .-------------------. o-----)-------' | * 1206 | * | |___.---. | |___.---. * 1207 | * B ---*---.__.---. ___| )--*--.__..---. ____) )----- Y * 1208 | * __| o----*--' '---' ______)) )---' '---' * 1209 | * C -------' '---' | | ''---' * 1210 | * | o * 1211 | * | / \ * 1212 | * | /___\ * 1213 | * | | * 1214 | * '--------------' * 1215 | ************************************************************************************************* 1216 | 1217 | 1218 | Gantt Chart 1219 | -------------------------------------------------------------------------------- 1220 | 1221 | ************************************************************************************************* 1222 | * ║ Preproduction┆ Alpha┆ RC1┆ 1223 | * ═══════════╬══════════════╪════════════╪════════════════╪══ 1224 | * Story ║ ▆▆▆▆▆▆▆▆ ┆ ▆┆▆▆▆ ┆ 1225 | * Concept Art║ └▆▆▆▆▆▆┆▆▆▆┐ ┆ ┆ 1226 | * Modeling ║ ┆ └▆▆▆▆▆▆▆▆┆▆▆▆▆▆▆▆ ┆ 1227 | * Rigging ║ ┆ └▆▆▆┆▆▆▆▆▆▆▆▆▆▆▆▆ ┆ 1228 | * Mechanics ║ ▆▆▆▆▆▆┆▆▆┐ ┆ ░░░░▆▆▆▆ ┆ 1229 | * Engine Code║ ▆▆▆▆▆▆▆┐ │ ┆ └────────▆┆▆▆▆▆▆▆▆▆▆▆▆▆▆ ┆ 1230 | * Game Code ║ └─┴▆┆▆▆▆▆▆▆▆▆▆▆▆▆┆▆▆▆▆ ░░░░ ▆ ┆ 1231 | * ║ ┆ ┆ Freeze ┆ 1232 | ************************************************************************************************* 1233 | 1234 | 1235 | Big Shapes 1236 | -------------------------------------------------------------------------------- 1237 | ************************************************************************************************* 1238 | * * 1239 | * .---------. . .-------. .-------. .---------. .-----. .----. * 1240 | * \ / / \ \ \ | | | | / \ / \ * 1241 | * \ / / \ \ \ | | | | / \ | | * 1242 | * \ / / \ \ \ | | | | \ / | | * 1243 | * \ / / \ \ \ | | | | \ / \ / * 1244 | * ' '---------' '-------' '-------' '---------' '-----' '----' * 1245 | * * 1246 | ************************************************************************************************* 1247 | 1248 | 1249 | Small Shapes 1250 | -------------------------------------------------------------------------------- 1251 | ************************************************************************************************* 1252 | * .---. __ .. * 1253 | * .--. . .-----. \ / .---. .---. ___ ___ | | | ) * 1254 | * / \ / \ \ / .-. . ' . | | .---. .---. | | / \ | | '--' '' * 1255 | * \ / / \ \ / | | / \ / \ '---' / / \ \ | | \___/ |___| .. __ * 1256 | * '--' '-----' ' '-' '---' /___\ '---' '---' '---' ( | |__| * 1257 | * '' * 1258 | ************************************************************************************************* 1259 | 1260 | 1261 | Overlaps and Intersections 1262 | -------------------------------------------------------------------------------- 1263 | 1264 | ************************************************************************************************* 1265 | * * 1266 | * .-. .-. .-. .-. .-. .-. * 1267 | * | | | | | | | | | | | | * 1268 | * .---------. .--+---+--. .--+---+--. .--| |--. .--+ +--. .------|--. * 1269 | * | | | | | | | | | | | | | | | | | | * 1270 | * '---------' '--+---+--' '--+---+--' '--| |--' '--+ +--' '--|------' * 1271 | * | | | | | | | | | | | | * 1272 | * '-' '-' '-' '-' '-' '-' * 1273 | ************************************************************************************************* 1274 | 1275 | 1276 | 1277 | Big Grids 1278 | -------------------------------------------------------------------------------- 1279 | 1280 | ************************************************************************************************* 1281 | * .----. .----. * 1282 | * / \ / \ .-----+-----+-----. * 1283 | * + +----+ +----. | | | | .-----+-----+-----+-----+ * 1284 | * \ / \ / \ | | | | / / / / / * 1285 | * +----+ B +----+ + +-----+-----+-----+ +-----+-----+-----+-----+ * 1286 | * / \ / \ / | | | | / / / / / * 1287 | * + A +----+ +----+ | | B | | +-----+-----+-----+-----+ * 1288 | * \ / \ / \ +-----+-----+-----+ / / A / B / / * 1289 | * '----+ +----+ + | | | | +-----+-----+-----+-----+ * 1290 | * \ / \ / | A | | | / / / / / * 1291 | * '----' '----' '-----+-----+-----' '-----+-----+-----+-----+ * 1292 | * * 1293 | ************************************************************************************************* 1294 | 1295 | 1296 | Small Grids 1297 | -------------------------------------------------------------------------------- 1298 | 1299 | ************************************************************************************************* 1300 | * ___ ___ .---+---+---+---+---. .---+---+---+---. .---. .---. * 1301 | * ___/ \___/ \ | | | | | | / \ / \ / \ / \ / | +---+ | * 1302 | * / \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ +---+ * 1303 | * \___/ b \___/ \ | | | b | | | \ / \a/ \b/ \ / \ | +---+ | * 1304 | * / a \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ b +---+ * 1305 | * \___/ \___/ \ | | a | | | | / \ / \ / \ / \ / | a +---+ | * 1306 | * \___/ \___/ '---+---+---+---+---' '---+---+---+---' '---' '---' * 1307 | * * 1308 | ************************************************************************************************* 1309 | 1310 | Tiny Grids 1311 | -------------------------------------------------------------------------------- 1312 | 1313 | ************************************************************************************************* 1314 | * ┌─┬─┬─┬─┬─┐ ▉▉ ▉▉ ▉▉ ⬢ ⬡ ⬡ ┌┬┬┬┬┬┬┬┬┐ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ ___________ +-+-+-+-+ * 1315 | * ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ⬢ ⬢ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ * 1316 | * ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ▉▉ ⬢ ⬢ ⬢ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ * 1317 | * ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ⬡ ⬡ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ * 1318 | * └─┴─┴─┴─┴─┘ ▉▉ ▉▉ ▉▉ ⬡ ⬡ ⬡ └┴┴┴┴┴┴┴┴┘ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ * 1319 | ************************************************************************************************* 1320 | 1321 | Dot Grids 1322 | -------------------------------------------------------------------------------- 1323 | 1324 | ************************************************************************************************* 1325 | * * 1326 | * o o o o o * * * * * * * o o * o o o * * * o o o · * · · · · · · * 1327 | * o o o o o * * * * * o o o o * o o o o * * * * * o * * · * * · · · · · · * 1328 | * o o o o o * * * * * o * o o o o o o o o * * * * * o o o o o · o · · o · · * * · * 1329 | * o o o o o * * * * * o * o o o o o o o * * * * o * o o · · · · o · · * · * 1330 | * o o o o o * * * * * * * * * o o o o * * * o * o · · · · · · · * * 1331 | * * 1332 | ************************************************************************************************* 1333 | 1334 | Unicode in Diagram 1335 | -------------------------------------------------------------------------------- 1336 | 1337 | ************************************************************************************************ 1338 | * ↖ ↗ ✶ ✹ ✩ ⓵ ⎲ ░░▒▒▓▓▉▉ ▚▚ ▢ ▢ ⬚ ⬚ ⊕ 1339 | * ▲ ◀━━━━━━━▶ ↙ ↘ ➊ ❶ ➀ ① ➕ ➖ ➗ ❌ ⎳ ╲ ╱ ░░▒▒▓▓▉▉ ▚▚ ▢ ▢ ⬚ ⬚ ⊜ 1340 | * ┃ ╭╌╌╌╌╌╌╌╮ ╔═══════╗ ┏━━━━━━━┓ ┏╍╍╍╍╍╍╍┓ ╲ ╱ ░░▒▒▓▓▉▉ ▚▚ ⬣ ⬣ ⎔ ⎔ ⊗ 1341 | * ┃ ╎ ╎ ║ ║ ┃ ┃ ╏ ╏ ⎛ ⎧ ⎡ ╳ ░░▒▒▓▓▉▉ ▚▚ ⬣ ⬣ ⎔ ⎔ ⊘ 1342 | * ┃ ╎ ╎ ║ ║ ┃ ┃ ╏ ╏⋮ ⎜ ⎨ ⎢ ╱ ╲ ░░▒▒▓▓▉▉ ▚▚ ◯ ◯ ⏣ ⏣ ⊙ 1343 | * ▼ ╰╌╌╌╌╌╌╌╯ ╚═══════╝ ┗━━━━━━━┛ ⋱ ┗╍╍╍╍╍╍╍┛⋮ ⎝ ⎩ ⎣╱ ╲ ░░▒▒▓▓▉▉ ▚▚ ◯ ◯ ⏣ ⏣ ⊛ 1344 | * ⋱ ⋮ ◢▉▉◣ 1345 | * ∑xᵢ 𝚺xᵢ ∫t²dt ⋱ ⋮ ◥▉▉◤ 1346 | ************************************************************************************************ 1347 | 1348 | 1349 | Simple Plot Diagram 1350 | ------------------------------------------------------------------------------- 1351 | ************************************************* 1352 | * ▲ 1353 | * Uin ┊ .------------------------ 1354 | * ┊ | 1355 | * ┊ | 1356 | * *---'┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄▶ 1357 | * 1358 | * Udc▲ 1359 | * Udc_OK ┊ .--------------------- 1360 | * ┊ / : 1361 | * ┊ / : 1362 | * *---'┄┄┄┄:┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄▶ 1363 | * :<----->: 1364 | * ▲ 500ms : 1365 | * ┊ : 1366 | *Cpu.Qon ┊┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄.----------- 1367 | * ┊ | Inactive 1368 | * ┊ Active | 1369 | * *----------------'┄┄┄┄┄┄┄┄┄┄┄▶ 1370 | * 1371 | ************************************************* 1372 | 1373 | 1374 | Graphics Diagram 1375 | ------------------------------------------------------------------------------- 1376 | ************************************************************************************************* 1377 | * . * 1378 | * 0 3 P * Eye / ^ / * 1379 | * *-------* +y \ +) \ / Reflection * 1380 | * 1 /| 2 /| ^ \ \ \ v * 1381 | * *-------* | | v0 \ v3 --------*-------- * 1382 | * | |4 | |7 | ◄╮ *----\-----* * 1383 | * | *-----|-* ⤹ +-----> +x / v X \ .-.<-------- o * 1384 | * |/ |/ / ⤴ / o \ | / | Refraction / \ * 1385 | * *-------* v / \ +-' / \ * 1386 | * 5 6 +z v1 *------------------* v2 | o-----o * 1387 | * v * 1388 | ************************************************************************************************* 1389 | 1390 | 1391 | Annotated Table Diagram 1392 | -------------------------------------------------------------------------------- 1393 | 1394 | ********************************************** 1395 | * ┏━━━━┳━━━━┳ ┳━━━━┓ 1396 | * ┃ A₁ ┃ A₂ ┃ ⋯ ┃ Aⱼ ┃ <--- Basis 1397 | * ┡━━━━╇━━━━╇ ╇━━━━┩ 1398 | * │ 16 │ 4 │ ⋯ │ 9 │ 1399 | * ⎧ ├────┼────┼ ┼────┤ 1400 | * │ │ 1 │ -2 │ ⋯ │ 10 │ 1401 | * Xᵢ ⎨ ├────┼────┼ ┼────┤ 1402 | * │ │ 8 │ 52 │ ⋯ │ 0 │ 1403 | * ⎩ ├────┼────┼ ┼────┤ 1404 | * │ 14 │ 0 │ ⋯ │ -1 │ 1405 | * └────┴────┴ ┴────┘ 1406 | ********************************************** 1407 | 1408 | 1409 | Icon Diagram 1410 | -------------------------------------------------------------------------------- 1411 | 1412 | ************************************************************************************************* 1413 | * .-. .--------. * 1414 | * .-+ | | | * 1415 | * .--+ '--. |'--------'| * 1416 | * | Server Cloud |<------------------>| Database | * 1417 | * '-------------' | | * 1418 | * ^ ^ '--------' * 1419 | * Internet | | ^ * 1420 | * .------------------------' '-------------. | * 1421 | * | | v * 1422 | * v v .------. .------. * 1423 | * .--------. WiFi .--------. Bluetooth .-----. / # # /| / # # /| * 1424 | * | |<------------->| |<---------->| | +------+/| LAN +------+/| * 1425 | * |Windows | | OS X | | iOS | | +/|<--->| +/| * 1426 | * +--------+ +--------+ | | |Ubuntu+/| |Ubuntu+/| * 1427 | * /// ____ \\\ /// ____ \\\ | o | | +/ | +/ * 1428 | * '------------' '------------' '-----' '------' '------' * 1429 | * Laptop 1 Laptop 2 Tablet 1 Dedicated Server Rack * 1430 | ************************************************************************************************* 1431 | 1432 | 1433 | Styling Diagrams 1434 | ------------------------------------------------------------------------------------ 1435 | 1436 | 1447 | 1448 | You can use CSS to style all diagrams or individual diagrams. For example, 1449 | the following has light lines on a dark background: 1450 | 1451 |
1452 | **************************************************** 1453 | * .---. . .----o----. * 1454 | * | | | | | | * 1455 | * | | --. |.-- | | *----*<---+ * 1456 | * | | .-.| | +--+ | |____| * 1457 | * | | | | | | | | | | * 1458 | * '---' '-'' ' ' ' o----o--->' * 1459 | **************************************************** 1460 |
1461 | 1462 | 1463 | Horizontal Rules 1464 | ======================================================================== 1465 | 1466 | Following the CommonMark specification, any of these patterns can be used (and extended across 1467 | a whole line, of course) to produce a horizontal rule: 1468 | 1469 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ none 1470 | ----- 1471 | 1472 | - - - 1473 | 1474 | _____ 1475 | 1476 | _ _ _ 1477 | 1478 | ***** 1479 | 1480 | * * * 1481 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1482 | 1483 | Example: 1484 | 1485 | ----- 1486 | 1487 | - - - 1488 | 1489 | _____ 1490 | 1491 | _ _ _ 1492 | 1493 | ***** 1494 | 1495 | * * * 1496 | 1497 | Embedded Math 1498 | ======================== 1499 | 1500 | Markdeep automatically includes [MathJax](http://mathjax.org) if your 1501 | document contains equations and you have an Internet connection. That means 1502 | you get the **full power of LaTeX, TeX, MathML, and AsciiMath notation**. 1503 | Just put math inside single or double dollar signs. 1504 | 1505 | $$ \Lo(X, \wo) = \Le(X, \wo) + \int_\Omega \Li(X, \wi) ~ f_X(\wi, \wo) ~ | \n \cdot \wi | ~ d\wi $$ 1506 | 1507 | You can also use LaTeX equation syntax directly to obtain numbered 1508 | equations: 1509 | 1510 | \begin{equation} 1511 | e^{i \pi} + 1 = 0 1512 | \end{equation} 1513 | 1514 | \begin{equation} 1515 | \mathbf{A}^{-1}\vec{b} = \vec{x} 1516 | \end{equation} 1517 | 1518 | If you don't have equations in your document, then Markdeep won't 1519 | connect to the MathJax server. Either way, it runs MathJax after 1520 | processing the rest of the document, so there is no delay. 1521 | 1522 | Markdeep is smart enough to distinguish non-math use of dollar signs, 1523 | such as $2.00 and $4.00, US$5, and 3$. Inline 1524 | math requires consistent spaces (or punctuation) either outside or inside 1525 | of the LaTeX dollar signs to distinguish them from 1526 | regular text usage. Thus, the following all work: 1527 | 1528 | - $x^2$ 1529 | - $ x^2 $ 1530 | - ($x^2$) 1531 | - ($ x^2 $) 1532 | - Variable $x^2$, 1533 | - Variable $ x^2 $ 1534 | - Two $x$ vars $y$ on the same line 1535 | - Different spacing styles: $\theta_{x}$ vs. $ \theta_{y} $ 1536 | 1537 | Unless you've changed out the default MathJax processor, you can define 1538 | your own LaTeX macros by executing `\newcommand` within dollar signs, 1539 | just as you would in LaTeX. Markdeep provides a handful of commands 1540 | defined this way by default because they're things that I frequently 1541 | need: 1542 | 1543 | Code | Symbol 1544 | -------------------|------------ 1545 | `\O(n)` | $\O(n)$ 1546 | `\mathbf{M}^\T` | $\mathbf{M}^\T$ 1547 | `45\degrees` | $45\degrees$ 1548 | `x \in \Real` | $x \in \Real$ 1549 | `x \in \Integer` | $x \in \Integer$ 1550 | `x \in \Boolean` | $x \in \Boolean$ 1551 | `x \in \Complex` | $x \in \Complex$ 1552 | `\n` | $\n$ 1553 | `\w` | $\w$ 1554 | `\wo` | $\wo$ 1555 | `\wi` | $\wi$ 1556 | `\wh` | $\wh$ 1557 | `\Li` | $\Li$ 1558 | `\Lo` | $\Lo$ 1559 | `\Lr` | $\Lr$ 1560 | `\Le` | $\Le$ 1561 | `10\un{m/s^2}` | $10\un{m/s^2}$ 1562 | 1563 | 1564 | # ATX Headers 1565 | In addition to the underlined headers, you can also use ATX-style 1566 | headers, with multiple # signs: 1567 | 1568 | ## H2 1569 | ### H3 1570 | #### H4 1571 | ##### H5 1572 | ###### H6 1573 | Although: do you really need six levels of subsection nesting?! 1574 | 1575 | You can also create unnumbered sections that will not appear in the 1576 | table of contents using parentheses around the pound signs: 1577 | 1578 | (##) Unnumbered H2 1579 | 1580 | 1581 | Multiple Columns 1582 | ======================================================================== 1583 |
1584 | You can use the CSS 1585 | [columns](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Columns/Using_multi-column_layouts) 1586 | style to make an HTML multicolumn block. Then, just use regular Markdeep within it and the 1587 | browser will automatically apply your multicolumn layout. 1588 | 1589 | Browsers are even smart enough to break the columns correctly when 1590 | printing to PDF or to a printer. However, for a long document, 1591 | multiple columns don't work well when displayed on screen. That's 1592 | because there are no discrete "pages" on screen to break columns. So, 1593 | the browser will make each column as long as the entire document, 1594 | which is probably not what you want. 1595 | 1596 | So, multi-column only works well if you know that you have very short 1597 | sections (as in this example), or if you were planning on printing to 1598 | separate pages when done. 1599 |
1600 | 1601 | 1602 | Custom Formatting 1603 | ========================================================================= 1604 | 1605 | Manual 1606 | ------------------------------------------------------------------------- 1607 | 1608 | Markdeep uses CSS for styling. That means you can embed a style sheet 1609 | to override anything thatn you don't like about the built-in styling. 1610 | For example, if you don't want section numbering, just use: 1611 | 1612 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1613 | 1614 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1615 | 1616 | Markdeep uses Markdown's syntax, even where I disagree with the 1617 | choices. But you aren't stuck with that. Do you wish that Markdown 1618 | had specified single-asterisk for `*bold*`? You can have 1619 | that: 1620 | 1621 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1622 | <style>em.asterisk { font-style: normal; font-weight: bold; }</style> 1623 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1624 | 1625 | Each of the list bullets (`+`, `-`, `*`) has its own CSS class. You 1626 | can use this, for example, to make `+` entries bold and `-` ones 1627 | use a circle: 1628 | 1629 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1630 | <style> 1631 | li.plus { font-weight: bold; } 1632 | li.minus { list-style-type: circle;} 1633 | </style> 1634 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1635 | 1636 | 1637 | Style Sheets 1638 | ------------------------------------------------------------------------ 1639 | 1640 | ### Latex Article 1641 | 1642 | To match the default Latex article formatting, insert the following anywhere in your document: 1643 | 1644 |
1645 | <link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/latex.css?">
1646 | 
1647 | 1648 | ### Dark 1649 | 1650 | For an aggressively-stylized document with a black background, insert the following anywhere in 1651 | your document: 1652 | 1653 |
1654 | <link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/dark.css?">
1655 | 
1656 | 1657 | ### API Documentation 1658 | 1659 | To use the API documentation template, insert the following anywhere in 1660 | your document: 1661 | 1662 |
1663 | <link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/apidoc.css?">
1664 | 
1665 | 1666 | ### Presentation Slides 1667 | 1668 | To create presentation slides as a PDF, insert the following into 1669 | your document, using first-level headers for sections and second-level 1670 | headers for slides: 1671 | 1672 |
1673 | <link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/slides.css?">
1674 | 
1675 | 1676 | Then, print the document to PDF. 1677 | 1678 | 1679 | Paragraph Numbering 1680 | -------------------------------------------------- 1681 | 1682 | Academic article or book proofs often have line numbers so that reviewers and editors can refer 1683 | to specific passages. This doesn't make sense for a document in a browser because line breaks 1684 | change based on the reader's screen size. 1685 | 1686 | You can add _paragraph_ numbers to your Markdeep document by including the following HTML at 1687 | the bottom of your document. You can remove the ` 1704 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1705 | 1706 | 1707 | 1708 | Localization 1709 | =================================================== 1710 | 1711 | There are two ways to localize the keywords such as Table, Diagram, 1712 | Monday, etc., from English to your favorite language. 1713 | 1714 | The first is to 1715 | put a meta tag with a 1716 | [`lang`](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) 1717 | attribute in the document, such as <`meta lang="ru" 1718 | charset="utf-8"`>. If your favorite language isn't supported by 1719 | Markdeep, just e-mail me a Javascript snippet with the appropriate 1720 | translations and I'll add it (see the source code for examples). 1721 | 1722 | The second method is to manually set the `markdeepOptions.lang` field 1723 | before you include the script in your document. 1724 | 1725 | 1726 | Unicode (in UTF-8 encoding) 1727 | =================================================== 1728 | 1729 | To support Unicode input, you must add <`meta charset="utf-8"`> to 1730 | the *top* of your document (in the first 512 bytes). 1731 | 1732 | - Asian characters 林花謝了春紅 太匆匆, 無奈朝來寒雨 晚來風 胭脂淚 留人醉 幾時重, 自是人生長恨 水長東 1733 | - Asian punctuation: 、。!,: 1734 | - Matching pairs «»‹›“”‘’〖〗【】「」『』〈〉《》〔〕 1735 | - Greek ΑΒΓΔ ΕΖΗΘ ΙΚΛΜ ΝΞΟΠ ΡΣΤΥ ΦΧΨΩ αβγδ εζηθ ικλμ νξοπ ρςτυ φχψω 1736 | - Currency ¤ $ ¢ € ₠ £ ¥ 1737 | - Common symbols © ® ™ ² ³ § ¶ † ‡ ※ 1738 | - Bullets •◦ ‣ ✓ ●■◆ ○□◇ ★☆ ♠♣♥♦ ♤♧♡♢ 1739 | - Phonetic ᴁ ᴂ ᴈ 1740 | - Music ♩♪♫♬♭♮♯ 1741 | - Punctuation “” ‘’ ¿¡ ¶§ª - ‐ ‑ ‒ – — ― … 1742 | - Accents àáâãäåæç èéêë ìíîï ðñòóôõö øùúûüýþÿ ÀÁÂÃÄÅ Ç ÈÉÊË ÌÍÎÏ ÐÑ ÒÓÔÕÖ ØÙÚÛÜÝÞß 1743 | - Math ° ⌈⌉ ⌊⌋ ∏ ∑ ∫ ×÷ ⊕ ⊖ ⊗ ⊘ ⊙ ⊚ ⊛ ∙ ∘ ′ ″ ‴ ∼ ∂ √ ≔ × ⁱ ⁰ ¹ ² ³ ₀ ₁ ₂ π ∞ ± ∎ 1744 | - Logic & Set Theory ∀¬∧∨∃⊦∵∴∅∈∉⊂⊃⊆⊇⊄⋂⋃ 1745 | - Relations ≠≤≥≮≯≫≪≈≡ 1746 | - Sets ℕℤℚℝℂ 1747 | - Arrows ←→↑↓ ↔ ↖↗↙↘ ⇐⇒⇑⇓ ⇔⇗ ⇦⇨⇧⇩ ↞↠↟↡ ↺↻ ☞☜☝☟ 1748 | - Computing ⌘ ⌥ ‸ ⇧ ⌤ ↑ ↓ → ← ⇞ ⇟ ↖ ↘ ⌫ ⌦ ⎋⏏ ↶↷ ◀▶▲▼ ◁▷△▽ ⇄ ⇤⇥ ↹ ↵↩⏎ ⌧ ⌨ ␣ ⌶ ⎗⎘⎙⎚ ⌚⌛ ✂✄ ✉✍ 1749 | - Digits ➀➁➂➃➄➅➆➇➈➉ 1750 | - Religious and cultural symbols ✝✚✡☥⎈☭☪☮☺☹☯☰☱☲☳☴☵☶☷ 1751 | - Dingbats ❦☠☢☣☤♲♳⌬♨♿ ☉☼☾☽ ♀♂ ♔♕♖ ♗♘♙ ♚♛ ♜♝♞♟ 1752 | 1753 | 1754 | Gravizo Support 1755 | =================================================== 1756 | 1757 | Markdeep diagrams have no dependency on third parties or the network 1758 | (you can store the `markdeep.min.js` file locally on your machine!) 1759 | and look the same in your document as on screen in the final document. 1760 | 1761 | If you need the full power of DOT/GraphViz automated layout graphs and 1762 | can accept a network and third party dependency, you can embed 1763 | [Gravizo](http://g.gravizo.com/) within a Markdeep document using either 1764 | direct Markdeep image syntax or an embedded HTML `img` tag: 1765 | 1766 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1767 | 1768 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1769 | 1770 | 1771 | 1772 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1773 | ![](http://g.gravizo.com/svg?digraph G { A -> B -> C; A -> C; }) 1774 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1775 | 1776 | ![](http://g.gravizo.com/svg?digraph G { A -> B -> C; A -> C; }) 1777 | 1778 | 1779 | Markdeep also allows captions on Gravizo graphs and newlines within 1780 | the URL itself: 1781 | 1782 | ![Figure [graph]: A more complex graph example](http://g.gravizo.com/svg? 1783 | digraph G { 1784 | main -> parse -> execute; 1785 | main -> init; 1786 | main -> cleanup; 1787 | execute -> make_string; 1788 | execute -> printf 1789 | init -> make_string; 1790 | main -> printf; 1791 | execute -> compare; 1792 | }) 1793 | 1794 | 1795 | Including/Inserting Other Documents 1796 | =================================================== 1797 | 1798 | Markdeep currently contains experimental (i.e., beta, may-not-be-supported-in-the-future) 1799 | support for including one document within another. This is convenient for bibliographies, 1800 | boilerplate footers and headers, and styling. The syntax is: 1801 | 1802 |
`(insert otherdocument.md.html here)`
1803 | 1804 | The inserted document must be a standalone Markdeep document, including the Markdeep line. It 1805 | can have any file extension, although `.html` is recommended and there **must** be a period 1806 | in the filename to disambiguate it versus arbitrary TODO-style notes. 1807 | 1808 | The included document will be inserted inline, meaning that footnotes, figure numbering, and 1809 | other kinds of references will flow correctly. Recursive inclusion is allowed. All paths in an 1810 | included document are relative to the original document. That's undesirable, and a future 1811 | release may be able to make those paths absolute. 1812 | 1813 | Here is an example of embedding `example.md.html` into `features.md.html`: 1814 | 1815 | (insert example.md.html here) 1816 | 1817 | 1818 | Differences from Other Markdown 1819 | =================================================== 1820 | 1821 | Features 1822 | --------------------------------------------------- 1823 | 1824 | There are many, inconsistent markdown variants. Markdeep intentionally differs from a few of 1825 | them in specific ways: 1826 | 1827 | - Code blocks require fences; no indent-only code blocks. I think that allowing indentation to 1828 | indicate code blocks was a poor choice in the original markdown specification because code 1829 | vs. blockquote is ambiguous in plain text and it makes list detection harder. 1830 | 1831 | - Two trailing whitespace characters do not force a hard newline. Use `
` or regular 1832 | paragraph breaks if you need a hard newline. The original markdown specification on this 1833 | point violates its golden rule that the input look as much as possible like the output, 1834 | and that rule also ends up requiring special code editors/syntax highlighting to see 1835 | invisible characters, which is bad design. 1836 | 1837 | - No bold/italic/strikethrough inside of words without spaces because they could form an 1838 | equation or technical term. Just use HTML tags. 1839 | 1840 | - Setext headers require at least three minus or equals characters to distinguish from 1841 | multiline equations 1842 | 1843 | - Whitespace required between `#` and the section name for ATX headers (disambiguates "#1" from 1844 | a header; required by CommonMark) 1845 | 1846 | - Markdeep's table reference syntax differs from MultiMarkdown's in order to provide a 1847 | consistent formatting syntax across sections, figures, and tables...and one for which the 1848 | source text is more readable. 1849 | 1850 | - Blockquotes must be two lines long (use explicit HTML if you really need a single-line 1851 | blockquote) or contain quotation marks to disambiguate them from lines where a greater-than 1852 | sign just wrapped around. 1853 | 1854 | - Escaped characters such as `\*` and `\_` are not needed, since Markdeep heuristics for 1855 | determining when those characters are part of text and not formatting. 1856 | 1857 | 1858 | Temporary Limitations 1859 | --------------------------------------------------- 1860 | 1861 | Future releases likely will address these known bugs, limitations, and 1862 | "missing features": 1863 | 1864 | - Tables and diagrams in lists create a new list 1865 | - Listings have a maximum caption length of three lines 1866 | 1867 | 1868 | Permanent Limitations 1869 | --------------------------------------------------- 1870 | 1871 | Due to the special protection from formatting that Markdeep affords `
` and `` tags
1872 | that appear in the document, you cannot nest a code tag inside of another code tag, and
1873 | likewise for pre tags.  Fortunately, it is pretty hard to imagine a case where you would want
1874 | nested code tags.
1875 | 
1876 | 
1877 | 


--------------------------------------------------------------------------------
/md/records.csv:
--------------------------------------------------------------------------------
1 | col1,col2,col3
2 | 1, 2, 3
3 | 4, 5, 6
4 | banana, batman, orange
5 | 


--------------------------------------------------------------------------------
/minimal.css:
--------------------------------------------------------------------------------
  1 | :root{
  2 |     --code-bg: #fafafa;
  3 |     --quote-bg: #fafafa;
  4 |     --quote-border: #eaeaea;
  5 | }
  6 | @media print {
  7 |   *,
  8 |   *:before,
  9 |   *:after {
 10 |     background: transparent !important;
 11 |     color: #000 !important;
 12 |     box-shadow: none !important;
 13 |     text-shadow: none !important;
 14 |   }
 15 | 
 16 |   a,
 17 |   a:visited {
 18 |     text-decoration: underline;
 19 |   }
 20 | 
 21 |   a[href]:after {
 22 |     content: " (" attr(href) ")";
 23 |   }
 24 | 
 25 |   abbr[title]:after {
 26 |     content: " (" attr(title) ")";
 27 |   }
 28 | 
 29 |   a[href^="#"]:after,
 30 |   a[href^="javascript:"]:after {
 31 |     content: "";
 32 |   }
 33 | 
 34 |   pre,
 35 |   blockquote {
 36 |     border: 1px solid #999;
 37 |     page-break-inside: avoid;
 38 |   }
 39 | 
 40 |   thead {
 41 |     display: table-header-group;
 42 |   }
 43 | 
 44 |   tr,
 45 |   img {
 46 |     page-break-inside: avoid;
 47 |   }
 48 | 
 49 |   img {
 50 |     max-width: 100% !important;
 51 |   }
 52 | 
 53 |   p,
 54 |   h2,
 55 |   h3 {
 56 |     orphans: 3;
 57 |     widows: 3;
 58 |   }
 59 | 
 60 |   h2,
 61 |   h3 {
 62 |     page-break-after: avoid;
 63 |   }
 64 | }
 65 | 
 66 | pre,
 67 | code {
 68 |   font-family: Menlo, Monaco, "Courier New", monospace;
 69 | }
 70 | 
 71 | pre {
 72 |   padding: .5rem;
 73 |   line-height: 1.25;
 74 |   overflow-x: scroll;
 75 | }
 76 | 
 77 | a,
 78 | a:visited {
 79 |   color: #3498db;
 80 | }
 81 | 
 82 | a:hover,
 83 | a:focus,
 84 | a:active {
 85 |   color: #2980b9;
 86 | }
 87 | 
 88 | .modest-no-decoration {
 89 |   text-decoration: none;
 90 | }
 91 | 
 92 | html {
 93 |   font-size: 12px;
 94 | }
 95 | 
 96 | @media screen and (min-width: 32rem) and (max-width: 48rem) {
 97 |   html {
 98 |     font-size: 15px;
 99 |   }
100 | }
101 | 
102 | @media screen and (min-width: 48rem) {
103 |   html {
104 |     font-size: 16px;
105 |   }
106 | }
107 | 
108 | body {
109 |   line-height: 1.85;
110 | }
111 | 
112 | p{
113 |   font-size: 1rem;
114 |   margin-bottom: 1.3rem;
115 | }
116 | 
117 | h1,
118 | h2,
119 | h3,
120 | h4 {
121 |   margin: 1.414rem 0 .5rem;
122 |   font-weight: inherit;
123 |   line-height: 1.42;
124 | }
125 | 
126 | h1 {
127 |   margin-top: 0;
128 |   font-size: 3.998rem;
129 | }
130 | 
131 | h2 {
132 |   font-size: 2.827rem;
133 | }
134 | 
135 | h3 {
136 |   font-size: 1.999rem;
137 | }
138 | 
139 | h4 {
140 |   font-size: 1.414rem;
141 | }
142 | 
143 | h5 {
144 |   font-size: 1.121rem;
145 | }
146 | 
147 | h6 {
148 |   font-size: .88rem;
149 | }
150 | 
151 | small,
152 | .modest-small {
153 |   font-size: .707em;
154 | }
155 | 
156 | img,
157 | canvas,
158 | iframe,
159 | video,
160 | svg,
161 | select,
162 | textarea {
163 |   max-width: 100%;
164 | }
165 | 
166 | 
167 | html {
168 |   font-size: 18px;
169 |   max-width: 100%;
170 | }
171 | 
172 | body {
173 |   color: #000;
174 |   font-family: arial;
175 |   font-weight: 300;
176 |   margin: 0 auto;
177 |   max-width: 48rem;
178 |   line-height: 1.45;
179 |   padding: .25rem;
180 | }
181 | 
182 | h1,
183 | h2,
184 | h3,
185 | h4,
186 | h5,
187 | h6 {
188 |   font-family: Arimo, Helvetica, sans-serif;
189 | }
190 | 
191 | h1,
192 | h2,
193 | h3 {
194 |   border-bottom: 2px solid #fafafa;
195 |   margin-bottom: 1.15rem;
196 |   padding-bottom: .5rem;
197 |   text-align: center;
198 | }
199 | 
200 | blockquote {
201 |   border-left: 8px solid var(--quote-border);
202 |   background-color: var(--quote-bg);
203 |   padding: 1rem;
204 | }
205 | 
206 | pre,
207 | code {
208 |   background-color: var(--code-bg);
209 | }
210 | 
211 | table {
212 |   margin-top: 0;
213 |   margin-bottom: 16px;
214 |   display: block;
215 |   width: 100%;
216 |   overflow: auto;
217 |   border-spacing: 0;
218 |   border-collapse: collapse;
219 | }
220 | table th {
221 |   font-weight: 600;
222 | }
223 | 
224 | table th,
225 | table td {
226 |   padding: 6px 13px;
227 |   border: 1px solid #dfe2e5;
228 | }
229 | 
230 | table tr {
231 |   background-color: #fff;
232 |   border-top: 1px solid #c6cbd1;
233 | }
234 | 
235 | table tr:nth-child(2n) {
236 |   background-color: #f6f8fa;
237 | }
238 | 
239 |  ul,
240 |  ol {
241 |   padding-left: 2em;
242 | }
243 | 
244 | ul ul,
245 | ul ol,
246 | ol ol,
247 | ol ul {
248 |   margin-top: 0;
249 |   margin-bottom: 0;
250 | }
251 | 
252 | li {
253 |   word-wrap: break-all;
254 | }
255 | 
256 | li>p {
257 |   margin-top: 16px;
258 | }
259 | 
260 | li+li {
261 |   margin-top: 0.25em;
262 | }
263 | 
264 | 
265 | div.side-to-side{
266 |     display:flex;
267 |     justify-content: space-evenly;
268 | }
269 | 
270 | div.side-to-side > div:first-child pre,
271 | div.side-to-side > div:first-child code {
272 |     overflow-x: hidden;
273 |     background-color: transparent;
274 |     font-size: 14px;
275 |     font-family: monospace;
276 | }
277 | 
278 | 
279 | div.side-to-side > div:nth-child(2) {
280 |     padding-top: 30px;
281 | }
282 | 
283 | a[href*="://"]::after, a[rel*="external"] {
284 |     content: " " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%232980b9'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E");
285 | 
286 | }
287 | 


--------------------------------------------------------------------------------
/serve.sh:
--------------------------------------------------------------------------------
1 | 
2 | #!/bin/bash
3 | 
4 | set -v
5 | 
6 | wasm-pack build --target no-modules --release
7 | 
8 | basic-http-server ./ -a 0.0.0.0:4000
9 | 


--------------------------------------------------------------------------------
/serve_debug.sh:
--------------------------------------------------------------------------------
1 | 
2 | #!/bin/bash
3 | 
4 | set -v
5 | 
6 | wasm-pack build --target no-modules --dev
7 | 
8 | basic-http-server ./ -a 0.0.0.0:4000
9 | 


--------------------------------------------------------------------------------
/src/lib.rs:
--------------------------------------------------------------------------------
  1 | use log::*;
  2 | use sauron::{prelude::*, Cmd, Component, Node, Program};
  3 | use std::collections::BTreeMap;
  4 | use url_path::UrlPath;
  5 | use wasm_bindgen::prelude::*;
  6 | 
  7 | // Use `wee_alloc` as the global allocator.
  8 | #[global_allocator]
  9 | static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
 10 | 
 11 | #[derive(Clone)]
 12 | pub enum Msg {
 13 |     UrlChanged(String),
 14 |     FileReady(Result),
 15 | }
 16 | 
 17 | pub struct App {
 18 |     raw: String,
 19 |     content: String,
 20 |     title: Option,
 21 |     current_file: UrlPath,
 22 | }
 23 | 
 24 | impl App {
 25 |     fn new() -> Self {
 26 |         let hash = Browser::get_hash();
 27 |         let current_file = UrlPath::new(Self::clean_link(&hash));
 28 |         App {
 29 |             raw: String::new(),
 30 |             content: String::new(),
 31 |             title: None,
 32 |             current_file,
 33 |         }
 34 |     }
 35 | 
 36 |     fn clean_link(url: &str) -> &str {
 37 |         let url = url.trim_start_matches("#/");
 38 |         let url = url.trim_start_matches("#");
 39 | 		if url.trim().is_empty(){
 40 | 			"index.md"
 41 | 		}else{
 42 | 			url
 43 | 		}
 44 |     }
 45 | 
 46 |     fn fetch_current_file(&self) -> Cmd {
 47 |         let url = self.current_file.normalize();
 48 |         trace!("fetching {}", url);
 49 |         Http::fetch_with_text_response_decoder(&url, |v| v, Msg::FileReady)
 50 |     }
 51 | 
 52 |     fn markdown_to_html(&mut self) {
 53 |         let embed_files = BTreeMap::new();
 54 |         if let Ok(html) = spongedown::parse_with_base_dir(
 55 |             &self.raw,
 56 |             &self.current_file.parent().unwrap_or("/".to_string()),
 57 |             &Some(embed_files),
 58 |         ) {
 59 |             self.title = html.title;
 60 |             self.content = html.content;
 61 |             if let Some(title) = &self.title{
 62 |                 Window::set_title(&title);
 63 |             }
 64 |         }
 65 |     }
 66 | }
 67 | 
 68 | impl Component for App {
 69 |     fn init(&self) -> Cmd {
 70 |         Cmd::batch(vec![
 71 |             Browser::onhashchange(Msg::UrlChanged),
 72 |             self.fetch_current_file(),
 73 |         ])
 74 |     }
 75 |     fn update(&mut self, msg: Msg) -> Cmd {
 76 |         match msg {
 77 |             Msg::UrlChanged(url) => {
 78 |                 let url = Self::clean_link(&url);
 79 |                 trace!("url changed: {}", url);
 80 |                 self.current_file = UrlPath::new(url);
 81 |                 self.fetch_current_file()
 82 |             }
 83 |             Msg::FileReady(file) => {
 84 |                 Browser::scroll_to_top();
 85 |                 match file {
 86 |                     Ok(raw) => {
 87 |                         trace!("ok got file");
 88 |                         self.raw = raw;
 89 |                         self.markdown_to_html();
 90 |                     }
 91 |                     Err(_e) => {
 92 | 						//TODO: deal with errors here
 93 | 						// 404 error, http request error
 94 | 						error!("display 404 here")
 95 | 					}
 96 |                 }
 97 |                 Cmd::none()
 98 |             }
 99 |         }
100 |     }
101 | 
102 |     fn view(&self) -> Node {
103 |         div(
104 |             vec![],
105 |             vec![
106 |                 nav(vec![], vec![a(vec![href("/")], vec![text("Home")])]),
107 |                 article(vec![inner_html(&self.content)], vec![]),
108 |             ],
109 |         )
110 |     }
111 | }
112 | 
113 | #[wasm_bindgen(start)]
114 | pub fn main() {
115 |     console_error_panic_hook::set_once();
116 |     console_log::init_with_level(log::Level::Trace).unwrap();
117 |     Program::mount_to_body(App::new());
118 | }
119 | 


--------------------------------------------------------------------------------