diff --git a/src/main.rs b/src/main.rs index 99ee1cf..fb38e6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -97,7 +97,7 @@ async fn node_view(Path(id): Path) -> impl IntoResponse { context.insert("id", &id); context.insert("title", &node.title); - context.insert("body", &node.body); + context.insert("text", &node.text); context.insert("connections", &node.connections.clone()); context.insert("incoming", &graph.incoming.get(&id)); @@ -107,12 +107,12 @@ async fn node_view(Path(id): Path) -> impl IntoResponse { 500, &format!( r#"Failed to generate page for node {} (ID {}) with {} outgoing, - {} incoming connections and body "{}""#, + {} incoming connections and text "{}""#, node.title, id, node.connections.iter().len(), graph.incoming.get(&id).iter().len(), - node.body, + node.text, ), ) } diff --git a/src/types.rs b/src/types.rs index 0ce9a45..4b96d08 100644 --- a/src/types.rs +++ b/src/types.rs @@ -11,7 +11,7 @@ pub struct Graph { #[derive(Serialize, Deserialize, Clone, Default, Debug)] pub struct Node { - pub body: String, + pub text: String, #[serde(default)] pub title: String, #[serde(default)] pub links: Vec, #[serde(default)] pub id: String, @@ -52,7 +52,7 @@ impl Node { Self { id: "VoidNode".to_string(), title: "Pure Void".to_string(), - body: match message { + text: match message { Some(s) => s, None => "Node is empty, missing or wasn't found.".to_string() }, diff --git a/static/graph.toml b/static/graph.toml index 7d99a7c..ac70b0b 100644 --- a/static/graph.toml +++ b/static/graph.toml @@ -1,33 +1,33 @@ root_node = "Interface" [nodes.Interface] -body = """ +text = """ An interface is a point of contact between the inside and the outside of something. Contrast with intraface. """ links = ["Intraface"] [nodes.Intraface] -body = """ +text = """ The intraface is the reflexive process of communicating, creating, thinking, that does not or cannot get shared with others. Contrast with interface. """ links = ["Thinking", "Interface"] [nodes.Thinking] -body = """ +text = """ Thinking is a process by which some beings create and manipulate mental constructs. """ [nodes.Paradigm] -body = """ +text = """ A paradigm is a cohesive set of beliefs, methods and principles that serve both as justification for a given position and as guidance for how to pursue its praxis. """ links = [ "Principle", "Belief", "Method", "Position", "Praxis" ] [nodes.Principle] -body = """ +text = """ A principle is a belief that implies commitment and necessity. Principles change, but to change one's principles too constantly defeats its purpose. @@ -44,7 +44,7 @@ anchor = "identifying" to = "Identity" [nodes.Religion] -body = """ +text = """ A religion is a paradigm that involves unfalsifiable beliefs, particularly those in the domain of morality. A reductive critique of religion dismisses it based on its dogmatic adherence to certain beliefs usually rooted in tradition. @@ -72,7 +72,7 @@ links = [ ] [nodes.Identity] -body = """ +text = """ Identity is how individuals construe their sameness and otherness from each other and from nothingness. """ @@ -83,14 +83,14 @@ anchor = "nothingness" to = "Emptiness" [nodes.Emptiness] -body = """ +text = """ Emptiness is the vacuous base in which entities exist. """ links = [ "Entity" ] [nodes.Entity] -body = """ +text = """ An entity is anything except for actual emptiness. It does not have to be sentient, or physical. It can be an idea, a concept, a memory. The concept of emptiness is an entity, but emptiness itself is not. """ diff --git a/templates/node.html b/templates/node.html index 277a517..21d461a 100644 --- a/templates/node.html +++ b/templates/node.html @@ -6,7 +6,7 @@

{{ title }}

ID: {{ id }} - {% for line in body | split(pat="\n") %} + {% for line in text | split(pat="\n") %} {% if line %}

{{ line }}

{% endif %} {% endfor %}
diff --git a/templates/tree.html b/templates/tree.html index 15866d0..6c5e135 100644 --- a/templates/tree.html +++ b/templates/tree.html @@ -13,14 +13,14 @@
  • {{root_node.title}}
      -
    • Body: +
    • Text:
      • - {{root_node.body | truncate(length=120)}} + {{root_node.text | truncate(length=120)}} - {{root_node.body}} + {{root_node.text}}
      @@ -36,8 +36,8 @@
  • - {% endif %} + {% if nodes %}

    All nodes

      @@ -45,14 +45,14 @@
    • {{node.title}}
        -
      • Body: +
      • Text:
        • - {{node.body | truncate(length=30)}} + {{node.text | truncate(length=30)}} - {{node.body}} + {{node.text}}
        @@ -72,6 +72,7 @@ {% endfor %} {% endif %}
      + {% else %} {% include "empty.html" %} {% endif %}