created readme

This commit is contained in:
2026-02-26 09:28:25 +01:00
parent b854e4b633
commit 4c2568b291
3 changed files with 53 additions and 0 deletions

47
README.md Normal file
View File

@@ -0,0 +1,47 @@
# Wiki Maker
## How to use
### Creation
> [!NOTE] See the example in [example/](./example/).
wiki-maker provides a CLI to help create a wiki.
You can generate an entry with:
```sh
wiki-maker entry new "My New Entry"
```
An entry is made of essencially 2 files:
- `my-new-entry.toml` contains the names of the other files, as well as a map of attributes for your entry
- `my-new-entry.md` is where you start writing
- By default it looks for `my-new-entry.png` as the main image.
Links are made between entries by using this syntax: `[See this entry](my-other-entry)`.
You can view which links are not yet satisfied with:
```sh
wiki-maker todo
```
You can even generate a graph representation of your wiki:
```sh
wiki-maker graph | dot -Tpng > /tmp/graph.png
imv /tmp/graph.png
```
### Deployment
wiki-maker provides 2 ways to deploy your wiki.
You can serve the wiki in `example` with:
```sh
wiki-maker --path ./example/ serve --port 8090 --host
```
> [!NOTE] Changes to files will instantly reflect on the server.
Or you can generate a static build with:
```sh
wiki-maker --path ./example/ build -o ./dist/
```

View File

@@ -15,10 +15,13 @@ pub struct Cli {
pub enum Commands {
/// Serve the wiki locally
Serve {
/// Disable the navigation page
#[arg(short, long)]
no_navigation: bool,
/// Network port to use
#[arg(short = 'P', long, default_value = "8090")]
port: u16,
/// Whether to use 0.0.0.0 to serve on the network
#[arg(short = 'H', long)]
host: bool,
},

View File

@@ -115,6 +115,9 @@ async fn main() -> anyhow::Result<()> {
};
let listener = tokio::net::TcpListener::bind(&addr).await?;
tracing::info!("Listening on http://{}", addr);
if no_navigation {
tracing::warn!("no_navigation is enabled: there will be no index at the root")
}
axum::serve(listener, app).await?;
}
Commands::Build {