Skip to content
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

[Feature] Auto insert support recursive folders, and auto skip files without <!--ts--> #110

Open
vikyd opened this issue Feb 3, 2021 · 2 comments

Comments

@vikyd
Copy link

vikyd commented Feb 3, 2021

Wants 2 features:

  • Auto insert support recursive folders
  • Auto insert auto skip files without <!--ts-->
@vikyd
Copy link
Author

vikyd commented Feb 3, 2021

Here is my temporary solution, it works in my repo :

getTocMdFiles(){
  find . -iname '*.md' \
  | xargs grep -nwlzP -e '<!--ts-->' | xargs grep -nwlzP -e '<!--te-->'
}

echo "Generate TOC begin: ..."
getTocMdFiles | xargs -L 1 -P 50 gh-md-toc --insert --no-backup 
echo "Generate TOC end."
echo "-----------------"

echo "Remove time row in TOC begin: ..."
# remove time content to aviod too many changes
getTocMdFiles | xargs sed -i '/<!-- Added by:/d' 
echo "Remove time row in TOC end."

@yiranzai
Copy link

yiranzai commented Apr 9, 2021

I have the same idea
And
#115
#117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants