mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-14 16:07:52 +00:00
Adds a Django Template language: .html/.txt files in a templates folder of a project with manage.py (new [[framework-files]] detection), a Lezer grammar for tags, variables, filters and comments with HTML mounted between them, block folding/indent/matching, {% %} / {{ }} / {# #} pairing, end-tag insertion and completion, per-line {# #} comments, HTML language server and Emmet in the HTML parts, a banner offering the language for HTML files with Django tags elsewhere, a fixture and docs. The built-in HTML syntax check skips Django templates, whose tags the HTML grammar reports as errors.
Refs #2581
Co-authored-by: andreabasile <7715018+andreabasile@users.noreply.github.com>
24 lines
793 B
TOML
24 lines
793 B
TOML
id = "django-html"
|
|
name = "Django Template"
|
|
extensions = ["djhtml"]
|
|
block-comment = ["{#", "#}"]
|
|
indent = { tab-size = 2, insert-spaces = true }
|
|
ui-mode = "Django Template"
|
|
tree-sitter = "html"
|
|
|
|
# Django projects: the HTML and text files in a `templates` folder.
|
|
[[framework-files]]
|
|
folder = "templates"
|
|
extensions = ["html", "txt"]
|
|
root-markers = ["manage.py"]
|
|
|
|
# The markup between the template tags: completion and hover of tags and
|
|
# attributes. The template tags are text to it. No formatter: HTML formatters
|
|
# reflow template tags.
|
|
[[language-servers]]
|
|
name = "vscode-html-language-server"
|
|
command = "vscode-html-language-server"
|
|
args = ["--stdio"]
|
|
initialization-options = { embeddedLanguages = { css = true, javascript = true } }
|
|
install-hint = "npm i -g vscode-langservers-extracted"
|