Skip to main content

ox_content_docs/
config.rs

1//! Configuration for documentation generation.
2
3use serde::{Deserialize, Serialize};
4
5/// Configuration for documentation generation.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct DocsConfig {
8    /// Source directories to scan.
9    pub src_dirs: Vec<String>,
10
11    /// Output directory.
12    pub out_dir: String,
13
14    /// File patterns to include.
15    pub include: Vec<String>,
16
17    /// File patterns to exclude.
18    pub exclude: Vec<String>,
19
20    /// Whether to generate JSON output.
21    pub json: bool,
22
23    /// Whether to include private items.
24    pub document_private: bool,
25
26    /// Theme for the generated docs.
27    pub theme: Option<String>,
28}
29
30impl Default for DocsConfig {
31    fn default() -> Self {
32        Self {
33            src_dirs: vec!["src".to_string()],
34            out_dir: "docs".to_string(),
35            include: vec![
36                "**/*.ts".to_string(),
37                "**/*.tsx".to_string(),
38                "**/*.js".to_string(),
39                "**/*.jsx".to_string(),
40            ],
41            exclude: vec![
42                "**/node_modules/**".to_string(),
43                "**/dist/**".to_string(),
44                "**/*.test.*".to_string(),
45                "**/*.spec.*".to_string(),
46            ],
47            json: false,
48            document_private: false,
49            theme: None,
50        }
51    }
52}