From 79c0ba9eed46cce6445def41db2e9d38eccd157f Mon Sep 17 00:00:00 2001 From: jutty Date: Thu, 1 Jan 2026 21:48:11 -0300 Subject: [PATCH] Minor refactorings, justfile tweaks, roadmap update --- .justfile | 3 +-- README.md | 5 +++++ src/syntax/serial.rs | 20 +++++++------------- src/types.rs | 4 ++-- templates/empty.html | 2 +- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.justfile b/.justfile index 66e420b..ab25119 100644 --- a/.justfile +++ b/.justfile @@ -220,10 +220,9 @@ default: @just --list --unsorted --justfile {{justfile()}} export RUSTFLAGS := "-Dwarnings" -export RUST_BACKTRACE := "1" export CARGO_TERM_COLOR := 'always' -debug_vars := 'DEBUG=${DEBUG:-} DEBUG_FILTER=${DEBUG_FILTER:-}' +debug_vars := 'DEBUG=${DEBUG:-} DEBUG_FILTER=${DEBUG_FILTER:-} RUST_BACKTRACE=${RUST_BACKTRACE:-}' watch_cmd := "watchexec -qc -r -e rs,toml,html --color always -- " cover_cmd := 'cargo llvm-cov --color always --ignore-filename-regex "main\.rs|dev\.rs"' just_cmd := 'just --timestamp --explain --command-color green' diff --git a/README.md b/README.md index b2ccdea..51e9510 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,17 @@ You can learn more and see what en looks like by visiting the [homepage](https:/ - [x] Add tests - [ ] Improve content syntax parser coverage +- [ ] Redirects - [ ] Richer text formatting - [x] Headers - [x] Preformatted blocks - [x] Inline code - [x] Anchor rendering - [ ] Automatic anchors + - [ ] Plural anchors (|node|s -> node) + - [ ] Conjugation anchors (|will|ed -> will) + - [ ] Spaced node anchor (|red fox| -> redfox -> RedFox) + - [ ] TOML allows only letters, numbers, dashes and underscores in node IDs. This means trailing punctuation such as in `panther|Panthera,` could be automatically split - [ ] `#` syntax for header ID anchors - [x] External anchors - [ ] Bold, italics, underline, strikethrough diff --git a/src/syntax/serial.rs b/src/syntax/serial.rs index c22dddc..bb22f87 100644 --- a/src/syntax/serial.rs +++ b/src/syntax/serial.rs @@ -180,19 +180,13 @@ mod tests { #[test] fn detached_node() { - let node = Node { - id: String::from("SomeNode"), - text: String::new(), - title: String::new(), - links: vec![String::new()], - hidden: false, - connections: Some(vec![Edge { - anchor: String::from("SomeAnchor"), - from: String::new(), - to: String::new(), - detached: false, - }]), - }; + let mut node = Node::new(None); + node.connections = Some(vec![Edge { + anchor: String::from("SomeAnchor"), + from: String::new(), + to: String::new(), + detached: false, + }]); let mut map: HashMap = HashMap::new(); map.insert(String::from("SomeNode"), node); diff --git a/src/types.rs b/src/types.rs index 346d8f1..16b51be 100644 --- a/src/types.rs +++ b/src/types.rs @@ -147,8 +147,8 @@ impl Graph { impl Node { pub fn new(message: Option) -> Node { Node { - id: "VoidNode".to_string(), - title: "Pure Void".to_string(), + id: "404".to_string(), + title: "Not Found".to_string(), text: match message { Some(s) => s, None => "Node is empty, missing or wasn't found.".to_string(), diff --git a/templates/empty.html b/templates/empty.html index 9dd335d..9b2cad5 100644 --- a/templates/empty.html +++ b/templates/empty.html @@ -7,7 +7,7 @@ {% endif %} raw endpoints - {% if config.raw_toml or config.raw_json %} + {%- if config.raw_toml or config.raw_json -%} {% endif %} for possible parsing errors.