add a tagging system to the website

This commit is contained in:
りき萌 2025-08-24 13:18:51 +02:00
parent 701da6bc4b
commit e1b6578b2a
97 changed files with 1025 additions and 979 deletions

View file

@ -9,6 +9,7 @@ use tracing::instrument;
use ulid::Ulid;
use crate::{
doc::Doc,
tree::{SemaBranchId, SemaRoots, SemaTree},
vfs::{VPath, VPathBuf},
};
@ -63,17 +64,24 @@ impl File {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct FileId(usize);
#[derive(Debug, Clone, Default)]
pub struct Tag {
pub files: Vec<FileId>,
}
/// Treehouse compilation context.
pub struct Treehouse {
pub files: Vec<File>,
pub files_by_tree_path: HashMap<VPathBuf, FileId>, // trees only
pub files_by_doc_path: HashMap<VPathBuf, FileId>, // docs only
pub feeds_by_name: HashMap<String, FileId>,
pub tags: HashMap<String, Tag>,
pub tree: SemaTree,
pub branches_by_named_id: HashMap<String, SemaBranchId>,
pub roots: HashMap<FileId, SemaRoots>,
pub docs: HashMap<FileId, Doc>,
pub branch_redirects: HashMap<String, SemaBranchId>,
pub missingno_generator: ulid::Generator,
@ -85,12 +93,14 @@ impl Treehouse {
files: vec![],
files_by_tree_path: HashMap::new(),
files_by_doc_path: HashMap::new(),
feeds_by_name: HashMap::new(),
tags: HashMap::new(),
tree: SemaTree::default(),
branches_by_named_id: HashMap::new(),
roots: HashMap::new(),
docs: HashMap::new(),
branch_redirects: HashMap::new(),
missingno_generator: ulid::Generator::new(),