Pepperminty-Wiki
Pepperminty-Wiki copied to clipboard
Case insensitivity in page titles and tags
Suggested enhancement: ignore case for tags and titles. It could be a chore to keep tidy for a larger site without this.
Ooh, that would be really nice actually. The problem is though we'd then have to store the page title and tags in both their case-insensitive format (for referencing), and case-sensitive format (for displaying) - which I'm pretty sure would be complicated undertaking under-the-hood - 'cause page names are displayed in lots of different places - so we'd have to update all of them to instead of using $env->page
to use something like $pageindex->$page->title
.
Tags would be easier, since we can store them as a list of objects or arrays instead of a list of strings.
[
{ "display": "Tag name", "sort": "tag name" },
// ......
]
Though thinking about it, how would we determine the "canonical" casing for a tag to display?
Semi-related to this, in vimwiki
you can follow [[links]]
made from pepperminty, but you have to make sure that the first letter of the link is always capitalised because on linux file names are case sensitive (and I don't know how it deals with whitespace).
@RyanGreenup Yeah, Pepperminty Wiki has a simple resolution algorithm, and whitespace matters:
- Try the page name as-is
- Try uppercasing the first letter (PHP's
ucfirst()
function) - Try uppercasing the first letter of each word (PHP's
ucwords()
function)
Specifically, the current algorithm is implemented here: https://github.com/sbrl/Pepperminty-Wiki/blob/79ddc23/modules/parser-parsedown.php#L444-L464
It sounds like vimwiki
doesn't currently support that page name resolution.
Additional steps to this process that would resolve more page names in the mean time are welcome.
Oh, I've just thought of something. Since Pepperminty Wiki is currently case-sensitive, migrating to non-case-sensitive page names has the potential to break existing wikis - should one have 2 different pages with the same name but different casings.
We'd also need to handle migration too, which isn't as simple as it sounds either - because Pepperminty Wiki doesn't yet have a migration system in place. Currently Pepperminty Wiki upgrades things dynamically as it encounters them, but that doesn't really work with upgrading the page index structure.
Hmmmmmmm.......