- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
在使用 Django 模板时如何禁用 flymake?
Flymake 非常适合编辑 python 文件,但确实给我带来了 django 模板的问题。例如,以下模板不会抛出任何错误,但语法高亮显示不适用于模板标签:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block title %}Page title{% endblock %}</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
{% block content %}
<p>… Your HTML content here …</p>
{% endblock %}
</body>
</html>
但是,以下模板充满了 flymake 错误的字体锁定:
{% extends base.html %}
{% block content %}
<h1>Welcome!</h1>
{% endblock %}
将鼠标悬停在错误上会显示 flymake 正在提示“Text not allowed”。
我已按照 this related question 中的每个解决方案进行操作,但它们都没有为 html 缓冲区禁用 flymake。我什至尝试重命名我所有的模板文件以 .djhtml
而不是 .html
结尾,但在重新访问文件后 flymake 仍然处于事件状态。我确实更改了自动模式列表以将 django-html-mode
应用于 .djhtml
文件,所以问题可能就在那里。
更新:我发现切换到 html-mode
不会出现这个问题,因为我已经实现了前面提到的解决方案。但是,如果我切换到 nxml-mode
或 django-html-mode
(我想使用的),flymake 会再次启动并告诉我它是:
Using schema /usr/local/Cellar/emacs/HEAD/share/emacs/24.0.93/etc/schema/xhtml.rnc
Snow Leopard 上的 Emacs24 Carbon。
GNU Emacs 24.0.93.1 (i386-apple-darwin10.8.0, NS apple-appkit-1038.36) of 2012-02-21 on hook
最佳答案
django wiki列出了使用 emacs 的几个选项,但没有提供关于每种模式的特定优势和劣势的大量指导。
我目前使用的解决方法是使用 django-html-mumamo-mode
而不是 django-mode
。这是我在使用 django 设置 emacs 的过程中得出的结论。
请记住,随着这些软件包的开发,其中一些观察结果可能会发生变化。
Looks promising ,但文档不完整,模板中的语法突出显示对我不起作用。这是我真正想要的,但其他人可能会喜欢内置的其他功能。
这与 nXhtml 捆绑在一起.没有包含任何片段,但可以通过 Google 或 imported from a Textmate bundle 找到片段。与 yasnippet。说起来,这个模式conflicts with the yasnippet-bundle通过 ELPA 提供,因此请务必遵循开发主干以避免必须 restart emacs everytime you trigger a snippet .顺便说一句,语法突出显示很棒,您可能会喜欢作为 nXhtml 一部分的通用 Web 开发功能。
语法高亮和跳转到标签,包括一些片段;然而,django-mode doesn't play nice with flymake ,我认为这是因为它源自 nxml-mode
。 django-mode
不再在开发中,nxml-mode
也不是我能收集到的。 django-html-mumamo-mode
不会遇到这个 flymake 问题,因为 nXhtml 包含对开箱即用的 flymake 的非常好的支持。
关于html - 让 flymake 与 Django 一起工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9390495/
我想要的是能够在输入获得焦点或失去焦点时执行某些操作(两个事件)。 我尝试了以下方法,但这按事件单独工作(单独编码时):仅在焦点上,或仅在失去焦点时。 另外,我希望它尽可能跨平台(包括触摸设备),这是
我分别研究了TableView的Filtering和Pagination。 过滤: this帖子帮助我满足了我的需要 分页: this , this帖子也帮助了我 我想像这样将它们组合在一起: 详情-
我是 TDD 方法的新手,所以我想知道是否有人经历过这种机智可以启发我一点。我想获得一些关于如何一起使用 UML 和 TDD 方法的线索。 我已经习惯了:用 UML 设计 --> 生成骨架类(然后保持
我尝试使用入口点和 cmd 设置 Docker。 FROM debian:stretch RUN apt-get update && \ apt install gnupg ca-certificat
我想要一个 Class 对象,但我想强制它所代表的任何类扩展类 A 并实现接口(interface) B。 我能做到: Class 或者: Class 但我不能两者兼得。有办法做到这一点吗? 最佳答案
我是 Rubymine 的长期用户。 Rubymine 非常适合基于 html 的 Rails 应用程序,但我现在正在做更多的 SPA 客户端工作(例如 javascript/react)。我发现我真
我注意到我使用的某个脚本依赖于原型(prototype)。 (Lightbox 2) 它会与 jQuery 在同一页面上一起工作吗?有没有办法确保它们不冲突? 最佳答案 可以,但你需要采取 speci
我需要对表中显示的数据进行分页并通过 ajax 调用获取它 - 这是我通过使用具有以下配置的 dataTables 插件来完成的 - bServerSide : true; sAjaxSource :
我是 gtk 新手,所以想知道在 C 语言中归档和 gtk 是否可以一起使用?例如,我可以从 .txt 文件中读取,然后在相同的代码中使用 gtk 在标签或其他内容中显示它吗?如果是,怎么办? 谢谢!
有没有人设法得到Bck2Brwsr最近与 Java 8/JavaFX 8 一起工作?有没有兼容的机会?我找不到太多关于它的信息,也没有一个好的起点。使用给定的 Maven archetype我遇到了几
在我的应用程序中,用户通过 openid(与 stackoverflow 相同)登录/注销。 我想通过 oauth 向第三方应用程序开放我的应用程序。 如何创建我的 openid-consumer 应
我在启动和运行 Hibernate 和 Spring 时遇到一些问题。我有一个网络服务器项目,它使用了其他几个具有持久实体的项目。我遇到的问题是,对于存储在 WEB-INF/libs 内的另一个 ja
我有 @ControllerAdvice 类,它处理一组异常。我们还有一些其他异常,这些异常用 @ResponseStatus 注释进行注释。为了结合这两种方法,我们使用博客文章中描述的技术:http
我想在屏幕上使用进度条而不是 progressDialog。 我在我的 XML View 文件中插入了一个进度条,我想让它在加载时显示并在不加载时禁用它。 所以我使用的是可见的,但它发生了,所以其余的
CREATE TABLE `users` ( `id` int(11) AUTO_INCREMENT, `academicdegree` varchar(255),
IN() 中使用的查询返回:1, 2。然而,整个查询返回 0 行,这是不可能的,因为它们存在。我在这里做错了什么? SELECT DISTINCT li.auto_id FROM links
亲们, 我如何在使用 Jade 生成的表单上实现 jQuery 样式?我想做的是美化 表单并使它们可点击。我在 UI 方面很糟糕。期间。 我如何在表单上实现这个可选择的方法? http://jquer
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我可以: auto o1 = new Content; 但不能: std::shared_ptr o1(new Content); std::unique_ptr o1(new Content); 我
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 4 年前。 Improve this qu
我是一名优秀的程序员,十分优秀!