Skip to main content

markdown-gettext

A command line program to do i18n and l10n for individual Markdown files.

CommonMark compliant. All core Markdown elements are supported, as well as YAML front matter, table, and definition list.

Install

pip install markdown-gettext

Usage

You can use either md-gettext or markdown-gettext command

Extraction

md-gettext extract [-p PACKAGE] [-r REPORT_ADDR] [-t TEAM_ADDR] md pot

positional arguments:
  md                    path of the Markdown file to extract messages from
  pot                   path of the POT file to create

optional arguments:
  -p PACKAGE, --package PACKAGE
                        the package name in POT metadata
  -r REPORT_ADDR, --report-addr REPORT_ADDR
                        the report address in POT metadata
  -t TEAM_ADDR, --team-addr TEAM_ADDR
                        the team address in POT metadata

Generation

md-gettext generate [-l LANG] in-md po out-md

positional arguments:
  in-md                 path of the source Markdown file
  po                    path of the PO file containing translations
  out-md                path of the Markdown file to create

optional arguments:
  -l LANG, --lang LANG  language of translations

Notes

Some notes about how different elements are handled:

  • Inlines: hard line breaks are replaced with <br />, newlines and consecutive spaces are not kept;
  • Content of each HTML block isn't parsed into finer tokens but processed as a whole;

Development environment

  • With Conda
conda env create -f environment.yml
conda activate mg
poetry install

Metadata

Release files for markdown-gettext 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for markdown-gettext 0.2.2
File Size Uploaded
markdown_gettext-0.2.2.tar.gz 20.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for markdown-gettext 0.2.2
File Interpreter ABI Platform
markdown_gettext-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 45.2 kB

Release files / markdown_gettext-0.2.2.tar.gz

Download URL markdown_gettext-0.2.2.tar.gz
Size 20.6 kB
Tags Source
SHA-256 checksum
How to use checksums
558b4c9b863e373eeb9872b64e2cd7ab40db57a0d8b9c9e93f46412bb2e601dd
BLAKE2b-256 checksum
How to use checksums
a5a121dd7fd711f5ea285a627c21a1c2d353652a843537b1080b207a22d3d139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.8 Darwin/25.1.0

Release files / markdown_gettext-0.2.2-py3-none-any.whl

Download URL markdown_gettext-0.2.2-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
178d687d600ae48e3fab7ecf3d2dfaf0d26bdef2f15c6f51f7c08be92796fc68
BLAKE2b-256 checksum
How to use checksums
ee5d676d0aa1866f8780d26bde94e96031913ec148f2cac353c2301b959bc95c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.11.8 Darwin/25.1.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page