[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
Provenance
- Commit
1f1823c- Tree
641c32b- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent
5a8e497
5 files changed+11 added−7 removed
modified:docs/generate.py+2 added-1 removed
256 unmodified lines257 def 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'] = now30 unmodified linesmodified:jinja/datastructure.py+3 added-3 removed
14 unmodified lines15 except NameError:16 from sets import Set as set17 18 from jinja.exceptions import TemplateSyntaxError, TemplateRuntimeError19-from cgi import escape19 21-_known_safe_types = set([int, long, float])20 23-21 def contextcallable(f):22 """23 Mark a function context callable.24 """130 unmodified lines155 156 class Markup(unicode):157 """158 Compatibility for Pylons and probably some other frameworks.159+160+ It's only used in Jinja environments with `auto_escape` set161+ to true.162 """163 164 def __html__(self):165 return unicode(self)295 unmodified linesmodified:jinja/environment.py+1 added-1 removed
11 unmodified lines12 from jinja.lexer import Lexer13 from jinja.parser import Parser14 from jinja.loaders import LoaderWrapper15 from jinja.datastructure import Undefined, Markup, Context, FakeTranslator16-from jinja.utils import escape, collect_translations, get_attribute16+from jinja.utils import collect_translations, get_attribute17 from jinja.exceptions import FilterNotFound, TestNotFound, \18 SecurityException, TemplateSyntaxError, TemplateRuntimeError19 from jinja.defaults import DEFAULT_FILTERS, DEFAULT_TESTS, DEFAULT_NAMESPACE20 306 unmodified linesmodified:jinja/filters.py+4 added-1 removed
103 unmodified lines104 was configured with disabled `auto_escape`.105 106 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 wrapped118 119 120 def do_capitalize(s):539 unmodified linesmodified:jinja/lexer.py+1 added-1 removed
48 unmodified lines49 # 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 ]]))55 56 # set of used keywords57 keywords = set(['and', 'block', 'cycle', 'elif', 'else', 'endblock',228 unmodified lines