Abbaye

at bb4e6ed

//! # Abbaye
//!
//! Abbaye is a Static Site Generator (SSG) for your software. As GitHub,
//! Gitea, Forgejo and consorts offer, Abbaye can be used to generate a
//! website with your software's presentation, documentation, and distribution, per version.
//!
//! Here's an example file structure:
//!
//! ```text
//! .
//! ├── index.html # the main page of the website, enabling choosing a version, defaults to "latest" (contains a list of available versions and a iframe to the selected version?)
//! ├── latest -> v2.0.0 # symlink to the latest version (biggest version number)
//! ├── v1.0.0/ # the directory containing the version 1.0.0 of the software
//! │   ├── index.html # the main page of the version 1.0.0, from the README.md file.
//! │   │   # Contains a sidebar with links to the documentation and distribution.
//! │   │   # After the readme content, A changelog is displayed.
//! │   ├── docs/ # the directory containing the documentation of the version 1.0.0
//! │   │   ├── index.html # the main page of the documentation of the version 1.0.0
//! │   │   └── …
//! │   ├── docs.tar.gz # the tarball containing the documentation of the version 1.0.0
//! │   └── dist/ # the directory containing the distribution of the version 1.0.0
//! │       ├── source.tgz # the source code of the version 1.0.0
//! │       ├── mybin-v1.0.0-x86_64-unknown-linux-gnu
//! │       └── mybin-v1.0.0-x86_64-unknown-linux-musl
//! └── v2.0.0/ # the directory containing the version 2.0.0 of the software
//!     ├── index.html # the main page of the version 2.0.0
//!     ├── …
//!     └── …
//! ```

use miette::Result;

/// All builders for the site (ex: cargo build, cargo doc, etc.).
pub mod builders;
/// Parses the changelog file and generates a changelog page for the site.
pub mod changelog;
/// Handles the `abbaye.toml` configuration file.
pub mod config;
/// Generates the site from the configuration and builds it.
pub mod site;
/// Extracts current version information from different sources (ex: git tags, cargo metadata, etc.).
pub mod version_extractors;

#[tokio::main]
async fn main() -> Result<()> {
    tracing_subscriber::fmt()
        .with_timer(tracing_subscriber::fmt::time::SystemTime)
        .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
        .init();

    let config = site::load_config()?;
    site::build_site(config).await
}