From c5c433edb56aa02f97650503044a7f4864ad313b Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Thu, 25 Sep 2025 11:38:05 -0400 Subject: [PATCH] Adding initial README files. --- README.md | 49 +++++++++++++++++++++++++++++++++ bard/README.md | 71 ++++++++++++++++++++++++++++++++++++++++++++++-- tavern/README.md | 25 +++++++++++++++-- 3 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f7903e --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Tavernworks + +Tavernworks is a modular blog system written in Rust. It is designed to parse, +compile, and serve structured blog content using a cohesive set of themed +libraries. The system is centered around the `tavern` content engine and is +supported by a publisher CLI and a rendering frontend. + +## Overview + +TavernWorks consists of the following components: + +### tavern + +The core library that defines the data model, parses content, and provides the +API to read and write blog data. It is responsible for turning a repository of +Markdown files and metadata into an in-memory structure or database. + +### loreweaver + +A command-line tool that uses `tavern` to compile a blog repository into a +SQLite database. It reads a `Tavern.toml` metadata file and outputs a portable +database that can be served or inspected. + +### bard + +A Dioxus-based frontend library that renders blog content from the database. +It provides components to create a full blog UI using data produced by +`loreweaver`. + +### blog_test + +A test project that verifies the full system from content to rendering. It is +used to validate that blog repositories are parsed, compiled, and rendered +correctly across all components. + +--- + +## Copyright & License + +Copyright 2025 CyberMages LLC + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this library except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS diff --git a/bard/README.md b/bard/README.md index aea3268..ff99b9c 100644 --- a/bard/README.md +++ b/bard/README.md @@ -1,7 +1,72 @@ -# Tavern +# Bard -A blogging system that will allow you to write your blog in Markdown and then -display it in HTML using Dioxus. +Bard is the frontend rendering library for the Tavernworks blog system. +It provides Dioxus components for rendering blog content that has been compiled +into a SQLite database by Loreweaver and parsed by the Tavern engine. + +Bard supports both server-side and client-side rendering and is designed to be +integrated into Dioxus applications. + +## Features + +- Dioxus components for routing and rendering blog pages +- Works with content stored in a SQLite database +- Compatible with `dioxus-web` and `dioxus-desktop` +- Optional server integration via Axum for local hosting + +## Usage + +To use Bard in a Dioxus application, you must: + +1. Initialize the database using `bard::init_database`. +2. Add the `Router::` component to your app. +3. Optionally, define routes that include Bard under your own layout. + +### Example + +```rust +#[component] +fn App() -> Element { + rsx! { + Router:: {} + } +} + +#[derive(Routable, Clone, PartialEq)] +pub enum Page { + #[layout(Navbar)] + #[route("/")] + Home {}, + + #[child("/blog")] + Bard + { + child: bard::Page + }, + + #[route("/:..route")] + PageNotFound { route: Vec } +} +``` + +### Server-side Initialization + +To serve the blog using Axum and load the database: + +```rust +tokio::runtime::Runtime::new() + .unwrap() + .block_on(async move { + bard::init_database("path/to/tavern.db").await; + }); +``` + +## Features + +Enable the following Cargo features as needed: + +- `server`: Enables Axum support for database-backed serving +- `web`: Enables Dioxus web support --- diff --git a/tavern/README.md b/tavern/README.md index aea3268..857cb49 100644 --- a/tavern/README.md +++ b/tavern/README.md @@ -1,7 +1,28 @@ # Tavern -A blogging system that will allow you to write your blog in Markdown and then -display it in HTML using Dioxus. +Tavern is the core content engine of the Tavernworks blog system. +It provides the data model, parsing logic, and database interaction necessary +to convert a Markdown-based blog repository into a structured, queryable form. + +## Features + +- Parses blog content from Markdown files and metadata. +- Converts content into an in-memory model or stores it in SQLite. +- Provides an async API to query and manipulate blog data. +- Designed to be extensible and integrated into CLI tools or frontends. + +## Usage + +As a library, `tavern` can be embedded in Rust applications or CLI tools +to handle blog content processing and storage. + +```rust +use tavern::{Tavern, Database}; + +let tavern = Tavern::from_config_file("Tavern.toml"); +let database = Database::open("blog.db").await?; +database.insert_tavern(&tavern).await?; +``` ---