Browse Source

Update assets module with template docstring.

Mod:
    bitshift/assets.py
        -convert existing docstrings to the Sphinx auto-doc format.
tags/v1.0^2
Severyn Kozak 10 years ago
parent
commit
b70e2c961d
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      bitshift/assets.py

+ 7
- 5
bitshift/assets.py View File

@@ -1,6 +1,6 @@
"""
Module contains helper functions to be used inside the project's Jinja
templates.
.. module:: assets
:synopsis: Helper functions for use inside the project's Jinja templates.
"""

from flask import Markup
@@ -12,10 +12,12 @@ ASSET_HTML_TEMPLATES = {

def tag(filename):
"""
Return HTML tag for asset named filename.
Generate an HTML tag for a CSS/JS asset, based on its file extension.

Return either a <script> or <link> tag to the file named filename,
based on its extension.
:param filename: The filename of the asset to create a tag for.

:return: A string containing a `<source>` tag for JS files, and a `<link>`
for CSS files.
"""

file_ext = filename.split(".")[-1]


Loading…
Cancel
Save