Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case insensitivity in page titles and tags #187

Open
SeanFromIT opened this issue Apr 21, 2020 · 4 comments
Open

Case insensitivity in page titles and tags #187

SeanFromIT opened this issue Apr 21, 2020 · 4 comments
Labels
enhancement Let's make it better!

Comments

@SeanFromIT
Copy link
Contributor

Suggested enhancement: ignore case for tags and titles. It could be a chore to keep tidy for a larger site without this.

@sbrl
Copy link
Owner

sbrl commented Apr 21, 2020

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?

@sbrl sbrl added the enhancement Let's make it better! label Apr 21, 2020
@sbrl sbrl changed the title Case insensitivity Case insensitivity in page titles and tags Apr 21, 2020
@RyanGreenup
Copy link

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).

@sbrl
Copy link
Owner

sbrl commented Jun 5, 2020

@RyanGreenup Yeah, Pepperminty Wiki has a simple resolution algorithm, and whitespace matters:

  1. Try the page name as-is
  2. Try uppercasing the first letter (PHP's ucfirst() function)
  3. 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.

@sbrl
Copy link
Owner

sbrl commented Aug 11, 2020

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.......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Let's make it better!
Projects
None yet
Development

No branches or pull requests

3 participants