Improve tooling
This commit is contained in:
parent
458352da97
commit
3165d050a1
3 changed files with 24 additions and 16 deletions
|
|
@ -3,9 +3,9 @@ from pathlib import Path
|
|||
|
||||
REPLACEMENTS = {
|
||||
" :": " :",
|
||||
" ;": " :",
|
||||
" !": " :",
|
||||
" ?": " :",
|
||||
" ;": " ;",
|
||||
" !": " !:",
|
||||
" ?": " ?",
|
||||
"'": "’",
|
||||
}
|
||||
|
||||
|
|
@ -15,9 +15,8 @@ args = parser.parse_args()
|
|||
|
||||
file = Path(f"./content/newsletter/craft-letter-{args.number}.md")
|
||||
|
||||
with open(file) as f:
|
||||
content = f.read()
|
||||
for value, replacement in REPLACEMENTS.items():
|
||||
content = content.replace(value, replacement)
|
||||
content = file.read_text()
|
||||
for value, replacement in REPLACEMENTS.items():
|
||||
content = content.replace(value, replacement)
|
||||
|
||||
file.write_text(content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue