A script to minify XML files in KRPano projects
Python
Switch branches/tags
Nothing to show
Latest commit f2bbf9b Jul 26, 2012 Manuel Fixed kencrypt call to account for bug
Permalink
Failed to load latest commit information.
README.md Added encryption option Jul 26, 2012
minifykr.py Fixed kencrypt call to account for bug Jul 26, 2012

README.md

minifykr

A script to minify XML files in krpano projects. It requires the argparse library, which is available in Python 3.2.

Usage: minifykr.py [-e] [inputFile] [outputFile]

  • The default values for inputFile and outputFile are "tour.xml" and "tour.min.xml"
  • When -e is specified, the outputFile will be encrypted using kencrypt. This required kencrypt to be in the PATH

krpano projects often consist of a large number of XML files, which have to be loaded by the browser. This script minifies the XML code, merging all the files and removing unnecessary code, such as comments or spaces between XML tags.

This script recursively transverses all the files which are included in "inputFile" through <include> tags, minifies their code and writes the result to "outputFile". Minifying does the following:

  • removes comments
  • removes characters between tags
  • removes text inside tags which are not <data> or <action>