Use with Python 3.
/* :depends module1, module2 */
Module names correspond to filenames without an extension, e.g. <style>/*:depends site*/</style> depends on a file named site.css. Module names must only consist of the ASCII characters matching the regular expression [a-zA-Z0-9_-].
Moudle files are located by looking in the current working directory and then via whatever paths have been optionally specified in the $HTMLDEPS environment variable (formatted just like the ubiquitous $PATH variable). In addition, the list of paths to search may also be adjusted via the config object.
Attributes in the original <script> or <style> tags will be written into the transformed HTML. For example:
<style media="print">/* :depends print */</style>
Might render something like this:
<link rel="stylesheet" href="print.css" media="print">
(For XHTML, <link rel="stylesheet" href="print.css" media="print" />)
This module may also be invoked directly from the command line by passing it to the python interpreter. Run the script with --help to see the available command flags:
python htmldeps.py --help