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

Page name case gets changed between Create page and Editor #61

Closed
bverkron opened this issue Dec 7, 2023 · 4 comments
Closed

Page name case gets changed between Create page and Editor #61

bverkron opened this issue Dec 7, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bverkron
Copy link

bverkron commented Dec 7, 2023

If I enter a title like "NAS Setup" on the Create page and click "Create and open in editor" the title gets changed to "Nas Setup", which is incorrect case because it's an acronym and should remain all upper case.

I assume this is because the somethings is trying to give what is seen as "proper" case to the page title but IMO it should not be making this decision for the users. As seen above there are cases where the title may have acronyms or for other reasons the user does not want Pascal Case for the title.

@redimp
Copy link
Owner

redimp commented Dec 8, 2023

Thanks for the feedback!

It wasn't the best design decision to captialize page names by default. I'm thinking about the options. Currently the wiki safes all pages in lowercase and displays the Names as capitalized.

e.g. creating NAS Setup will be stored as nas setup.md and can be opened via /NAS Setup and /nas setup and /NaS seTuP, resp. [[NAS Setup]], [[nas setup]] or [[NaS seTuP]]. All links will open the same page.

In the page index "A-Z" the page will always be displayed as capitalized, e.g. Nas Setup

What would be a better handling?

Option 1) Store pages with the exact Upper and lower case letters they were created. Display the pages like this in the page index and in the breadcrumps. Problem: All pages created before the patch will be in lowercase.

Option 2) Store pages with the exact Upper and lower case letters they were created. Display pages in all lowercase capitalized, except if there is at least one Uppercase letter in the filename. Works for pages created before the patch. Problem: A page will never be displayed as all lowercase.

I will think about other options. I'm happy about remarks and ideas.

@bverkron
Copy link
Author

bverkron commented Dec 8, 2023

These are some of the challenges that come along with not having place to store additional metadata, like a database. Don't get me wrong I love that there is no DB (at least not for the page content) but it does pose design challenges like this.

Option 2 sounds like a decent middle ground of now. Is the "A page will never be displayed as all lowercase" part actually a problem since that's how it already functions? i.e. files are currently stored in all lower case and will be capitalized in the UI thus they will already never appear in lower case in the UI so this is not a breaking change.

I do worry that relying entirely in filenames and semi-complex logic and rules like this may make things harder to maintain and more fragile long term. Speaking from experience doing similar things myself in the past.

Are you open to having an index file for some light metadata? Perhaps sqlite or something even lighter that can be used to correlate page titles to the files themselves? I suppose that could add other challenges like what happens if .md files are added to the filesystem outside of the UI. You could need a feature to force a re-indexing or perhaps you watch for changes to the directory and automatically reindex when files are changed outside of Otter?

Just spitballing. Not 100% sure what the right answer is or what aligns or doesn't align with your design philosophy. I do very must like the "less is more" approach and would hate to see an actual database be used. IMO users / admins should be able to move the .md files in / out of the filesystem at will without it breaking anything and automatically 'consuming' them in the UI without extra steps.

@redimp
Copy link
Owner

redimp commented Dec 10, 2023

I got an idea that might be Option 3: Use the first header of the .md file to decide on how the page name is spelled. e.g nas setup.md with

# NAS Setup
...

will be displated as NAS Setup and nas setup.md with

# NAS SeTuP
...

will be displated as NAS SeTuP.

@redimp redimp self-assigned this Dec 30, 2023
@redimp redimp added the bug Something isn't working label Dec 30, 2023
@redimp
Copy link
Owner

redimp commented Dec 30, 2023

Option 3 has been implemented in 2.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants