Skip to content

chore(ci): sync Mintlify .mdx files to SDK README.md with frontmatter + image path handling#2120

Closed
varshith257 wants to merge 10 commits intoBasedHardware:mainfrom
varshith257:chore/sync-docs
Closed

chore(ci): sync Mintlify .mdx files to SDK README.md with frontmatter + image path handling#2120
varshith257 wants to merge 10 commits intoBasedHardware:mainfrom
varshith257:chore/sync-docs

Conversation

@varshith257
Copy link
Copy Markdown

@varshith257 varshith257 commented Mar 29, 2025

This PR implements a GitHub Action to sync Mintlify .mdx files back to their respective SDK README.md files as described in issue

  • syncs SDK docs from:
docs/docs/docs/developer/sdk/python.mdx → sdks/python/README.md

docs/docs/docs/developer/sdk/reactnative.mdx → sdks/react-native/README.md

docs/docs/docs/developer/sdk/swift.mdx → sdks/swift/README.md
  • strips frontmatter cleanly using a production-safe sed approach

  • dynamically rewrites image paths based on folder depth and no need of hard coding anymore

  • auto-injects banner at the top of each README.md as follows

<!--
⚠️ This file is auto-generated from docs/docs/docs/[source].mdx. Do not edit manually.
-->

📦 Notes to Reviewers

  • Fully tested for all SDKs

  • Handles edge cases like emojis, nested folders and image links and safe for production use

I guess it's ready to close and lock bounty after incorporating any feedback or suggestions from reviewer

Fixes #2112
/claim #2112

@varshith257
Copy link
Copy Markdown
Author

varshith257 commented Mar 29, 2025

@beastoin @kodjima33 Here's the production ready clean workflow for reverse sync of docs to respective README.md's along with image handling. I am happy to incorporate any suggestions needed. I just used emojis to make the workflow even more interactive(if they aren't needed I will remove them)

i have also tested diff docs in temp folder in root and they are syncing nicely

@varshith257
Copy link
Copy Markdown
Author

varshith257 commented Mar 29, 2025

@beastoin Just to update this is first PR submitted resolving image paths too and fulfilling all issue requiremnts. I have observed in other PRs of adding the same logic of this PR to resolve image paths just by renaming them an even the logic is wrong there though.

They left exact of this PR var name relative_depth in renaming process and below is the scr of it and you can watch it

image

@krushnarout
Copy link
Copy Markdown
Member

krushnarout commented Mar 29, 2025

@varshith257 Bro, don't say it like that. I added the logic it's just a simple for loop. I'm not dumb enough to not know this. I spent two hours testing it in my demo repo. If you think you're the one who came up with the logic, then why did you use my solution that I spent time fixing from this comment ? Why would I need to copy your logic? I tested it two hours before your pull request.

if [[ "$README_FILE" == assembly/* ]]; then
  sed -i 's|](/images/|](../docs/images/|g' temp.md
else
  sed -i 's|](/images/|](../../docs/images/|g' temp.md
fi

I see you added my solution in this commit fc32b44

Screenshot 2025-03-29 at 10 44 55 PM

@varshith257
Copy link
Copy Markdown
Author

varshith257 commented Mar 30, 2025

Just check above image. They aren't even similiar. I have followed with your discussions in issue and checked opened PRS, I thought there is room for more improvement and I have clear approach so I have taken step to submit PR.

Thanks for providing the test code to check with asssembly docs. As you seen in my commit I have just used for my testing itself and haven't used it for any purposes and I have cleaned it and made it resolve image paths more dynamically without any hardcoded values.

I think you have to know that it's not first come first serve basis, the one which is good that wins and reviewers decide them and lock bounty. I am not arguing with your work, just I thought there is room for improvement of current opened PR approaches and submitted this PR 😀

@krushnarout
Copy link
Copy Markdown
Member

krushnarout commented Mar 30, 2025

If you check your logic and my logic, they're not the same. I made my PR before you, with my own approach! My path calculation logic is different, can't you see that?

path_depth=$(awk -F'/' '{print NF-1}' <<< "$README_FILE")

Thanks for providing the test code to check with asssembly docs. As you seen in my commit I have just used for my testing itself and haven't used it for any purposes and I have cleaned it and made it resolve image paths more dynamically without any hardcoded values.

Why would you take someone else's logic just for testing? I spent time finding and testing it, and you just picked it up and used it. Of course, you made fast progress—you used my logic. And if you didn't use it for any purpose, then why did you use it at all? Obviously, you got an idea from it easily—an idea that I spent my time figuring out.

I think you have to know that it's not first come first serve basis, the one which is good that wins and reviewers decide them and lock bounty. I am not arguing with your work, just I thought there is room for improvement of current opened PR approaches and submitted this PR 😀

Listen bro, I have made the PR before you and If I tell you that you have used my approach and just added some fancy emojis but your PR use same logic with different names ?

 declare -A FILE_MAP=(
            ["docs/docs/docs/developer/sdk/python.mdx"]="sdks/python/README.md"
            ["docs/docs/docs/developer/sdk/ReactNative.mdx"]="sdks/react-native/README.md"
            ["docs/docs/docs/developer/sdk/swift.mdx"]="sdks/swift/README.md"
          )

Your PR is not using different logic, so why did you added my solution to your PR?

If you look at other people's PRs, their approach is completely different. Does your PR look like that?

Screenshot 2025-03-30 at 7 00 48 AM

@varshith257

@varshith257
Copy link
Copy Markdown
Author

varshith257 commented Mar 30, 2025

I said again i am not arguing man, I just left for further reviews for reviewers. It's strange if you see only fancy emojis. Please stop tagging me :)

@krushnarout
Copy link
Copy Markdown
Member

I said again i am not arguing man, I just left for further reviews for reviewers. It's strange if you see only fancy emojis. Please stop tagging me :)

Cool, I said because you added my changes image in the comment

@varshith257 varshith257 reopened this Mar 30, 2025
@beastoin
Copy link
Copy Markdown
Collaborator

beastoin commented Mar 31, 2025

man @varshith257, the issue has been done by #2116 , feel free to create new PR to enhance it. appreciate you guys helps ❤️

don't forget to check our > $80K bounties https://omi.me/bounties

@beastoin beastoin closed this Mar 31, 2025
@varshith257 varshith257 deleted the chore/sync-docs branch March 31, 2025 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a .github action to sync the docs backward to the repo's README.md.

4 participants