feat: module domain avec trait MarkdownRenderer et RenderOptions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
#[allow(dead_code)]
|
||||||
|
pub trait MarkdownRenderer: Send + Sync {
|
||||||
|
fn render(&self, content: &str) -> String;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default)]
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub struct RenderOptions {
|
||||||
|
pub tables: bool,
|
||||||
|
pub strikethrough: bool,
|
||||||
|
pub autolink: bool,
|
||||||
|
pub tasklist: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn render_options_default_all_false() {
|
||||||
|
let opts = RenderOptions::default();
|
||||||
|
assert!(!opts.tables);
|
||||||
|
assert!(!opts.strikethrough);
|
||||||
|
assert!(!opts.autolink);
|
||||||
|
assert!(!opts.tasklist);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
mod markdown;
|
||||||
|
|
||||||
|
#[allow(unused_imports)]
|
||||||
|
pub use markdown::{MarkdownRenderer, RenderOptions};
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
mod core;
|
mod core;
|
||||||
|
mod domain;
|
||||||
mod watcher;
|
mod watcher;
|
||||||
|
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|||||||
Reference in New Issue
Block a user