Created
April 1, 2014 02:25
-
-
Save robstenzinger/9906572 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Post-build update a revealJS deck | |
- adds a base target, jQuery, and a main.js include script block | |
technique from: | |
http://stackoverflow.com/questions/39086/search-and-replace-a-line-in-a-file-in-python | |
""" | |
import fileinput | |
import sys | |
def replaceAll(file,searchExp,replaceExp): | |
for line in fileinput.input(file, inplace=1): | |
if searchExp in line: | |
line = line.replace(searchExp,replaceExp) | |
sys.stdout.write(line) | |
replaceAll("deck.html", """<script src="reveal.js/js/reveal.min.js"></script>""", """<script src="reveal.js/js/reveal.min.js"></script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src="js/main.js"></script><base target="_blank">""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment