Rename to natter.
This commit is contained in:
parent
d641c8d638
commit
35dff5cdaf
34
Cargo.lock
generated
34
Cargo.lock
generated
@ -401,6 +401,23 @@ dependencies = [
|
|||||||
"adler",
|
"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]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "6.1.2"
|
version = "6.1.2"
|
||||||
@ -831,23 +848,6 @@ dependencies = [
|
|||||||
"memchr",
|
"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]]
|
[[package]]
|
||||||
name = "wyz"
|
name = "wyz"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "writer"
|
name = "natter"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ use clap::Subcommand;
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Parser, Debug)]
|
#[derive(Parser, Debug)]
|
||||||
#[command(name = "Writer")]
|
#[command(name = "Natter")]
|
||||||
#[command(version = env!("CARGO_PKG_VERSION"))]
|
#[command(version = env!("CARGO_PKG_VERSION"))]
|
||||||
#[command(about = "Generate a static site.", long_about = None)]
|
#[command(about = "Generate a static site.", long_about = None)]
|
||||||
#[command(propagate_version = true)]
|
#[command(propagate_version = true)]
|
||||||
@ -24,14 +24,14 @@ pub(crate) enum Commands {
|
|||||||
|
|
||||||
#[derive(Args, Debug)]
|
#[derive(Args, Debug)]
|
||||||
pub(crate) struct InitArgs {
|
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)]
|
#[arg(short, long)]
|
||||||
pub(crate) path: PathBuf,
|
pub(crate) path: PathBuf,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Args, Debug)]
|
#[derive(Args, Debug)]
|
||||||
pub(crate) struct BuildArgs {
|
pub(crate) struct BuildArgs {
|
||||||
/// Path to the writer config file.
|
/// Path to the natter config file.
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
pub(crate) config: PathBuf,
|
pub(crate) config: PathBuf,
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
mod runner;
|
mod runner;
|
||||||
|
|
||||||
pub(crate) use runner::init_writer_folder;
|
pub(crate) use runner::init_natter_folder;
|
||||||
|
@ -2,7 +2,7 @@ use crate::cli::parameters::InitArgs;
|
|||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::error::CustomError;
|
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() {
|
if args.path.exists() && !args.path.is_dir() {
|
||||||
return Err("The supplied path exists but is not a directory. Aborting.".into());
|
return Err("The supplied path exists but is not a directory. Aborting.".into());
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ pub(crate) struct Config {
|
|||||||
impl Config {
|
impl Config {
|
||||||
pub(crate) fn new<P: AsRef<Path>>(root_dir: P) -> Result<Config, CustomError> {
|
pub(crate) fn new<P: AsRef<Path>>(root_dir: P) -> Result<Config, CustomError> {
|
||||||
fn inner(root_dir: &Path) -> 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 {
|
Ok(Config {
|
||||||
raw: RawConfig::default(),
|
raw: RawConfig::default(),
|
||||||
config_path: file_path,
|
config_path: file_path,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde::Serialize;
|
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)]
|
#[derive(Debug, Deserialize, Serialize)]
|
||||||
pub(crate) struct RawConfig {
|
pub(crate) struct RawConfig {
|
||||||
pub(super) site_title: Option<String>,
|
pub(super) site_title: Option<String>,
|
||||||
|
@ -6,7 +6,7 @@ use clap::Parser;
|
|||||||
use self::cli::parameters::Cli;
|
use self::cli::parameters::Cli;
|
||||||
use self::cli::parameters::Commands;
|
use self::cli::parameters::Commands;
|
||||||
use self::command::build::build_site;
|
use self::command::build::build_site;
|
||||||
use self::command::init::init_writer_folder;
|
use self::command::init::init_natter_folder;
|
||||||
use self::error::CustomError;
|
use self::error::CustomError;
|
||||||
mod cli;
|
mod cli;
|
||||||
mod command;
|
mod command;
|
||||||
@ -28,7 +28,7 @@ async fn main_body() -> Result<ExitCode, CustomError> {
|
|||||||
let args = Cli::parse();
|
let args = Cli::parse();
|
||||||
match args.command {
|
match args.command {
|
||||||
Commands::Init(args) => {
|
Commands::Init(args) => {
|
||||||
init_writer_folder(args).await?;
|
init_natter_folder(args).await?;
|
||||||
}
|
}
|
||||||
Commands::Build(args) => {
|
Commands::Build(args) => {
|
||||||
build_site(args).await?;
|
build_site(args).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user