new snippets

This commit is contained in:
Rohit Tanwar
2018-02-01 13:49:59 +05:30
parent b5a1fa18ba
commit 55f39b14bd
27 changed files with 292 additions and 34 deletions

View File

@ -31,7 +31,6 @@ def tagger():
tag_dict[category] = [snippet]
return tag_dict
files = os.listdir('snippets')
start = open("static-parts/readme-start.md").read() + '\n\n'
end = open("static-parts/readme-end.md").read()
toAppend = ''
@ -50,4 +49,4 @@ for category in tag_dict:
fileData = someFile.read()
codeParts = re.split(codeRe,fileData)
toAppend += codeParts[0] + f'```py{codeParts[1]} \n ```' +codeParts[2] + f'<details><summary>View Examples</summary>\n\n```py\n{codeParts[3]}\n```\n</details>\n\n<br><a href = "#table-of-contents">:arrow_up: Back to top</a>\n ' + '\n'
open("README.md",'w').write(start+toAppend+'\n'+end)
open("README.md",'w').write(start+toAppend+'\n'+end)