mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
implement text/nex renderer
This commit is contained in:
parent
02eb8e4a71
commit
337bf32707
7 changed files with 349 additions and 6 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue