skills: update skills
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Bilingual DJ Format
|
||||
|
||||
## Layout
|
||||
|
||||
Each pair: source line immediately followed by target line. Blank line separates pairs.
|
||||
|
||||
```
|
||||
source-line
|
||||
target-line
|
||||
|
||||
source-line
|
||||
target-line
|
||||
```
|
||||
|
||||
NOT:
|
||||
```
|
||||
source-line
|
||||
← WRONG: extra blank between source and target
|
||||
target-line
|
||||
```
|
||||
|
||||
## Creating initial bilingual from source only
|
||||
|
||||
Every source line gets an empty target placeholder + blank separator:
|
||||
|
||||
```
|
||||
source-A
|
||||
|
||||
source-B
|
||||
```
|
||||
|
||||
(2 blank lines between consecutive source lines: empty target + separator.)
|
||||
|
||||
## Verification
|
||||
|
||||
Source line count × 3 − 1 = bilingual line count (before trailing newline strip).
|
||||
@@ -11,6 +11,23 @@ sed -n '1,218p' combined.md > a1.md
|
||||
sed -n '220,282p' combined.md > a2.md
|
||||
```
|
||||
|
||||
## TOC stripping
|
||||
|
||||
Pandoc docx→md produces a markdown TOC with tab-separated page numbers:
|
||||
|
||||
```markdown
|
||||
[一、对佛教的感悟\t1](#一、对佛教的感悟)
|
||||
[二、佛教与人类文明\t5](#二、佛教与人类文明)
|
||||
```
|
||||
|
||||
Strip before conversion:
|
||||
|
||||
```bash
|
||||
sed -i '/^\[.*\t.*\](#.*)$/d' input.md
|
||||
```
|
||||
|
||||
Or in Python: skip lines matching `line.startswith("[") and "\t" in line and "](#" in line`.
|
||||
|
||||
## Heading anchor cleanup
|
||||
|
||||
Pandoc's docx→md conversion adds `{#heading-id}` anchors to every heading:
|
||||
|
||||
Reference in New Issue
Block a user