Encoding accented characters for readable URL path
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- developer-experience, documentation
Research direction
Read the Verso literate-programming documentation for the url module setting and inspect the example Goedel1.lean module declaration. Trace how titles and configured URLs become path components, then determine whether authors can manually override the slug. Done means the URL-generation behavior and configuration path are clear, with the relevant documentation or source location identified.
Written by the indexing model from the issue text.
Description
This is only an idea/suggestion that came to mind.
There is a website at FormalizedFormalLogic/Catalogue (source) that uses verso and one of the pages has the following link.
https://formalizedformallogic.org/Catalogue/Arithmetic/G___del___s-First-Incompleteness-Theorem/
The page title is Gödel's First Incompleteness Theorem.
I thought it'd be more user-friendly if that accented character ö was converted to oe instead, for the link to have a human-readable path.
Goedel___s-First-Incompleteness-Theorem
Perhaps there are too many language variations for how these special characters can be converted and pronounced. There is no standard algorithm/table for normalizing them, I suppose.
ICAO Doc 9303, which governs machine-readable travel documents like passports. Because passports must use a limited set of Latin characters, ICAO (International Civil Aviation Organization) defines a standard way to transliterate accented characters.
For German, this follows the convention of replacing umlauts with their corresponding vowel-e combinations.
Right, the rules are specific to each language, that makes sense.
Maybe it's possible to provide the author/user with a way to define the page "slug" manually, to override the default automatic encoding. Seems this feature may already exist.
https://verso.lean-lang.org/doc/latest/Literate-Programming/#literate-per-module
[modules."MyLib.Core.Basic"]
title = "Getting Started"
url = "getting-started"
A similar section in the source of the example site:
#doc (Manual) "Gödel's First Incompleteness Theorem" =>
%%%
tag := "goedel-1"
%%%
A related idea is to use URL-component encoding like %20.
https://en.wikipedia.org/wiki/Percent-encoding
Then the example path would become:
G%C3%B6del's-First-Incompleteness-Theorem
That's not any better or aesthetic than using _ (underscore), other than it's a more common way to encode the page title.
An advantage could be, when saving the link as a bookmark, or exporting the page as PDF file. Though I think the browser uses the <title> tag in the HTML document for that, not from the URL.
Edit: Found a related issue:
- #960
And the current logic to slugify page titles.
- Dominant language
- Lean
- Stars
- 420
- Forks
- 134
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 46
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from leanprover/verso
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
leanprover/verso#972 ·
Maintainers usually reply within 1 day
-
`"&"` in docstring of `Html.text` is not rendered literallyMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 82/100
leanprover/verso#898 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
leanprover/verso#1133 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
leanprover/verso#1125 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 55/100
leanprover/verso#1107 ·
Maintainers usually reply within 1 day
All issues in leanprover/verso
Similar issues
-
area: middleware enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rohitgollarahalli/mcpx#45 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
facebookresearch/atlas-lean#20218 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100