stadust / pointercrate

Rewrite of the https://pointercrate.com backend in Rust
MIT License
78 stars 50 forks source link

Remove Clan tags from Level page and level info #78

Open vulcanium4 opened 1 year ago

vulcanium4 commented 1 year ago

Remove the Clan [Tags] from the level page and level information to make the reading flow better. They'd remain everywhere else though.

stadust commented 1 year ago

The code that generates level titles is here: https://github.com/stadust/pointercrate/blob/d63f42e5be36f91b7a6fe44968033189f5cb7ef9/pointercrate-demonlist/src/demon/mod.rs#L121-L166 (why not in pointercrate-demonlist-pages? good question) a quick hack would be to implement some sort of "un-clan name" function and run all player names through that before formatting, e.g.

fn declan(name: &str) -> str {
   if !name.startswith('[') {
        return name
   }
   match name.rsplit(']').next() {
        Some(decland) => decland,
        None => name 
   }
}

might have to play around a bit with what heuristic for recognizing the clan name works best