diff --git a/.github/workflows/mdformat.yml b/.github/workflows/mdformat.yml index 08861d904..a6a19d512 100644 --- a/.github/workflows/mdformat.yml +++ b/.github/workflows/mdformat.yml @@ -28,7 +28,7 @@ jobs: python -m pip install mdformat==0.7.18 - name: Format .md files run: | - find . -name '*.md' | xargs mdformat + find . -name '*.md' | grep -v '/__' | xargs mdformat - name: Check for changes run: | CHANGES=$(git diff --name-only HEAD --) diff --git a/doc/p/__index__.md b/doc/p/__index__.md index 9828db61c..7dba872e6 100644 --- a/doc/p/__index__.md +++ b/doc/p/__index__.md @@ -1,50 +1,50 @@ -| Description | Name | Doc Link | -| ------------------------------ | ----------------- | -------------------------------------------------- | -| Aard 2 (.slob) | Aard2Slob | [aard2_slob.md](./aard2_slob.md) | -| ABC Medical Notes (SQLite3) | ABCMedicalNotes | [abc_medical_notes.md](./abc_medical_notes.md) | -| Almaany.com (SQLite3) | Almaany | [almaany.md](./almaany.md) | -| AppleDict Source | AppleDict | [appledict.md](./appledict.md) | -| AppleDict Binary | AppleDictBin | [appledict_bin.md](./appledict_bin.md) | -| AyanDict SQLite | AyanDictSQLite | [ayandict_sqlite.md](./ayandict_sqlite.md) | -| Babylon (.BGL) | BabylonBgl | [babylon_bgl.md](./babylon_bgl.md) | -| cc-kedict | cc-kedict | [cc_kedict.md](./cc_kedict.md) | -| Crawler Directory | CrawlerDir | [crawler_dir.md](./crawler_dir.md) | -| CSV (.csv) | Csv | [csv.md](./csv.md) | -| DictionaryForMIDs | Dicformids | [dicformids.md](./dicformids.md) | -| Dict.cc (SQLite3) | Dictcc | [dict_cc.md](./dict_cc.md) | -| Dict.cc (SQLite3) - Split | Dictcc_split | [dict_cc_split.md](./dict_cc_split.md) | -| DICT.org file format (.index) | DictOrg | [dict_org.md](./dict_org.md) | -| DICT.org dictfmt source file | DictOrgSource | [dict_org_source.md](./dict_org_source.md) | -| dictunformat output file | Dictunformat | [dictunformat.md](./dictunformat.md) | -| DigitalNK (SQLite3, N-Korean) | DigitalNK | [digitalnk.md](./digitalnk.md) | -| DIKT JSON (.json) | DiktJson | [dikt_json.md](./dikt_json.md) | -| ABBYY Lingvo DSL (.dsl) | ABBYYLingvoDSL | [dsl.md](./dsl.md) | -| EPUB-2 E-Book | Epub2 | [epub2.md](./epub2.md) | -| Kobo E-Reader Dictionary | Kobo | [kobo.md](./kobo.md) | -| Kobo E-Reader Dictfile (.df) | Dictfile | [kobo_dictfile.md](./kobo_dictfile.md) | -| Mobipocket (.mobi) E-Book | Mobi | [mobi.md](./mobi.md) | -| EDICT2 (CEDICT) (.u8) | EDICT2 | [edict2.md](./edict2.md) | -| EDLIN | Edlin | [edlin.md](./edlin.md) | -| FreeDict (.tei) | FreeDict | [freedict.md](./freedict.md) | -| Gettext Source (.po) | GettextPo | [gettext_po.md](./gettext_po.md) | -| HTML Directory | HtmlDir | [html_dir.md](./html_dir.md) | -| Glossary Info (.info) | Info | [info.md](./info.md) | -| JMDict (xml) | JMDict | [jmdict.md](./jmdict.md) | -| JMnedict | JMnedict | [jmnedict.md](./jmnedict.md) | -| JSON (.json) | Json | [json.md](./json.md) | -| Lingoes Source (.ldf) | LingoesLDF | [lingoes_ldf.md](./lingoes_ldf.md) | -| Octopus MDict (.mdx) | OctopusMdict | [octopus_mdict.md](./octopus_mdict.md) | -| QuickDic version 6 (.quickdic) | QuickDic6 | [quickdic6.md](./quickdic6.md) | -| SQL (.sql) | Sql | [sql.md](./sql.md) | -| StarDict (.ifo) | Stardict | [stardict.md](./stardict.md) | -| StarDict (Merge Syns) | StardictMergeSyns | [stardict_merge_syns.md](./stardict_merge_syns.md) | -| StarDict Textual File (.xml) | StardictTextual | [stardict_textual.md](./stardict_textual.md) | -| Tabfile (.txt, .dic) | Tabfile | [tabfile.md](./tabfile.md) | -| Wiktextract (.jsonl) | Wiktextract | [wiktextract.md](./wiktextract.md) | -| WordNet | Wordnet | [wordnet.md](./wordnet.md) | -| Wordset.org JSON directory | Wordset | [wordset.md](./wordset.md) | -| XDXF (.xdxf) | Xdxf | [xdxf.md](./xdxf.md) | -| XDXF with CSS and JS | XdxfCss | [xdxf_css.md](./xdxf_css.md) | -| XDXF Lax (.xdxf) | XdxfLax | [xdxf_lax.md](./xdxf_lax.md) | -| Yomichan (.zip) | Yomichan | [yomichan.md](./yomichan.md) | -| Zim (.zim, for Kiwix) | Zim | [zim.md](./zim.md) | +| Description | Name | Doc Link | +| ----------- | ---- | -------- | +| Aard 2 (.slob) | Aard2Slob | [aard2_slob.md](./aard2_slob.md) | +| ABC Medical Notes (SQLite3) | ABCMedicalNotes | [abc_medical_notes.md](./abc_medical_notes.md) | +| Almaany.com (SQLite3) | Almaany | [almaany.md](./almaany.md) | +| AppleDict Source | AppleDict | [appledict.md](./appledict.md) | +| AppleDict Binary | AppleDictBin | [appledict_bin.md](./appledict_bin.md) | +| AyanDict SQLite | AyanDictSQLite | [ayandict_sqlite.md](./ayandict_sqlite.md) | +| Babylon (.BGL) | BabylonBgl | [babylon_bgl.md](./babylon_bgl.md) | +| cc-kedict | cc-kedict | [cc_kedict.md](./cc_kedict.md) | +| Crawler Directory | CrawlerDir | [crawler_dir.md](./crawler_dir.md) | +| CSV (.csv) | Csv | [csv.md](./csv.md) | +| DictionaryForMIDs | Dicformids | [dicformids.md](./dicformids.md) | +| Dict.cc (SQLite3) | Dictcc | [dict_cc.md](./dict_cc.md) | +| Dict.cc (SQLite3) - Split | Dictcc_split | [dict_cc_split.md](./dict_cc_split.md) | +| DICT.org file format (.index) | DictOrg | [dict_org.md](./dict_org.md) | +| DICT.org dictfmt source file | DictOrgSource | [dict_org_source.md](./dict_org_source.md) | +| dictunformat output file | Dictunformat | [dictunformat.md](./dictunformat.md) | +| DigitalNK (SQLite3, N-Korean) | DigitalNK | [digitalnk.md](./digitalnk.md) | +| DIKT JSON (.json) | DiktJson | [dikt_json.md](./dikt_json.md) | +| ABBYY Lingvo DSL (.dsl) | ABBYYLingvoDSL | [dsl.md](./dsl.md) | +| EPUB-2 E-Book | Epub2 | [epub2.md](./epub2.md) | +| Kobo E-Reader Dictionary | Kobo | [kobo.md](./kobo.md) | +| Kobo E-Reader Dictfile (.df) | Dictfile | [kobo_dictfile.md](./kobo_dictfile.md) | +| Mobipocket (.mobi) E-Book | Mobi | [mobi.md](./mobi.md) | +| EDICT2 (CEDICT) (.u8) | EDICT2 | [edict2.md](./edict2.md) | +| EDLIN | Edlin | [edlin.md](./edlin.md) | +| FreeDict (.tei) | FreeDict | [freedict.md](./freedict.md) | +| Gettext Source (.po) | GettextPo | [gettext_po.md](./gettext_po.md) | +| HTML Directory | HtmlDir | [html_dir.md](./html_dir.md) | +| Glossary Info (.info) | Info | [info.md](./info.md) | +| JMDict (xml) | JMDict | [jmdict.md](./jmdict.md) | +| JMnedict | JMnedict | [jmnedict.md](./jmnedict.md) | +| JSON (.json) | Json | [json.md](./json.md) | +| Lingoes Source (.ldf) | LingoesLDF | [lingoes_ldf.md](./lingoes_ldf.md) | +| Octopus MDict (.mdx) | OctopusMdict | [octopus_mdict.md](./octopus_mdict.md) | +| QuickDic version 6 (.quickdic) | QuickDic6 | [quickdic6.md](./quickdic6.md) | +| SQL (.sql) | Sql | [sql.md](./sql.md) | +| StarDict (.ifo) | Stardict | [stardict.md](./stardict.md) | +| StarDict (Merge Syns) | StardictMergeSyns | [stardict_merge_syns.md](./stardict_merge_syns.md) | +| StarDict Textual File (.xml) | StardictTextual | [stardict_textual.md](./stardict_textual.md) | +| Tabfile (.txt, .dic) | Tabfile | [tabfile.md](./tabfile.md) | +| Wiktextract (.jsonl) | Wiktextract | [wiktextract.md](./wiktextract.md) | +| WordNet | Wordnet | [wordnet.md](./wordnet.md) | +| Wordset.org JSON directory | Wordset | [wordset.md](./wordset.md) | +| XDXF (.xdxf) | Xdxf | [xdxf.md](./xdxf.md) | +| XDXF with CSS and JS | XdxfCss | [xdxf_css.md](./xdxf_css.md) | +| XDXF Lax (.xdxf) | XdxfLax | [xdxf_lax.md](./xdxf_lax.md) | +| Yomichan (.zip) | Yomichan | [yomichan.md](./yomichan.md) | +| Zim (.zim, for Kiwix) | Zim | [zim.md](./zim.md) | diff --git a/scripts/plugin-doc.py b/scripts/plugin-doc.py index b2d86a2e5..6f26ccab6 100755 --- a/scripts/plugin-doc.py +++ b/scripts/plugin-doc.py @@ -156,6 +156,14 @@ def renderTable(rows): return "\n".join(["| " + " | ".join(row) + " |" for row in rows]) +def renderTableNoPadding(rows): + """rows[0] must be headers.""" + rows = [[renderCell(cell) for cell in row] for row in rows] + width = [len(x) for x in rows[0]] + rows.insert(1, ["-" * colWidth for colWidth in width]) + return "\n".join(["| " + " | ".join(row) + " |" for row in rows]) + + def renderRWOptions(options): return renderTable( [("Name", "Default", "Type", "Comment")] @@ -336,7 +344,7 @@ def getToolSourceLink(tool): ) as _file: _file.write(text) -indexText = renderTable( +indexText = renderTableNoPadding( [("Description", "Name", "Doc Link")] + [ (