Guidelines for maintaining the kanji index feature. Covers kanji ID assignment, index updates, and troubleshooting.
The kanji index allows users to click on any kanji in a dictionary headword to find all other entries containing that same kanji.
kanji/
├── kanji_list.json # Master list: kanji → kanji_id mapping
├── kanji_extracted.json # Temporary: extracted kanji needing IDs
├── 00001_jin_hito_person.json # Entry list for 人
├── 00002_nichi_hi_day.json # Entry list for 日
└── ...
docs/kanji/
├── 00001_jin_hito_person.html # HTML page for 人
├── 00002_nichi_hi_day.html # HTML page for 日
└── ...
Format: {5-digit}_{onyomi}_{kunyomi}_{gloss}
| Kanji | Kanji ID |
|---|---|
| 人 | 00001_jin_hito_person |
| 日 | 00002_nichi_hi_day |
| 大 | 00003_dai_oo_big |
| 畑 | 00004_none_hatake_field |
| 茶 | 00005_cha_none_tea |
When new entries introduce kanji not in kanji_list.json:
Detect new kanji:
python3 build/update_kanji_index.py --check-new
Assign readings and gloss using your knowledge:
Update kanji_list.json:
{
"新": {
"kanji_id": "00123_shin_atara_new",
"onyomi": "shin",
"kunyomi": "atara",
"gloss": "new"
}
}
Rebuild:
python3 build/build_flat.py
python3 build/update_kanji_index.py --check-new
python3 build/update_kanji_index.py --rebuild-all
python3 build/build_kanji_html.py
python3 build/build_flat.py
New kanji were found in entries. Assign IDs manually:
--check-new to see the full listkanji/kanji_list.jsonCheck that:
kanji/kanji_list.jsonkanji/{kanji_id}.jsonpython3 build/build_kanji_html.pyCheck that:
kanji/kanji_list.jsonRebuild the kanji JSON file:
python3 build/update_kanji_index.py --rebuild-all
python3 build/build_kanji_html.py
{
"metadata": {
"description": "Index mapping kanji characters to their kanji index IDs",
"generated": "2026-01-22T10:30:00Z",
"total_kanji": 1500
},
"kanji": {
"人": {
"kanji_id": "00001_jin_hito_person",
"onyomi": "jin",
"kunyomi": "hito",
"gloss": "person"
}
}
}
{
"metadata": {
"kanji": "人",
"kanji_id": "00001_jin_hito_person",
"onyomi": "jin",
"kunyomi": "hito",
"gloss": "person",
"entry_count": 245,
"generated": "2026-01-22T10:30:00Z"
},
"entries": [
{
"id": "01234_akunin",
"headword": "{悪|あく}{人|にん}",
"reading": "あくにん",
"gloss": "villain, bad person"
}
]
}