mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
* Add Bootstrap Extension * Rename main.yml * Artifact Upload * Fix Bootstrap Reference Error * BootstrapTreeProcessor * getiterator removed * keys function * Style Images * Update docs_build.yml * Added Meta Files * Template Get * Fix Page Ref * Update BASE_URL * Sort Schemas * Add Sitemaps * Add favicons, open-graph, and setup guide * Update Setup.md * Update .gitignore * Update Setup.md * Use _blank on external links * Restructured Docs * Fix Links * Added XML Schemas * Name XML Schemas
20 lines
438 B
Python
20 lines
438 B
Python
import re
|
|
|
|
|
|
def camel_to_pretty(raw):
|
|
return ' '.join(re.findall(r'[A-Z](?:[a-z]+|[A-Z]*(?=[A-Z]|$))', raw))
|
|
|
|
|
|
def pretty_title(raw: str) -> str:
|
|
if '_' in raw:
|
|
return ' '.join(x[0].upper() + x[1:] for x in raw.split('_'))
|
|
elif any(x.isupper() for x in raw):
|
|
if raw[0].islower():
|
|
new_raw = raw[0].upper() + raw[1:]
|
|
else:
|
|
new_raw = raw
|
|
return camel_to_pretty(new_raw)
|
|
|
|
|
|
|