mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
docs: Move sync_to_summary.py
to doc/scripts
This commit is contained in:
parent
dc3cdabcad
commit
1242fdac8b
10 changed files with 18 additions and 11 deletions
2
.github/workflows/docs.yml
vendored
2
.github/workflows/docs.yml
vendored
|
@ -18,7 +18,7 @@ jobs:
|
|||
with:
|
||||
python-version: "3.11"
|
||||
- run: |
|
||||
python sync_to_summary.py
|
||||
python scripts/sync_to_summary.py
|
||||
- run: |
|
||||
git config user.name github-actions[bot]
|
||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Summary
|
||||
|
||||
<!--
|
||||
This file is generated automatically. If you want to edit this, edit `doc/sync_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.
|
||||
-->
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# 概要
|
||||
|
||||
<!--
|
||||
このファイルは自動生成されます。これを編集したい場合は`doc/sync_to_summary.py`を編集してください。
|
||||
このファイルは自動生成されます。これを編集したい場合は`doc/scripts/sync_to_summary.py`を編集してください。
|
||||
このファイルはThe Erg Bookを生成するためのものです。バッジなどは付けないでください。
|
||||
-->
|
||||
|
||||
|
|
|
@ -12,28 +12,28 @@ LANGUAGE_SPECIFIC = {
|
|||
"EN": {
|
||||
SUMMARY_TITLE: "Summary",
|
||||
SUMMARY_DESCRIPTION: """\
|
||||
This file is generated automatically. If you want to edit this, edit `doc/sync_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.\
|
||||
""",
|
||||
},
|
||||
"JA": {
|
||||
SUMMARY_TITLE: "概要",
|
||||
SUMMARY_DESCRIPTION: """\
|
||||
このファイルは自動生成されます。これを編集したい場合は`doc/sync_to_summary.py`を編集してください。
|
||||
このファイルは自動生成されます。これを編集したい場合は`doc/scripts/sync_to_summary.py`を編集してください。
|
||||
このファイルはThe Erg Bookを生成するためのものです。バッジなどは付けないでください。\
|
||||
""",
|
||||
},
|
||||
"zh_CN": {
|
||||
SUMMARY_TITLE: "Summary", # TODO: translate
|
||||
SUMMARY_DESCRIPTION: """\
|
||||
This file is generated automatically. If you want to edit this, edit `doc/syn_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.\
|
||||
""", # TODO: translate
|
||||
},
|
||||
"zh_TW": {
|
||||
SUMMARY_TITLE: "Summary", # TODO: translate
|
||||
SUMMARY_DESCRIPTION: """\
|
||||
This file is generated automatically. If you want to edit this, edit `doc/sync_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.\
|
||||
""", # TODO: translate
|
||||
},
|
||||
|
@ -83,7 +83,7 @@ def get_summary(
|
|||
|
||||
|
||||
def main():
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
os.chdir(os.path.join(os.path.dirname(__file__),"../"))
|
||||
|
||||
for language in LANGUAGE_SPECIFIC.keys():
|
||||
syntax_base_path = f"./{language}/syntax"
|
|
@ -1,6 +1,6 @@
|
|||
os = pyimport "os"
|
||||
re = pyimport "re"
|
||||
mylib = pyimport "mylib"
|
||||
mylib = pyimport "mylib" # TODO: Make it work without this
|
||||
|
||||
LANGUAGES_KEBAB_CASE = ["JA", "zh-TW", "zh-CN"]
|
||||
|
||||
|
@ -51,6 +51,7 @@ doc_en_file_paths = get_doc_en_file_paths! "EN"
|
|||
for! LANGUAGES_KEBAB_CASE, lang =>
|
||||
result_text = !""
|
||||
result_text.update! t -> "# \{lang} translation status\n\n"
|
||||
result_text.update! t -> "\{t}This This file is generated automatically. If you want to edit this, edit [`doc/scripts/sync_to_translation_status.er`](../scripts/sync_to_translation_status.er)\n\n"
|
||||
add_table_row_text! left: Str, right: Str =
|
||||
result_text.update! t -> "\{t}| \{left} | \{right} |\n"
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# JA translation status
|
||||
|
||||
This This file is generated automatically. If you want to edit this, edit [`doc/scripts/sync_to_translation_status.er`](../scripts/sync_to_translation_status.er)
|
||||
|
||||
| EN file name | edit icon and badge |
|
||||
| --- | --- |
|
||||
| [README.md](../../README.md) | [📝](../../README_JA.md) [](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=README.md&commit_hash=54dbd1ec22756e0f8aae5ccf0c41aeb9d34876da) |
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# zh-CN translation status
|
||||
|
||||
This This file is generated automatically. If you want to edit this, edit [`doc/scripts/sync_to_translation_status.er`](../scripts/sync_to_translation_status.er)
|
||||
|
||||
| EN file name | edit icon and badge |
|
||||
| --- | --- |
|
||||
| [README.md](../../README.md) | [📝](../../README_zh-CN.md) [](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=README.md&commit_hash=dc7feca6ad1533e791b5fc1fd036636860f03d07) |
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
# zh-TW translation status
|
||||
|
||||
This This file is generated automatically. If you want to edit this, edit [`doc/scripts/sync_to_translation_status.er`](../scripts/sync_to_translation_status.er)
|
||||
|
||||
| EN file name | edit icon and badge |
|
||||
| --- | --- |
|
||||
| [README.md](../../README.md) | [📝](../../README_zh-TW.md) [](https://gezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com/default/source_up_to_date?owner=erg-lang&repos=erg&ref=main&path=README.md&commit_hash=dc7feca6ad1533e791b5fc1fd036636860f03d07) |
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Summary
|
||||
|
||||
<!--
|
||||
This file is generated automatically. If you want to edit this, edit `doc/syn_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.
|
||||
-->
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Summary
|
||||
|
||||
<!--
|
||||
This file is generated automatically. If you want to edit this, edit `doc/sync_to_summary.py`
|
||||
This file is generated automatically. If you want to edit this, edit `doc/scripts/sync_to_summary.py`
|
||||
This file is for generating The Erg Book. Do not add badges, etc.
|
||||
-->
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue