X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=tools%2Fgenerate-appcache;h=9a03981fc5cfe9f27464029cc13969890796d41e;hp=a729f0b8e185c1fa3a10e88602d0b926feef0d95;hb=fa194684cec12c5e2099e55897c6fb976b6adc80;hpb=d2962105772fbdc548118bd65cd5bb4934e66085 diff --git a/tools/generate-appcache b/tools/generate-appcache index a729f0b..9a03981 100755 --- a/tools/generate-appcache +++ b/tools/generate-appcache @@ -1,19 +1,28 @@ #!/usr/bin/env python -# Turn a website into an HTML5 application with an application cache -# manifest. -# -# http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html -# https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache +"""Turn a website into an HTML5 application + + +This turns a directory into the simplest possible offline web +application, by making a manifest containing every file in the +directory, then inserting it into each HTML document. + +For more information about the HTML5 application cache, see: + +- https://html.spec.whatwg.org/multipage/browsers.html#offline +- https://developer.mozilla.org/en/docs/HTML/Using_the_application_cache + +""" import os import re -import shutil import time + def is_html(filename): return filename.lower().endswith(".html") + def main(appdir): if not os.path.isdir(appdir): raise StandardError("input (%r) is not a directory" % appdir) @@ -45,8 +54,6 @@ if __name__ == "__main__": try: appdir = sys.argv[1] except IndexError: - raise SystemExit("Usage: %s appdir" %( - sys.argv[0])) + raise SystemExit("Usage: %s appdir" % sys.argv[0]) else: main(appdir) -