-
Notifications
You must be signed in to change notification settings - Fork 3
[CI-4292] Automate Table of Contents Generation using Doctoc #219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI-4292] Automate Table of Contents Generation using Doctoc #219
Conversation
.husky/pre-push
Outdated
| git add README.md | ||
| git commit --amend --no-edit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will automatically amend the commit that is about to be pushed to remote. It's seamless, so as a contributor you might not even realize your final commit has been changed before it was pushed. That said, it lowkey scares me so we could make it a manual process instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: @esezen suggested maybe adding a new commit instead of amending the existing one, but it turns out that doesn't play well cc: https://stackoverflow.com/questions/21334493/git-commit-in-pre-push-hook
esezen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mudaafi let me know if this is a problem on my end but the pre-push hook is pushing the original commit rather than the amended one for me. So instead of doing amend and push, it does push and amend which creates a divergent branch (?) between origin and local 🤔
My local has the updated ToC but the version that gets pushed to GH doesn't
|
@esezen Hmm it works for me. Let's hop on a sync |
esezen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…dme-add-automatic-generation
* Ci 4255 os UI autocomplete add GitHub readme overview (#201) * Add Library overview and installation and quick guide * update title * update styles * update styles * updates * updates * Edit gif height * remove yarn * remove yarn * update * Update README Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> * Address comments --------- Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> * Add Advanced Features (#208) * Add Advanced Features * Add code examples section to readme (#209) * Add code examples section to readme * Update README.md Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> * Update README.md Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> * Add docs flag to storybook (#210) * Add Contributing section (#218) * [CI-4265] Add License to README.md (#216) * add license * lint * add complementary resources (#217) * Add API regerence section * [CI-4261] New Docs: Add Troubleshooting Section to Readme (#220) * add troubleshooting section * left align text in tables * use html instead of markdown to render table * Update discussions link * Update integration modes (#213) * Update integration modes * upload gif to repo --------- Co-authored-by: stanlp1 <stanley.peng@constructor.io> * [CI-4259] Add GitHub readme customization (#214) * [CI-4259] Add customization section to readme * [CI-4259] Summarize and shorten descriptions --------- Co-authored-by: Viktor Zavala <viktor.zavala@constructor.io> * [CI-4292] Automate Table of Contents Generation using Doctoc (#219) * add doctoc automation * Sets pre_push script to be git executable * Update pre_push hook to exclude changes made by doctoc * test pre_push hook * test: edits to doctoc section * test2: edits to doctoc section * update pre_push hook * update readme * update doctoc configs * lint * update pre-push hook to append a new commit instead of ammend * testing pre_push hook flow * revert back to amend * Test the hook * Test * testing * Test Removing section * a * b * c * Add thing * Add new topic * Revert "revert back to amend" This reverts commit e56366d. * Reapply "revert back to amend" This reverts commit 46be0f7. * Update readme * Change pre-push to pre-commit * base case * move to post-commit * fix post-commit script * Test: README Change outside TOC * docs: auto-update README TOC (post-commit) * fix post-commit script * test: local TOC change * test: addition outside TOC * docs: auto-update README TOC (post-commit) * test: removal outside TOC, TOC updated * run doctoc --------- Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> Co-authored-by: mocca102 <islaam.agamy@gmail.com> * [CI-4320] Create a Props.mdx for CioAutocomplete (#225) * copy commits * match comments * display props page * update test * [NOCI] README Troubleshooting: How to Add Peer Dependencies (#222) * add peer dependencies to troubleshooting.md * lint * transform mardown links to html anchors * code block * [CDX-257] Update story title for CioAutocomplete component --------- Co-authored-by: Islam Moustafa <58053149+mocca102@users.noreply.github.com> Co-authored-by: Ahmad Mudaafi' <ahmad.mudaafi@constructor.io> Co-authored-by: Viktor Zavala <zavala.viktor@gmail.com> Co-authored-by: mocca102 <islaam.agamy@gmail.com> Co-authored-by: Enes Kutay SEZEN <eneskutaysezen@gmail.com> Co-authored-by: ST P <57369888+stanlp1@users.noreply.github.com> Co-authored-by: stanlp1 <stanley.peng@constructor.io> Co-authored-by: Viktor Zavala <viktor.zavala@constructor.io>
PR Description
pre_pushpost_commit script using husky to seamlessly run doctoc if the README.md file has been updated, ensuring that the TOC always remains updated. (This could be a GHA as well)