aboutsummaryrefslogtreecommitdiff
path: root/ui/src/lib.rs
blob: 4298623b4b78eb318a4b55cce2209ece0994e624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use markup::DynRender;

/*
    This file is part of jellything (https://codeberg.org/metamuffin/jellything)
    which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
    Copyright (C) 2025 metamuffin <metamuffin.org>
*/
pub mod filter_sort;
pub mod format;
pub mod home;
pub mod locale;
pub mod node_card;
pub mod node_page;
pub mod props;
pub mod scaffold;
pub mod search;
pub mod settings;
pub mod stats;

/// render as supertrait would be possible but is not
/// dyn compatible and I really dont want to expose generics
/// that generate rendering code because of compile speed.
pub trait Page {
    fn title(&self) -> String;
    fn to_render(&self) -> DynRender;
    fn class(&self) -> Option<&'static str> {
        None
    }
}

pub fn render_page(page: &dyn Page) -> String {
    // page.render()
    "a".to_string()
}