Skip to content

Commit

Permalink
do not add table padding to doc/p/__index__.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 28, 2024
1 parent 2efdb01 commit abd522f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mdformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 --)
Expand Down
100 changes: 50 additions & 50 deletions doc/p/__index__.md
Original file line number Diff line number Diff line change
@@ -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) |
10 changes: 9 additions & 1 deletion scripts/plugin-doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -336,7 +344,7 @@ def getToolSourceLink(tool):
) as _file:
_file.write(text)

indexText = renderTable(
indexText = renderTableNoPadding(
[("Description", "Name", "Doc Link")]
+ [
(
Expand Down

0 comments on commit abd522f

Please sign in to comment.