Skip to content
Myr

[svn] jinja webpage without annyoing .html suffixes now

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 5a8e497 · Browse files · 5 files+11 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+11 added−7 removed

  • other:+11 added−7 removed

5 files+11 added−7 removed

modified:docs/generate.py+2 added-1 removed
256 unmodified lines
257def handle_file(filename, fp, dst, preproc):258 now = datetime.now()259 title = os.path.basename(filename)[:-4]260 content = fp.read()261 suffix = not preproc and '.html' or ''261 parts = generate_documentation(content, (lambda x: './%s.html' % x))262 parts = generate_documentation(content, (lambda x: './%s%s' % (x, suffix)))263 result = file(os.path.join(dst, title + '.html'), 'w')264 c = dict(parts)265 c['style'] = PYGMENTS_FORMATTER.get_style_defs('.syntax')266 c['generation_date'] = now
30 unmodified lines
modified:jinja/datastructure.py+3 added-3 removed
14 unmodified lines
15except NameError:16 from sets import Set as set1718from jinja.exceptions import TemplateSyntaxError, TemplateRuntimeError19from cgi import escape1921_known_safe_types = set([int, long, float])202321def contextcallable(f):22 """23 Mark a function context callable.24 """
130 unmodified lines
155156class Markup(unicode):157 """158 Compatibility for Pylons and probably some other frameworks.159160 It's only used in Jinja environments with `auto_escape` set161 to true.162 """163164 def __html__(self):165 return unicode(self)
295 unmodified lines
modified:jinja/environment.py+1 added-1 removed
11 unmodified lines
12from jinja.lexer import Lexer13from jinja.parser import Parser14from jinja.loaders import LoaderWrapper15from jinja.datastructure import Undefined, Markup, Context, FakeTranslator16from jinja.utils import escape, collect_translations, get_attribute16from jinja.utils import collect_translations, get_attribute17from jinja.exceptions import FilterNotFound, TestNotFound, \18 SecurityException, TemplateSyntaxError, TemplateRuntimeError19from jinja.defaults import DEFAULT_FILTERS, DEFAULT_TESTS, DEFAULT_NAMESPACE20
306 unmodified lines
modified:jinja/filters.py+4 added-1 removed
103 unmodified lines
104 was configured with disabled `auto_escape`.105106 This method will have no effect it the value is already escaped.107 """108 #: because filters are cached we can make a local alias to109 #: speed things up a bit110 e = escape111 def wrapped(env, context, s):112 if isinstance(s, TemplateData):113 return s114 elif hasattr(s, '__html__'):115 return s.__html__()113 return escape(env.to_unicode(s), attribute)116 return e(env.to_unicode(s), attribute)117 return wrapped118119120def do_capitalize(s):
539 unmodified lines
modified:jinja/lexer.py+1 added-1 removed
48 unmodified lines
49 # braces and parenthesis50 '[', ']', '(', ')', '{', '}',51 # attribute access and comparison / logical operators52 '.', ':', ',', '|', '==', '<', '>', '<=', '>=', '!=', '=',53 ur'or\b', ur'and\b', ur'not\b', ur'in\b', ur'is'53 ur'or\b', ur'and\b', ur'not\b', ur'in\b', ur'is\b'54]]))5556# set of used keywords57keywords = set(['and', 'block', 'cycle', 'elif', 'else', 'endblock',
228 unmodified lines