translate, done with 众生都是既然众生 and 佛教徒的人生态度

This commit is contained in:
iacore
2026-06-15 17:03:59 +08:00
parent 5c87509dcc
commit c9cbf1c2fe
24 changed files with 2873 additions and 191 deletions
@@ -0,0 +1,48 @@
# 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:
```bash
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:
```markdown
## 1.安宁疗护 {#1.安宁疗护}
```
These must be stripped before markdown→djot conversion, otherwise pandoc's djot writer leaves stray `{#...}` lines in the output:
```bash
sed 's/ {#[^}]*}//g' input.md > clean.md
```
## Conversion command
```bash
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:
```bash
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 ` `) → `\\\n` in djot. Preserves original paragraph structure.
- Pandoc normalizes heading IDs (strips `、` and other punctuation). Ignore; the stray-line cleanup handles it.