Procházet zdrojové kódy

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 před 10 roky
rodič
revize
b70e2c961d
1 změnil soubory, kde provedl 7 přidání a 5 odebrání
  1. +7
    -5
      bitshift/assets.py

+ 7
- 5
bitshift/assets.py Zobrazit soubor

@@ -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]


Načítá se…
Zrušit
Uložit