Rename to natter.

This commit is contained in:
Tom Alexander 2023-12-21 19:28:31 -05:00
parent d641c8d638
commit 35dff5cdaf
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
8 changed files with 27 additions and 27 deletions

34
Cargo.lock generated
View File

@ -401,6 +401,23 @@ dependencies = [
"adler",
]
[[package]]
name = "natter"
version = "0.0.1"
dependencies = [
"clap",
"duster",
"futures",
"include_dir",
"organic",
"serde",
"serde_json",
"tokio",
"toml",
"tree-sitter-highlight",
"walkdir",
]
[[package]]
name = "nom"
version = "6.1.2"
@ -831,23 +848,6 @@ dependencies = [
"memchr",
]
[[package]]
name = "writer"
version = "0.0.1"
dependencies = [
"clap",
"duster",
"futures",
"include_dir",
"organic",
"serde",
"serde_json",
"tokio",
"toml",
"tree-sitter-highlight",
"walkdir",
]
[[package]]
name = "wyz"
version = "0.2.0"

View File

@ -1,5 +1,5 @@
[package]
name = "writer"
name = "natter"
version = "0.0.1"
edition = "2021"

View File

@ -4,7 +4,7 @@ use clap::Subcommand;
use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(name = "Writer")]
#[command(name = "Natter")]
#[command(version = env!("CARGO_PKG_VERSION"))]
#[command(about = "Generate a static site.", long_about = None)]
#[command(propagate_version = true)]
@ -24,14 +24,14 @@ pub(crate) enum Commands {
#[derive(Args, Debug)]
pub(crate) struct InitArgs {
/// Path where you want the initial writer structure to be located.
/// Path where you want the initial natter structure to be located.
#[arg(short, long)]
pub(crate) path: PathBuf,
}
#[derive(Args, Debug)]
pub(crate) struct BuildArgs {
/// Path to the writer config file.
/// Path to the natter config file.
#[arg(short, long)]
pub(crate) config: PathBuf,
}

View File

@ -1,3 +1,3 @@
mod runner;
pub(crate) use runner::init_writer_folder;
pub(crate) use runner::init_natter_folder;

View File

@ -2,7 +2,7 @@ use crate::cli::parameters::InitArgs;
use crate::config::Config;
use crate::error::CustomError;
pub(crate) async fn init_writer_folder(args: InitArgs) -> Result<(), CustomError> {
pub(crate) async fn init_natter_folder(args: InitArgs) -> Result<(), CustomError> {
if args.path.exists() && !args.path.is_dir() {
return Err("The supplied path exists but is not a directory. Aborting.".into());
}

View File

@ -17,7 +17,7 @@ pub(crate) struct Config {
impl Config {
pub(crate) fn new<P: AsRef<Path>>(root_dir: P) -> Result<Config, CustomError> {
fn inner(root_dir: &Path) -> Result<Config, CustomError> {
let file_path = root_dir.join("writer.toml");
let file_path = root_dir.join("natter.toml");
Ok(Config {
raw: RawConfig::default(),
config_path: file_path,

View File

@ -1,7 +1,7 @@
use serde::Deserialize;
use serde::Serialize;
/// This is the struct for the writer.toml config file that ends up in each site's root directory.
/// This is the struct for the natter.toml config file that ends up in each site's root directory.
#[derive(Debug, Deserialize, Serialize)]
pub(crate) struct RawConfig {
pub(super) site_title: Option<String>,

View File

@ -6,7 +6,7 @@ use clap::Parser;
use self::cli::parameters::Cli;
use self::cli::parameters::Commands;
use self::command::build::build_site;
use self::command::init::init_writer_folder;
use self::command::init::init_natter_folder;
use self::error::CustomError;
mod cli;
mod command;
@ -28,7 +28,7 @@ async fn main_body() -> Result<ExitCode, CustomError> {
let args = Cli::parse();
match args.command {
Commands::Init(args) => {
init_writer_folder(args).await?;
init_natter_folder(args).await?;
}
Commands::Build(args) => {
build_site(args).await?;