This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Provide a class that converts Markdown links to wikilinks. | |
Copyright (c) 2025 Peter Triesberger | |
For further information see https://github.com/peter88213 | |
License: GNU GPLv3 (https://www.gnu.org/licenses/gpl-3.0.en.html) | |
""" | |
class MdLinkParser: | |
"""Parser implementing a state machine for Markdown link conversion.""" | |
BODY = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |