comparison sat/tools/common/template.py @ 3267:2eeca6fd08f7

tools (common/template): typos
author Goffi <goffi@goffi.org>
date Sun, 03 May 2020 13:40:04 +0200
parents 8ec5ddb4e759
children 85c9cfcd4f5e
comparison
equal deleted inserted replaced
3266:8ec5ddb4e759 3267:2eeca6fd08f7
610 if it exists. 610 if it exists.
611 Previous element are kept by replacing '/' with '_'. 611 Previous element are kept by replacing '/' with '_'.
612 styles_extra.css, styles.css, highlight.css and fonts.css are always used if they 612 styles_extra.css, styles.css, highlight.css and fonts.css are always used if they
613 exist. 613 exist.
614 For each found file, if a file with the same name and "_noscript" suffix exists, 614 For each found file, if a file with the same name and "_noscript" suffix exists,
615 it will be return is second part of resulting tuple. 615 it will be returned is second part of resulting tuple.
616 For instance, if template_data is (some_site, some_theme, blog/articles.html), 616 For instance, if template_data is (some_site, some_theme, blog/articles.html),
617 following files are returned, earch time trying [some_site root] first, 617 following files are returned, each time trying [some_site root] first,
618 then default site (i.e. sat_templates) root: 618 then default site (i.e. sat_templates) root:
619 - some_theme/static/styles.css is returned if it exists 619 - some_theme/static/styles.css is returned if it exists
620 else default/static/styles.css 620 else default/static/styles.css
621 - some_theme/static/blog.css is returned if it exists 621 - some_theme/static/blog.css is returned if it exists
622 else default/static/blog.css (if it exists too) 622 else default/static/blog.css (if it exists too)
863 def render(self, template, site=None, theme=None, locale=C.DEFAULT_LOCALE, 863 def render(self, template, site=None, theme=None, locale=C.DEFAULT_LOCALE,
864 media_path="", css_files=None, css_inline=False, **kwargs): 864 media_path="", css_files=None, css_inline=False, **kwargs):
865 """Render a template 865 """Render a template
866 866
867 @param template(unicode): template to render (e.g. blog/articles.html) 867 @param template(unicode): template to render (e.g. blog/articles.html)
868 @param site(unicide): site name 868 @param site(unicode): site name
869 None or empty string for defaut site (i.e. SàT templates) 869 None or empty string for defaut site (i.e. SàT templates)
870 @param theme(unicode): template theme 870 @param theme(unicode): template theme
871 @param media_path(unicode): prefix of the SàT media path/URL to use for 871 @param media_path(unicode): prefix of the SàT media path/URL to use for
872 template root. Must end with a u'/' 872 template root. Must end with a u'/'
873 @param css_files(list[unicode],None): CSS files to used 873 @param css_files(list[unicode],None): CSS files to use
874 CSS files must be in static dir of the template 874 CSS files must be in static dir of the template
875 use None for automatic selection of CSS files based on template category 875 use None for automatic selection of CSS files based on template category
876 None is recommended. General static/style.css and theme file name will be 876 None is recommended. General static/style.css and theme file name will be
877 used. 877 used.
878 @param css_inline(bool): if True, CSS will be embedded in the HTML page 878 @param css_inline(bool): if True, CSS will be embedded in the HTML page