瓶型模板支持?[英] Bottle Template Support?

本文是小编为大家收集整理的关于瓶型模板支持?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在使用Pycharm 3.4.1,并从Mongo University学习MongoDB.在代码中,他们让我们使用Python使用带有瓶子的MVC图案创建HTML页面.

当我在pycharm中的编辑器中添加类型.tpl文件时,代码中没有"智能感知"或​​对模型的支持.将其更改为HTML文件类型列表中有助于某些人,但编辑器中没有Python支持.

我可以做出一些更改以更好地支持编辑的插件或其他更改吗?似乎有人在今年早些时候问了类似的事情在pycharm中突出显示?

推荐答案

瓶带有一个内置的模板引擎,称为 SimpleTemplate Pycharm 当前不受Pycharm的支持

有一个相关的功能请求: Bottle microframework support ,但不是明确说明.tpl语法支持.

我会去 pycharm的问题跟踪器询问SimpleTemplate>语法支持或至少在现有问题上投票并发表评论.

例如,tornado模板引擎有类似的功能 - 重点:

目前有56票的投票,这可能正在增加看到它发生的可能性.


作为解决方法,您可以在 Settings -> File Types .可以在那里设置突出显示规则.

本文地址:https://www.itbaoku.cn/post/1975356.html

问题描述

I'm using PyCharm 3.4.1 and learning MongoDB from Mongo University. In the code, they have us using Python to create html pages using the MVC pattern with bottle.

When I add a file of type .tpl to the editor in PyCharm, there is no "intellisense" or support for the model in the code. Changing it to be in the list of html file types helps some, but no python support in the editor.

Is there a plugin or some other change i can make to support editing better? Seems someone else asked something similar earlier in the year at How to get tpl files highlighted in pycharm?

推荐答案

Bottle comes with a built-in template engine called SimpleTemplate which is not currently supported by PyCharm.

There is a relevant feature request: Bottle microframework support, but it doesn't explicitly state about .tpl syntax support.

I'd go and create a feature request in PyCharm's issue tracker asking about SimpleTemplate syntax support or, at least, vote up and comment in the existing issue.

For example, there is the similar feature-request for tornado template engine:

It has currently 56 votes up which is probably increasing the possibility of seeing it happen.


As a workaround, you can configure .tpl file type under Settings -> File Types. It is possible to set highlighting rules there.