ron2_doc/
config.rs

1//! Configuration types for documentation generation.
2
3use std::path::PathBuf;
4
5/// Output format for generated documentation.
6#[derive(Debug, Clone, Copy, Default, clap::ValueEnum)]
7pub enum OutputFormat {
8    /// Standard markdown without frontmatter
9    #[default]
10    Plain,
11    /// Astro Starlight format with YAML frontmatter
12    Starlight,
13}
14
15/// Output mode for documentation generation.
16#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
17pub enum OutputMode {
18    /// Generate one markdown file per type
19    #[default]
20    MultiPage,
21    /// Generate all documentation in a single markdown file
22    SinglePage,
23}
24
25/// Configuration for documentation generation.
26#[derive(Debug, Clone)]
27pub struct DocConfig {
28    /// Input path (directory or single file)
29    pub input: PathBuf,
30    /// Output directory for markdown files (or single file path for SinglePage mode)
31    pub output: PathBuf,
32    /// Base URL for cross-type links (e.g., "/docs/types")
33    pub base_url: Option<String>,
34    /// Output format
35    pub format: OutputFormat,
36    /// Output mode (multi-page or single-page)
37    pub output_mode: OutputMode,
38    /// Maximum depth for TypeRef expansion in examples
39    pub example_depth: usize,
40    /// Whether to generate index files
41    pub generate_index: bool,
42}