Merge pull request #1196 from pallets/remove-vim
Before adoption: this commit came in with the history the project adopted, so no landing records it.
remove vim syntax file
authored by David Lord · committed by GitHub · parents da81281, 29cd927 · Browse files · 3 files·+35 added−202 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+35 added−202 removed
- other:+35 added−202 removed
Provenance
- Commit
6478c22- Tree
dcfb3e3- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
da81281- Parent 2
29cd927
3 files changed+35 added−202 removed
modified:docs/integration.rst+35 added-66 removed
1 Integration2 ===========3 4-Jinja provides some code for integration into other tools such as frameworks,5-the `Babel`_ library or your favourite editor for fancy code highlighting.6-This is a brief description of whats included.7-8-Files to help integration are available9-`here. <https://github.com/pallets/jinja/tree/master/ext>`_10-4 .. _babel-integration:5 13-Babel Integration14------------------6+Babel7+-----8 16-Jinja provides support for extracting gettext messages from templates via a17-`Babel`_ extractor entry point called `jinja2.ext.babel_extract`. The Babel18-support is implemented as part of the :ref:`i18n-extension` extension.9+Jinja provides support for extracting gettext messages from templates10+via a `Babel`_ extractor entry point called11+``jinja2.ext.babel_extract``. The support is implemented as part of the12+:ref:`i18n-extension` extension.13 20-Gettext messages extracted from both `trans` tags and code expressions.14+Gettext messages are extracted from both ``trans`` tags and code15+expressions.16 22-To extract gettext messages from templates, the project needs a Jinja section23-in its Babel extraction method `mapping file`_:17+To extract gettext messages from templates, the project needs a Jinja18+section in its Babel extraction method `mapping file`_:19 20 .. sourcecode:: ini21 22 [jinja2: **/templates/**.html]23 encoding = utf-824 30-The syntax related options of the :class:`Environment` are also available as31-configuration values in the mapping file. For example to tell the extraction32-that templates use ``%`` as `line_statement_prefix` you can use this code:25+The syntax related options of the :class:`Environment` are also26+available as configuration values in the mapping file. For example, to27+tell the extractor that templates use ``%`` as28+``line_statement_prefix`` you can use this code:29 30 .. sourcecode:: ini31 32 [jinja2: **/templates/**.html]33 encoding = utf-834 line_statement_prefix = %35 40-:ref:`jinja-extensions` may also be defined by passing a comma separated list41-of import paths as `extensions` value. The i18n extension is added42-automatically.36+:ref:`jinja-extensions` may also be defined by passing a comma separated37+list of import paths as the ``extensions`` value. The i18n extension is38+added automatically.39 44-.. versionchanged:: 2.740+Template syntax errors are ignored by default. The assumption is that41+tests will catch syntax errors in templates. If you don't want to ignore42+errors, add ``silent = false`` to the settings.43 46- Until 2.7 template syntax errors were always ignored. This was done47- since many people are dropping non template html files into the48- templates folder and it would randomly fail. The assumption was that49- testsuites will catch syntax errors in templates anyways. If you don't50- want that behavior you can add ``silent=false`` to the settings and51- exceptions are propagated.44+.. _Babel: https://babel.readthedocs.io/45+.. _mapping file: https://babel.readthedocs.io/en/latest/messages.html#extraction-method-mapping-and-configuration46 53-.. _mapping file: http://babel.pocoo.org/en/latest/messages.html#extraction-method-mapping-and-configuration47 48 Pylons49 ------50 58-With `Pylons`_ 0.9.7 onwards it's incredible easy to integrate Jinja into a59-Pylons powered application.51+It's easy to integrate Jinja into a `Pylons`_ application.52 61-The template engine is configured in `config/environment.py`. The configuration62-for Jinja looks something like that::53+The template engine is configured in ``config/environment.py``. The54+configuration for Jinja looks something like this:55 56+.. code-block:: python57+58 from jinja2 import Environment, PackageLoader59 config['pylons.app_globals'].jinja_env = Environment(60 loader=PackageLoader('yourapplication', 'templates')61 )62 69-After that you can render Jinja templates by using the `render_jinja` function70-from the `pylons.templating` module.63+After that you can render Jinja templates by using the ``render_jinja``64+function from the ``pylons.templating`` module.65 72-Additionally it's a good idea to set the Pylons' `c` object into strict mode.73-Per default any attribute to not existing attributes on the `c` object return74-an empty string and not an undefined object. To change this just use this75-snippet and add it into your `config/environment.py`::66+Additionally it's a good idea to set the Pylons ``c`` object to strict67+mode. By default attribute access on missing attributes on the ``c``68+object returns an empty string and not an undefined object. To change69+this add this to ``config/environment.py``:70 71+.. code-block:: python72+73 config['pylons.strict_c'] = True74 75 .. _Pylons: https://pylonshq.com/80-81-TextMate82---------83-84-There is a `bundle for TextMate`_ that supports syntax highlighting for Jinja 185-and Jinja 2 for text based templates as well as HTML. It also contains a few86-often used snippets.87-88-.. _bundle for TextMate: https://github.com/mitsuhiko/jinja2-tmbundle89-90-Vim91----92-93-A syntax plugin for `Vim`_ is available `from the jinja repository94-<https://github.com/pallets/jinja/blob/master/ext/Vim/jinja.vim>`_. The script95-supports Jinja 1 and Jinja 2. Once installed, two file types are available96-(``jinja`` and ``htmljinja``). The first one is for text-based templates and the97-second is for HTML templates. For HTML documents, the plugin attempts to98-automatically detect Jinja syntax inside of existing HTML documents.99-100-If you are using a plugin manager like `Pathogen`_, see the `vim-jinja101-<https://github.com/mitsuhiko/vim-jinja>`_ repository for installing in the102-``bundle/`` directory.103-104-.. _Babel: http://babel.pocoo.org/105-.. _Vim: https://www.vim.org/106-.. _Pathogen: https://github.com/tpope/vim-pathogendeleted:ext/Vim/jinja.vim-135 removed
1-" Vim syntax file2-" Language: Jinja template3-" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>4-" Last Change: 2008 May 95-" Version: 1.16-"7-" Known Bugs:8-" because of odd limitations dicts and the modulo operator9-" appear wrong in the template.10-"11-" Changes:12-"13-" 2008 May 9: Added support for Jinja 2 changes (new keyword rules)14-15-" .vimrc variable to disable html highlighting16-if !exists('g:jinja_syntax_html')17- let g:jinja_syntax_html=118-endif19-20-" For version 5.x: Clear all syntax items21-" For version 6.x: Quit when a syntax file was already loaded22-if !exists("main_syntax")23- if v:version < 60024- syntax clear25- elseif exists("b:current_syntax")26- finish27- endif28- let main_syntax = 'jinja'29-endif30-31-" Pull in the HTML syntax.32-if g:jinja_syntax_html33- if v:version < 60034- so <sfile>:p:h/html.vim35- else36- runtime! syntax/html.vim37- unlet b:current_syntax38- endif39-endif40-41-syntax case match42-43-" Jinja template built-in tags and parameters (without filter, macro, is and raw, they44-" have special threatment)45-syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained and if else in not or recursive as import46-47-syn keyword jinjaStatement containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained is filter skipwhite nextgroup=jinjaFilter48-syn keyword jinjaStatement containedin=jinjaTagBlock contained macro skipwhite nextgroup=jinjaFunction49-syn keyword jinjaStatement containedin=jinjaTagBlock contained block skipwhite nextgroup=jinjaBlockName50-51-" Variable Names52-syn match jinjaVariable containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[a-zA-Z_][a-zA-Z0-9_]*/53-syn keyword jinjaSpecial containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained false true none False True None loop super caller varargs kwargs54-55-" Filters56-syn match jinjaOperator "|" containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained skipwhite nextgroup=jinjaFilter57-syn match jinjaFilter contained /[a-zA-Z_][a-zA-Z0-9_]*/58-syn match jinjaFunction contained /[a-zA-Z_][a-zA-Z0-9_]*/59-syn match jinjaBlockName contained /[a-zA-Z_][a-zA-Z0-9_]*/60-61-" Jinja template constants62-syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/"/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\"/ end=/"/63-syn region jinjaString containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained start=/'/ skip=/\(\\\)\@<!\(\(\\\\\)\@>\)*\\'/ end=/'/64-syn match jinjaNumber containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[0-9]\+\(\.[0-9]\+\)\?/65-66-" Operators67-syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[+\-*\/<>=!,:]/68-syn match jinjaPunctuation containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /[()\[\]]/69-syn match jinjaOperator containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained /\./ nextgroup=jinjaAttribute70-syn match jinjaAttribute contained /[a-zA-Z_][a-zA-Z0-9_]*/71-72-" Jinja template tag and variable blocks73-syn region jinjaNested matchgroup=jinjaOperator start="(" end=")" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained74-syn region jinjaNested matchgroup=jinjaOperator start="\[" end="\]" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained75-syn region jinjaNested matchgroup=jinjaOperator start="{" end="}" transparent display containedin=jinjaVarBlock,jinjaTagBlock,jinjaNested contained76-syn region jinjaTagBlock matchgroup=jinjaTagDelim start=/{%-\?/ end=/-\?%}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment77-78-syn region jinjaVarBlock matchgroup=jinjaVarDelim start=/{{-\?/ end=/-\?}}/ containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaRaw,jinjaString,jinjaNested,jinjaComment79-80-" Jinja template 'raw' tag81-syn region jinjaRaw matchgroup=jinjaRawDelim start="{%\s*raw\s*%}" end="{%\s*endraw\s*%}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment82-83-" Jinja comments84-syn region jinjaComment matchgroup=jinjaCommentDelim start="{#" end="#}" containedin=ALLBUT,jinjaTagBlock,jinjaVarBlock,jinjaString,jinjaComment85-86-" Block start keywords. A bit tricker. We only highlight at the start of a87-" tag block and only if the name is not followed by a comma or equals sign88-" which usually means that we have to deal with an assignment.89-syn match jinjaStatement containedin=jinjaTagBlock contained /\({%-\?\s*\)\@<=\<[a-zA-Z_][a-zA-Z0-9_]*\>\(\s*[,=]\)\@!/90-91-" and context modifiers92-syn match jinjaStatement containedin=jinjaTagBlock contained /\<with\(out\)\?\s\+context\>/93-94-95-" Define the default highlighting.96-" For version 5.7 and earlier: only when not done already97-" For version 5.8 and later: only when an item doesn't have highlighting yet98-if v:version >= 508 || !exists("did_jinja_syn_inits")99- if v:version < 508100- let did_jinja_syn_inits = 1101- command -nargs=+ HiLink hi link <args>102- else103- command -nargs=+ HiLink hi def link <args>104- endif105-106- HiLink jinjaPunctuation jinjaOperator107- HiLink jinjaAttribute jinjaVariable108- HiLink jinjaFunction jinjaFilter109-110- HiLink jinjaTagDelim jinjaTagBlock111- HiLink jinjaVarDelim jinjaVarBlock112- HiLink jinjaCommentDelim jinjaComment113- HiLink jinjaRawDelim jinja114-115- HiLink jinjaSpecial Special116- HiLink jinjaOperator Normal117- HiLink jinjaRaw Normal118- HiLink jinjaTagBlock PreProc119- HiLink jinjaVarBlock PreProc120- HiLink jinjaStatement Statement121- HiLink jinjaFilter Function122- HiLink jinjaBlockName Function123- HiLink jinjaVariable Identifier124- HiLink jinjaString Constant125- HiLink jinjaNumber Constant126- HiLink jinjaComment Comment127-128- delcommand HiLink129-endif130-131-let b:current_syntax = "jinja"132-133-if main_syntax ==# 'jinja'134- unlet main_syntax135-endifmodified:MANIFEST.in-1 removed
2 unmodified lines3 graft artwork4 graft docs5 prune docs/_build6 graft examples7-graft ext7 graft tests8 global-exclude *.pyc