108 lines
3.2 KiB
TOML
108 lines
3.2 KiB
TOML
root_node = "Documentation"
|
|
|
|
[nodes.Documentation]
|
|
text = """
|
|
|
|
Installation
|
|
|
|
For now, if you want to try en, you must build it yourself.
|
|
|
|
In an environment with a Rust toolchain and Git installed, run:
|
|
|
|
git clone https://codeberg.org/jutty/en
|
|
cd en
|
|
cargo build --release
|
|
|
|
The en binary will be in target/release/en.
|
|
|
|
Graph Syntax
|
|
|
|
The graph is a TOML file. You can create nodes by adding text such as:
|
|
|
|
[nodes.Computer]
|
|
text = "A computer is a machine capable of executing user-supplied instructions."
|
|
|
|
If you need longer text, it's more convenient to use triple-quoted syntax:
|
|
|
|
[nodes.Computer]
|
|
text = \"""
|
|
A computer is a machine capable of executing user-supplied instructions.
|
|
\"""
|
|
|
|
Nodes can have connections between each other.
|
|
|
|
To add a simple connection without any associated properties, you can simply add links:
|
|
|
|
[nodes.Quark]
|
|
text = "A subatomic particle that forms hadrons."
|
|
|
|
links = [ "Particle", "Hadron" ]
|
|
|
|
This will create two outgoing connections from Quark: to Particle and to Hadron. It will also list Quark as an incoming connection in these nodes' pages.
|
|
|
|
If you want to add properties to the connection, you can use the connection syntax:
|
|
|
|
[[nodes.Quark.connections]]
|
|
to = "Particle physics"
|
|
anchor = "particle"
|
|
|
|
This will create a connection from Quark to "Particle physics", and the first occurrence of the word "particle" in the text of Quark gets anchored to this connection.
|
|
|
|
CLI Options
|
|
|
|
You can set the hostname, port and graph file path using CLI options:
|
|
|
|
For the hostname, use -h or --hostname:
|
|
|
|
en -h localhost
|
|
en --hostname 10.120.0.5
|
|
|
|
If unspecified, the default is 0.0.0.0.
|
|
|
|
For the port, use -p or --port:
|
|
|
|
en -p 3003
|
|
en --port 3000
|
|
|
|
If unspecified, the default is to use a random port assigned by the operating system.
|
|
|
|
For the graph path, use -g or --graph:
|
|
|
|
en -g graph.toml
|
|
en --g ./static/my-graph.toml
|
|
|
|
If unspecified, the default is ./static/graph.toml.
|
|
|
|
You can combine these options as you wish:
|
|
|
|
en -h localhost -p 3000
|
|
en --host localhost -p 3003 --graph ./graph.toml
|
|
|
|
"""
|
|
|
|
[nodes.en]
|
|
text = """
|
|
en is a tool to write non-linear, connected pieces of text and have their references mapped out as a graph of connected information.
|
|
|
|
It works by ingesting a TOML file containing your node specification and serving it as a website that allows nodes to be browsed, searched and listed in relation to each other or as a shallow tree of nodes.
|
|
"""
|
|
|
|
links = [ "Graph", "TOML" ]
|
|
|
|
[nodes.Graph]
|
|
text = """
|
|
A graph is a data structure composed of connected (and disconnected) nodes.
|
|
|
|
A familiar example is that of a social network. Each account can be thought of as a node and the "follow" and "follower" relationships can be thought of as edges (connections). A node may have many or few connections, and the nodes it is connected to are meaningful to understand how it fits into the whole.
|
|
|
|
en uses this concept to create a writing tool, allowing you to map out complex thoughts as a web connected texts.
|
|
"""
|
|
|
|
[nodes.TOML]
|
|
text = """
|
|
TOML is a configuration format that can be easily read and understood by humans and machines alike.
|
|
|
|
To learn more about TOML, you can visit its website at <toml.io>.
|
|
|
|
To see the TOML declaration that translates into the rendered graph you are reading right now, visit the "TOML Graph" link on the top navigation bar.
|
|
"""
|