Ver código fonte

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 anos atrás
pai
commit
b70e2c961d
1 arquivos alterados com 7 adições e 5 exclusões
  1. +7
    -5
      bitshift/assets.py

+ 7
- 5
bitshift/assets.py Ver arquivo

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


Carregando…
Cancelar
Salvar