ソースを参照

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年前
コミット
b70e2c961d
1個のファイルの変更7行の追加5行の削除
  1. +7
    -5
      bitshift/assets.py

+ 7
- 5
bitshift/assets.py ファイルの表示

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


読み込み中…
キャンセル
保存