Skip to content

Commit 697a268

Browse files
committed
Update build_publications.py
1 parent 93286e8 commit 697a268

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

tools/build_publications.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,22 @@ def entry_to_html(e):
8787

8888
return "<li>" + "".join(parts) + "</li>"
8989

90+
def de_latex(s: str) -> str:
91+
if not s: return ""
92+
# mapping essenziale; aggiungi altri se servono
93+
repl = {
94+
r"{\^\i}": "î", r"\^i": "î",
95+
r"\'a": "á", r"\'e": "é", r"\'i": "í", r"\'o": "ó", r"\'u": "ú",
96+
r"\'A": "Á", r"\'E": "É", r"\'I": "Í", r"\'O": "Ó", r"\'U": "Ú",
97+
r"\"a": "ä", r"\"e": "ë", r"\"i": "ï", r"\"o": "ö", r"\"u": "ü",
98+
r"\`a": "à", r"\`e": "è", r"\`i": "ì", r"\`o": "ò", r"\`u": "ù",
99+
r"\~n": "ñ", r"\c{c}": "ç",
100+
r"\&": "&"
101+
}
102+
for k, v in repl.items():
103+
s = s.replace(k, v)
104+
return s
105+
90106
def render_page(grouped, years_sorted):
91107
# Se esiste un template, usa {{TITLE}} e {{LIST}}
92108
content = []

0 commit comments

Comments
 (0)