This commit is contained in:
2025-04-09 07:11:38 +02:00
parent b93894632a
commit 5e4dcbf77c
37 changed files with 2450 additions and 8 deletions

View File

@@ -1,14 +1,41 @@
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
//! DocTree is a library for managing collections of markdown documents.
//!
//! It provides functionality for scanning directories, managing collections,
//! and processing includes between documents.
// Import lazy_static
#[macro_use]
extern crate lazy_static;
mod error;
mod storage;
mod utils;
mod collection;
mod doctree;
mod include;
pub use error::{DocTreeError, Result};
pub use storage::RedisStorage;
pub use collection::{Collection, CollectionBuilder};
pub use doctree::{DocTree, DocTreeBuilder, new};
pub use include::process_includes;
#[cfg(test)]
mod tests {
use super::*;
use std::path::Path;
#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
fn test_doctree_builder() {
// Create a storage instance
let storage = RedisStorage::new("dummy_url").unwrap();
let doctree = DocTree::builder()
.with_storage(storage)
.build()
.unwrap();
assert_eq!(doctree.collections.len(), 0);
assert_eq!(doctree.default_collection, None);
}
}