Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Coleman committed Jul 11, 2016
0 parents commit 508a061
Show file tree
Hide file tree
Showing 9 changed files with 15,060 additions and 0 deletions.
48 changes: 48 additions & 0 deletions compile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import os
import re
import datetime

# This script generates the shamir-standalone.html file.

# It removes script and style tags and replaces with the file content.

f = open('src/index.html')
page = f.read()
f.close()


# Script tags

scriptsFinder = re.compile("""<script src="(.*)"></script>""")
scripts = scriptsFinder.findall(page)

for script in scripts:
filename = os.path.join("src", script)
s = open(filename)
scriptContent = "<script>%s</script>" % s.read()
s.close()
scriptTag = """<script src="%s"></script>""" % script
page = page.replace(scriptTag, scriptContent)


# Style tags

stylesFinder = re.compile("""<link rel="stylesheet" href="(.*)">""")
styles = stylesFinder.findall(page)

for style in styles:
filename = os.path.join("src", style)
s = open(filename)
styleContent = "<style>%s</style>" % s.read()
s.close()
styleTag = """<link rel="stylesheet" href="%s">""" % style
page = page.replace(styleTag, styleContent)


# Write the standalone file

f = open('shamir-standalone.html', 'w')
f.write(page)
f.close()

print "%s - DONE" % datetime.datetime.now()
7 changes: 7 additions & 0 deletions license
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2016 Ian Coleman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 508a061

Please sign in to comment.