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

make_name needs a stable output variant #301

Open
jace opened this issue Apr 19, 2021 · 2 comments
Open

make_name needs a stable output variant #301

jace opened this issue Apr 19, 2021 · 2 comments

Comments

@jace
Copy link
Member

jace commented Apr 19, 2021

The make_name function is used to generate URL slugs in two distinct scenarios:

  1. To generate a nice URL for some content where the exact URL doesn't matter as long as it's nice (can be read, no %xx symbols, etc)
  2. To generate a stable URL representation of a piece of text such as a label or a wiki page name

In the second use case, calling make_name anytime in the future must generate the exact same output as today. The generator spec must be versioned should it need to change for any reason. Third party libraries such as unidecode cannot be used unless they offer the same guarantee. The checkused option should not be available: if two distinct pieces of text generate the same output, then they should be considered the same (for instance, differences in capitalization and optional diacritics for Latin script-based languages).

@jace
Copy link
Member Author

jace commented Apr 19, 2021

Diacritics have semantic meaning in some Latin-script representations such as Pinyin, so it may not be wise to strip them. However, diacritics in English content URLs are an irritation, so there's also a factor of what the use case is, and should be an input parameter (apart from version number) when generating URLs.

@jace
Copy link
Member Author

jace commented Jul 13, 2022

Reference: MediaWiki's approach, where spaces are replaced with underscores but no other transformation occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant