implement text/nex renderer

This commit is contained in:
yggverse 2025-06-26 18:02:52 +03:00
parent 02eb8e4a71
commit 337bf32707
7 changed files with 349 additions and 6 deletions

View file

@ -1,4 +1,5 @@
mod gemini;
mod nex;
mod plain;
mod source;
@ -6,6 +7,7 @@ use super::{ItemAction, WindowAction};
use adw::ClampScrollable;
use gemini::Gemini;
use gtk::{ScrolledWindow, TextView, glib::Uri};
use nex::Nex;
use plain::Plain;
use source::Source;
use std::rc::Rc;
@ -58,6 +60,15 @@ impl Text {
}
}
pub fn nex(actions: (&Rc<WindowAction>, &Rc<ItemAction>), base: &Uri, data: &str) -> Self {
let text_view = TextView::nex(actions, base, data);
Self {
scrolled_window: reader(&text_view),
text_view,
meta: Meta { title: None },
}
}
pub fn source(data: &str) -> Self {
let source = sourceview::View::source(data);
Self {