Add word-level parsing
This commit is contained in:
parent
0d66b1ee7c
commit
198bc12507
34 changed files with 743 additions and 446 deletions
|
|
@ -7,11 +7,13 @@ text = """
|
|||
|
||||
For now, if you want to try en, you must build it yourself.
|
||||
|
||||
In an environment with a Rust toolchain and Git installed, run:
|
||||
In an environment with a |Rust toolchain|https://rustup.rs/ 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.
|
||||
|
||||
|
|
@ -19,32 +21,40 @@ The en binary will be in target/release/en.
|
|||
|
||||
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 arbitrary 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 arbitrary 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.
|
||||
|
||||
|
|
@ -54,30 +64,38 @@ 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 available 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 -p 3003 --host localhost --graph ./graph.toml
|
||||
en --g ./graph.toml -p 1312
|
||||
`
|
||||
|
||||
If an option is specified more than once, the last use will override any previous ones.
|
||||
|
||||
|
|
@ -127,16 +145,16 @@ To see the TOML declaration that translates into the rendered graph you are read
|
|||
text = """
|
||||
en is only possible thanks to a number of projects and people:
|
||||
|
||||
- [The Rust Programing Language](https://rust-lang.org/)
|
||||
- [Tokio](https://tokio.rs/)
|
||||
- [Axum](https://github.com/tokio-rs/axum)
|
||||
- [Tera](https://keats.github.io/tera/)
|
||||
- [Serde](https://serde.rs/) and the [toml crate](https://github.com/toml-rs/toml)
|
||||
- [Bacon](https://dystroy.org/bacon/config/)
|
||||
- |The Rust Programing Language|https://rust-lang.org/
|
||||
- Tokio|https://tokio.rs/
|
||||
- Axum|https://github.com/tokio-rs/axum
|
||||
- Tera|https://keats.github.io/tera/
|
||||
- Serde|https://serde.rs/ and the |toml crate|https://github.com/toml-rs/toml
|
||||
- Bacon|https://dystroy.org/bacon/config/
|
||||
"""
|
||||
|
||||
[meta.config]
|
||||
footer_credits = false
|
||||
footer_text = """
|
||||
made by jutty • acknowledgements • source code
|
||||
made by jutty|https://jutty.dev • acknowledgements|Acknowledgments • |source code|https://codeberg.org/jutty/en
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue