- dharma-translation → translation: stripped conventions, kept only technique - Deleted mpi-project-conventions: all content now in AGENTS.md - References moved: meditation-translation, markdown-to-djot → translation/ translation-pitfalls, proofreading-patterns → translation-review/ - Updated AGENTS.md, readme.dj, memory, pdf skill cross-reference - 7 skills → 6 skills
1.4 KiB
1.4 KiB
Markdown to Djot Conversion
When source material arrives as .docx.md (pandoc-converted from docx), convert to .dj for translation workflows.
Splitting combined articles
If a single markdown file contains multiple articles (common when docx has two talks in one file), split at the article boundary before converting. Use sed by line number:
sed -n '1,218p' combined.md > a1.md
sed -n '220,282p' combined.md > a2.md
Heading anchor cleanup
Pandoc's docx→md conversion adds {#heading-id} anchors to every heading:
## 1.安宁疗护 {#1.安宁疗护}
These must be stripped before markdown→djot conversion, otherwise pandoc's djot writer leaves stray {#...} lines in the output:
sed 's/ {#[^}]*}//g' input.md > clean.md
Conversion command
pandoc clean.md -f markdown -t djot --wrap=none -o output.dj
--wrap=none prevents reflow of long paragraphs.
Post-conversion cleanup
Pandoc may still leave stray {#...} lines in djot output. Remove them:
sed -i '/^{#.*}$/d' output.dj
Pandoc artifacts
- Unicode
——(U+2014 × 2) →------in djot (two em dashes,---each). This is correct djot syntax. - Markdown hard line breaks (trailing
) →\\\nin djot. Preserves original paragraph structure. - Pandoc normalizes heading IDs (strips
、and other punctuation). Ignore; the stray-line cleanup handles it.