Files
tinyblocks/docs/ferramentas/ascii_docs.py
T
mguinhosandClaude Opus 5.5 34c9a39c2c Documentação do sistema em docs/
Arquitetura, polimorfismo em C, tipos e regras de posse, sistema de
libraries (plugins), editor (VM, compilador, Meus Blocos, projeto, hot
reload, acessibilidade, MCP), build e testes, pendências encontradas,
catálogo de blocos e referência de todos os métodos dos headers, gerados
por ferramentas em docs/ferramentas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 22:37:40 -03:00

30 lines
1.2 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Deixa os .md so com ASCII e letras acentuadas do portugues.
Troca os simbolos conhecidos e lista o que sobrar (arquivo:linha)."""
import sys, re
MAP = {
"─": "-", "━": "-", "│": "|", "┃": "|",
"┌": "+", "┐": "+", "└": "+", "┘": "+", "├": "+", "┤": "+",
"┬": "+", "┴": "+", "┼": "+",
"▶": ">", "►": ">", "→": "->", "←": "<-", "↔": "<->", "⇒": "=>",
"—": "-", "–": "-", "…": "...", "“": '"', "”": '"', "‘": "'", "’": "'",
"×": "x", "÷": "/", "≈": "~", "≤": "<=", "≥": ">=", "≠": "!=",
"•": "-", "·": "-", "✓": "ok", "⋮": ":", "²": "^2", "°": " graus",
" ": " ",
}
# letras permitidas fora do ASCII (acentuacao do portugues e afins)
OK = set("áàâãäéèêëíìîïóòôõöúùûüçñÁÀÂÃÄÉÈÊËÍÌÎÏÓÒÔÕÖÚÙÛÜÇÑ")
bad = 0
for path in sys.argv[1:]:
s = open(path, encoding="utf-8").read()
for k, v in MAP.items():
s = s.replace(k, v)
open(path, "w", encoding="utf-8").write(s)
for n, line in enumerate(s.split("\n"), 1):
rest = [c for c in line if ord(c) > 127 and c not in OK]
if rest:
bad += 1
print("%s:%d: %r" % (path, n, "".join(sorted(set(rest)))))
print("restantes:", bad)