Commits

Henning Schröder  committed 04718b9

start on django templates/html highlighter

  • Participants
  • Parent commits 396f0f6

Comments (0)

Files changed (2)

File codeaide/modes/python/django.py

+template_keywords = [
+ "block", "endblock", "extends", "load", 
+]
+
+
+template_syntax = {
+  "partitions": [
+      ("string", "'", "'"),
+      ("string", '"', '"'),
+      ("comment", "{#", "#}", True),
+      ("variable", "{{", "}}", True),
+      ("block", "{%", "%}", True),
+            
+  ],
+  "scanner": {
+      "variable": [
+         ("number", "(0x)?\d+(\.\d*)?",),
+         ("dotted_name", "[A-Za-z_][A-Za-z_0-9]*(\.[A-Za-z_][A-Za-z_0-9]*)*",)
+         ("pipe", "\|")
+      ]
+      "block": [
+         ("keyword", template_keywords, "(^|[\b\W])", "[\b\W]"),
+      ],
+  },
+  "formats": {
+     "keyword": "%(syntax_keyword)s",
+     "comment": "%(syntax_comment)s",
+     "string":  "%(syntax_string)s",
+     "number":  "%(syntax_number)s",
+  }
+}
+
+
+html_tags = [
+ "a", "address", "b", "blockquote", "code", "em",
+]
+html_attrs = [
+ "class", "id", "name", "size", "src",
+]
+
+html_syntax = {
+  "partitions": [
+      ("comment", "<!--", "-->", True),
+      ("tag", "<", ">", True),
+  ],
+  "scanner": {
+      "tag": [
+         ("string", '"', '"'),        
+         ("name", html_tags, "(^|[\b\W])", "[\b\W]"),
+         ("ident", "[A-Za-z_][A-Za-z_0-9]*"),
+         ("equals", "=")
+      ]
+  },
+  "formats": {
+    "comment": "%(syntax_comment)s",
+  }
+}
+
+
+
+html_template_syntax = {
+}
 fix snippets
 warn about to big files before opening
 check permissions before open/save
-create api documentation using rope
+create api documentation using rope
+interactive highlighter editor (using json-highlighter and test button)