From 26909af5ded2e270acb0fc665bcb588b603a5aca Mon Sep 17 00:00:00 2001
From: Alex Plate <aleksei.plate@jetbrains.com>
Date: Mon, 21 Oct 2024 16:16:17 +0300
Subject: [PATCH] Update the doc sync script to remove the `.md` from the
 links.

---
 .github/workflows/syncDoc.yml | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/.github/workflows/syncDoc.yml b/.github/workflows/syncDoc.yml
index a845cecff..eb8061e68 100644
--- a/.github/workflows/syncDoc.yml
+++ b/.github/workflows/syncDoc.yml
@@ -34,6 +34,17 @@ jobs:
         id: update_authors
         run: cp -a origin/doc/. docs
 
+      # The Wiki for github should have no `.md` in references
+      # Otherwise, such links will lead to the raw text.
+      # However, the `.md` should exist to have a navigation in GitHub code.
+      - name: Replace `.md)` with `)`
+        run: |
+          # Define the directory you want to process
+          DIRECTORY="docs"
+
+          # Find all files in the directory and perform the replacement
+          find $DIRECTORY -type f -exec sed -i 's/\.md)//g' {} +
+
       - name: Commit changes
         uses: stefanzweifel/git-auto-commit-action@v4
         with: