7d2f56a364
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
39 lines
961 B
Rust
39 lines
961 B
Rust
mod core;
|
|
mod domain;
|
|
mod infrastructure;
|
|
mod watcher;
|
|
|
|
use std::sync::Mutex;
|
|
|
|
#[tauri::command]
|
|
fn render_markdown(content: String) -> String {
|
|
core::render_markdown(content)
|
|
}
|
|
|
|
#[tauri::command]
|
|
fn convert_file(path: String) -> Result<String, String> {
|
|
core::convert_file(path)
|
|
}
|
|
|
|
#[tauri::command]
|
|
fn list_md_files(dir: String) -> Result<Vec<String>, String> {
|
|
core::list_md_files(dir)
|
|
}
|
|
|
|
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
|
pub fn run() {
|
|
tauri::Builder::default()
|
|
.plugin(tauri_plugin_fs::init())
|
|
.plugin(tauri_plugin_dialog::init())
|
|
.manage(watcher::WatcherState(Mutex::new(None)))
|
|
.invoke_handler(tauri::generate_handler![
|
|
render_markdown,
|
|
convert_file,
|
|
list_md_files,
|
|
watcher::start_watch,
|
|
watcher::stop_watch,
|
|
])
|
|
.run(tauri::generate_context!())
|
|
.expect("Erreur lors du démarrage de l'application Tauri");
|
|
}
|