Skip to content

Instantly share code, notes, and snippets.

@peter88213
peter88213 / md_link_parser.py
Last active February 19, 2025 18:56
A class that converts Markdown links to wikilinks
@peter88213
peter88213 / ts_json.py
Created December 31, 2024 10:58
Convert a .ts XML translation file to JSON
"""Convert a .ts XML translation file.
Output:
- a JSON file (extension ".json")
Usage:
ts_json.py sourcefile
Copyright (c) 2024 Peter Triesberger
For further information see https://github.com/peter88213/
@peter88213
peter88213 / ts_txt.py
Last active December 31, 2024 10:57
Create a sorted plain text dictionary from a .ts XML translation file.
"""Convert a .ts XML translation file.
Output:
- a plain text file with Markdown context headings (extension ".md")
Usage:
ts_txt.py sourcefile
Copyright (c) 2024 Peter Triesberger
For further information see https://github.com/peter88213/
@peter88213
peter88213 / docx_tinker1.py
Created June 12, 2023 15:54
Change the shades of table cells in a docx 'document.xml' component.
import xml.etree.ElementTree as ET
ns = dict(
ve="http://schemas.openxmlformats.org/markup-compatibility/2006",
o="urn:schemas-microsoft-com:office:office",
r="http://schemas.openxmlformats.org/officeDocument/2006/relationships",
m="http://schemas.openxmlformats.org/officeDocument/2006/math",
v="urn:schemas-microsoft-com:vml",
wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",
w10="urn:schemas-microsoft-com:office:word",