add star buttons
This commit is contained in:
20
change_cdn.py
Normal file
20
change_cdn.py
Normal file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def iter(path):
|
||||
for root, dirs, files in os.walk(path):
|
||||
for fn in files:
|
||||
if fn.endswith(".html"):
|
||||
with open(root + '/' + fn, 'r') as f:
|
||||
content = f.read()
|
||||
content = content.replace('<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>', '<script src="http://cdn.bootcss.com/ace/1.1.3/ace.js"></script>').replace('<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>', '<script src="http://cdn.bootcss.com/ace/1.1.3/mode-javascript.js"></script>')
|
||||
insert_pos = content.find("</li>", content.find("Generated using GitBook")) + 6
|
||||
content = content[:insert_pos] + '''<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>''' + content[insert_pos:]
|
||||
with open(root + '/' + fn, 'w') as f:
|
||||
f.write(content)
|
||||
|
||||
iter(os.getcwd())
|
||||
@ -187,7 +187,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,7 +187,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,7 +187,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -185,7 +185,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -187,7 +187,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<!DOC<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>TYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>jsREPL Sandbox</title>
|
||||
|
||||
@ -82,6 +82,7 @@
|
||||
|
||||
<!-- Actions Right -->
|
||||
|
||||
|
||||
<a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a>
|
||||
|
||||
|
||||
@ -185,6 +186,8 @@
|
||||
<li>
|
||||
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
|
||||
</li>
|
||||
<li style="margin-left:15%;"> <iframe src="http://ghbtns.com/github-btn.html?user=numbbbbb&repo=the-swift-programming-language-in-chinese&type=watch&count=true&size=large"
|
||||
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user