From 5d2ab8403ae4b3ebd8de4baabca96f78200a9f3f Mon Sep 17 00:00:00 2001 From: taskylizard <75871323+taskylizard@users.noreply.github.com> Date: Sun, 29 Oct 2023 13:57:04 +0530 Subject: [PATCH] prepare for release --- ...-in-files-in-current-dir.py => replace.py} | 16 ++++---- .github/script.sh | 2 + .github/workflows/retype.yml | 40 ------------------- 3 files changed, 10 insertions(+), 48 deletions(-) rename .github/{replace-links-to-fmhy-in-files-in-current-dir.py => replace.py} (93%) create mode 100644 .github/script.sh delete mode 100644 .github/workflows/retype.yml diff --git a/.github/replace-links-to-fmhy-in-files-in-current-dir.py b/.github/replace.py similarity index 93% rename from .github/replace-links-to-fmhy-in-files-in-current-dir.py rename to .github/replace.py index 9a279ca4f..e1b3fcb42 100644 --- a/.github/replace-links-to-fmhy-in-files-in-current-dir.py +++ b/.github/replace.py @@ -6,12 +6,12 @@ def replaces_for_beginners_guide(text): text = re.sub('\[TOC\]\n', '', text, flags=re.MULTILINE) text = re.sub('\*\*Table of Contents\*\*\n\[TOC2\]\n', '', text, flags=re.MULTILINE) text = re.sub('# -> \*\*\*Beginners Guide to Piracy\*\*\* <-\n', '', text, flags=re.MULTILINE) - text = re.sub(r"!!!note\s(.+?)\n", r"!!!\n\1\n!!!\n", text, flags=re.MULTILINE) - text = re.sub(r"!!!info\s(.+?)\n", r"!!!\n\1\n!!!\n", text, flags=re.MULTILINE) - text = re.sub(r"!!!warning\s(.+?)\n", r"!!!warning\n\1\n!!!\n", text, flags=re.MULTILINE) + text = re.sub(r"!!!note\s(.+?)\n", r":::tip\n\1\n:::\n", text, flags=re.MULTILINE) + text = re.sub(r"!!!info\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE) + text = re.sub(r"!!!warning\s(.+?)\n", r":::warning\n\1\n:::\n", text, flags=re.MULTILINE) text = re.sub(r">\s(.+?)\n", r"> \1\n\n", text, flags=re.MULTILINE) text = re.sub('\*\*\[\^ Back to Top\]\(#beginners-guide-to-piracy\)\*\*', '', text, flags=re.MULTILINE) - text = re.sub("!!!\n!!!\n", "!!!\n", text, flags=re.MULTILINE) + text = re.sub(r"!!!\s(.+?)\n", r":::info\n\1\n:::\n", text, flags=re.MULTILINE) text = re.sub("\n\*\*\[", "\n* **[", text, flags=re.MULTILINE) return text @@ -34,10 +34,10 @@ def change_some_general_formatting(text): text = re.sub('## ▷', '###', text) text = re.sub('####', '###', text) - text = re.sub(r'^\*\*Note\*\* - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE) - text = re.sub(r'^\* \*\*Note\*\* - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE) - text = re.sub(r'^Note - (.+)$', r'!!!\n\1\n!!!', text, flags=re.MULTILINE) - text = re.sub(r'^\*\*Warning\*\* - (.+)$', r'!!!warning\n\1\n!!!', text, flags=re.MULTILINE) + text = re.sub(r'^\*\*Note\*\* - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE) + text = re.sub(r'^\* \*\*Note\*\* - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE) + text = re.sub(r'^Note - (.+)$', r':::tip\n\1\n:::', text, flags=re.MULTILINE) + text = re.sub(r'^\*\*Warning\*\* - (.+)$', r':::warning\n\1\n:::', text, flags=re.MULTILINE) return text diff --git a/.github/script.sh b/.github/script.sh new file mode 100644 index 000000000..d0a7f504a --- /dev/null +++ b/.github/script.sh @@ -0,0 +1,2 @@ +python .github/replace.py +python .github/add-headers.py diff --git a/.github/workflows/retype.yml b/.github/workflows/retype.yml deleted file mode 100644 index f4d8baedf..000000000 --- a/.github/workflows/retype.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Update FMHY Retype -on: - workflow_dispatch: - schedule: - - cron: "0 */2 * * *" - -jobs: - update: - name: Update FMHY Retype - runs-on: ubuntu-latest - - permissions: - contents: write - - steps: - - uses: actions/checkout@v2 - - - name: Move Files - run: | - cp -r .github/assets/* . - shell: bash - - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - name: Prepare Files - shell: bash - run: | - python .github/replace-links-to-fmhy-in-files-in-current-dir.py - python .github/add-headers.py - - - name: Build Retype - uses: retypeapp/action-build@latest - - - uses: retypeapp/action-github-pages@latest - with: - branch: retype - update-branch: true