papr-pdf 0.1.0

A fast, keyboard-first CLI tool to compile Markdown, LaTeX, and plain text files into publication-grade PDFs.
//! Command-line argument definitions and data structures for `papr`.

use clap::{Parser, ValueEnum};
use std::path::PathBuf;

/// Document format selector.
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)]
pub enum DocumentFormat {
    /// Markdown (.md, .markdown) format with KaTeX math & syntax-highlighting.
    #[value(name = "md", alias = "markdown")]
    Markdown,

    /// LaTeX (.tex) document with multi-file and package resolution.
    #[value(name = "tex", alias = "latex")]
    Latex,

    /// Plain text (.txt) file with line-wrapping and clean monospace layout.
    #[value(name = "txt", alias = "text")]
    PlainText,
}

/// Visual styling themes for Markdown and Plain Text conversions.
#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Default)]
pub enum Theme {
    /// Classical publication style with serif Latin Modern typography.
    #[default]
    #[value(name = "academic")]
    Academic,

    /// Clean GitHub Flavored Markdown aesthetic.
    #[value(name = "github")]
    Github,

    /// Minimalist modern sans-serif aesthetic with soft accents.
    #[value(name = "modern")]
    Modern,

    /// High-contrast dark theme optimized for OLED / reading screens.
    #[value(name = "dark")]
    Dark,
}

/// Command-line arguments parsed by Clap.
#[derive(Parser, Debug)]
#[command(
    name = "papr",
    author = "Rishal",
    version = "0.1.0",
    about = "Lightning-fast CLI tool to compile Markdown, LaTeX, and Plain Text files into publication-grade PDFs.",
    long_about = "papr compiles Markdown (.md), LaTeX (.tex), and Plain Text (.txt) documents into PDFs.\nRun 'papr' with no arguments to launch the interactive prompt, or pass a file directly."
)]
pub struct Cli {
    /// Path to the input file (.md, .tex, or .txt). If omitted, launches interactive wizard.
    #[arg(value_name = "INPUT")]
    pub input: Option<PathBuf>,

    /// Destination path for the generated PDF. Defaults to '<input_name>.pdf'.
    #[arg(short, long, value_name = "OUTPUT")]
    pub output: Option<PathBuf>,

    /// Explicitly specify document format (md, tex, txt). Auto-detected if omitted.
    #[arg(short, long, value_enum)]
    pub format: Option<DocumentFormat>,

    /// Styling theme for Markdown and Plain Text conversions.
    #[arg(short, long, value_enum, default_value_t = Theme::Academic)]
    pub theme: Theme,

    /// Automatically open the generated PDF in the system default viewer.
    #[arg(long)]
    pub open: bool,
}