• location
    • Location on the page where the resource should be placed.This can be one of: head, headbottom, bodytop or bodybottom. None means the resource will not be injected, which is still useful, e.g. static images.
  • link
    • Direct web link to file. If this is not specified, it is automatically generated, based on :attr:`modname` and :attr:`filename`.
  • modname
    • Name of Python module that contains the file.
  • filename
    • Path to file, relative to module base.
  • no_inject
    • Don't inject this link. (Default: False)
  • whole_dir
    • Make the whole directory available. (Default: False)
  • name
    • (string) The name of the library to link to
  • dirname
    • (string) Specify the directory path for the given file, relative to the "static" folder. Some substitutions are allowed (name and version).
  • basename
    • (string) Specify the basename for the given file.
  • version
    • (string) Specify the version of the javascript library to use.
  • external
    • (boolean) True if you would like to grab the file from a CDN instead of locally. Default: False
  • url_base
    • (string) The base url for fetching the javascript library externally
  • extension
    • (string) File extension
  • additional_files
    • (list(string)) An optional list of files that should be registered with the static resource handler. Default: []
  • variant
    • File variant, e.g., (min for minified), default is
<%namespace name="tw" module="tw2.core.mako_util"/>
<script type="text/javascript" src="${}" ${tw.attrs(attrs=w.attrs)}></script>