docs: Move sync_to_summary.py to doc/scripts

This commit is contained in:
toddlerer 2023-01-25 01:14:41 +09:00
parent dc3cdabcad
commit 1242fdac8b
No known key found for this signature in database
GPG key ID: 44060B0ACE658F8D
10 changed files with 18 additions and 11 deletions

View file

@ -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

View file

@ -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.
-->

View file

@ -1,7 +1,7 @@
# 概要
<!--
このファイルは自動生成されます。これを編集したい場合は`doc/sync_to_summary.py`を編集してください。
このファイルは自動生成されます。これを編集したい場合は`doc/scripts/sync_to_summary.py`を編集してください。
このファイルはThe Erg Bookを生成するためのものです。バッジなどは付けないでください。
-->

View file

@ -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"

View file

@ -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"

View file

@ -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) [![badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com%2Fdefault%2Fsource_up_to_date%3Fowner%3Derg-lang%26repos%3Derg%26ref%3Dmain%26path%3DREADME.md%26commit_hash%3D54dbd1ec22756e0f8aae5ccf0c41aeb9d34876da)](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) |

View file

@ -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) [![badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com%2Fdefault%2Fsource_up_to_date%3Fowner%3Derg-lang%26repos%3Derg%26ref%3Dmain%26path%3DREADME.md%26commit_hash%3Ddc7feca6ad1533e791b5fc1fd036636860f03d07)](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) |

View file

@ -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) [![badge](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fgezf7g7pd5.execute-api.ap-northeast-1.amazonaws.com%2Fdefault%2Fsource_up_to_date%3Fowner%3Derg-lang%26repos%3Derg%26ref%3Dmain%26path%3DREADME.md%26commit_hash%3Ddc7feca6ad1533e791b5fc1fd036636860f03d07)](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) |

View file

@ -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.
-->

View file

@ -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.
-->