From 2a40fe9beb8bbd44050a0d511a41675095668804 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 2 Jul 2025 20:11:54 -0400 Subject: [PATCH] notes --- src/files.rs | 2 +- src/html.rs | 13 ++++++++++--- src/net.rs | 2 ++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/files.rs b/src/files.rs index bb72081..ff69196 100644 --- a/src/files.rs +++ b/src/files.rs @@ -1,8 +1,8 @@ use std::{fs,io}; use directories::ProjectDirs; +// OS neutral path for application data pub fn get_data_directory() -> std::path::PathBuf { - let dirs = ProjectDirs::from("rocks","gabe","RSSCar").expect("Failed to get paths"); match fs::create_dir(dirs.data_dir()){ Ok(_) => {} diff --git a/src/html.rs b/src/html.rs index 505ba98..8d307fe 100644 --- a/src/html.rs +++ b/src/html.rs @@ -2,13 +2,20 @@ use html2md; use regex::Regex; +/* + Content needs to be processed in chunks. + Separate out content into blocks that can be used by the UI framework + p -> text + a -> link (does this exist?) + img - > image widget + + and so on... +*/ + /* this works, but... - images are omitted - Blockquotes don't display - - */ - pub fn process(content: String) -> String { let re = Regex::new(r"(?s)]*>.*?").unwrap(); let cleaned = re.replace_all(&content,""); diff --git a/src/net.rs b/src/net.rs index 42f9c70..fa20a1f 100644 --- a/src/net.rs +++ b/src/net.rs @@ -4,6 +4,8 @@ use iced::widget::image::Handle; use rss::{Channel}; use reqwest::{self, blocking::Client, header::USER_AGENT}; +// needs to support loading over various schemes (such as Tor & I2P) ideally based on the URL but DB may have to store scheme.... + pub fn load_rss(url: &str) -> Option{ let client = Client::new(); let res = client.get(url)