Support code block highlighting template syntax and export code block templates as paragraphs (#15345)

*  feat: 优化模板编辑体验,支持使用代码块来存储模板语法

*  feat: 支持对template代码块进行高亮

- 渲染.action 块和{{}}块规则
- 渲染Markdown块
- 思源块属性设置语法

* Update third-languages.js

* Update third-languages.js

* Update third-languages.js

* Update third-languages.js

* Update third-languages.js:块属性支持高亮.action{}语法,调整relevance

* 支持渲染queryBlocks的sql语句和嵌入块sql语句

* Update third-languages.js

补充变量高亮:getHPathByID|getBlock|statBlock|runeCount|wordCount|toPrettyJson|

*  feat: 优化模板编辑体验,支持使用代码块来存储模板语法 #15345

导出时,增加识别`siyuan-template`代码块为模板

*  feat: 优化模板编辑体验,支持使用代码块来存储模板语法 #15345

代码块语言新增`siyuan-template`

* Update template.go

---------

Co-authored-by: D <845765@qq.com>
This commit is contained in:
Achuan-2 2025-07-29 21:36:34 +08:00 committed by GitHub
parent 2994969286
commit 009a68aa7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 256 additions and 1 deletions

View file

@ -758,7 +758,7 @@ export abstract class Constants {
// common: "bash", "c", "csharp", "cpp", "css", "diff", "go", "xml", "json", "java", "javascript", "kotlin", "less", "lua", "makefile", "markdown", "objectivec", "php", "php-template", "perl", "plaintext", "python", "python-repl", "r", "ruby", "rust", "scss", "sql", "shell", "swift", "ini", "typescript", "vbnet", "yaml", "properties", "1c", "armasm", "avrasm", "actionscript", "ada", "angelscript", "accesslog", "apache", "applescript", "arcade", "arduino", "asciidoc", "aspectj", "abnf", "autohotkey", "autoit", "awk", "basic", "bnf", "dos", "brainfuck", "cal", "cmake", "csp", "cos", "capnproto", "ceylon", "clean", "clojure", "clojure-repl", "coffeescript", "coq", "crystal", "d", "dns", "dart", "delphi", "dts", "django", "dockerfile", "dust", "erb", "elixir", "elm", "erlang", "erlang-repl", "excel", "ebnf", "fsharp", "fix", "flix", "fortran", "gcode", "gams", "gauss", "glsl", "gml", "gherkin", "golo", "gradle", "groovy", "haml", "hsp", "http", "handlebars", "haskell", "haxe", "hy", "irpf90", "isbl", "inform7", "x86asm", "jboss-cli", "julia", "julia-repl", "ldif", "llvm", "lsl", "latex", "lasso", "leaf", "lisp", "livecodeserver", "livescript", "mel", "mipsasm", "matlab", "maxima", "mercury", "axapta", "routeros", "mizar", "mojolicious", "monkey", "moonscript", "n1ql", "nsis", "nestedtext", "nginx", "nim", "nix", "node-repl", "ocaml", "openscad", "ruleslanguage", "oxygene", "pf", "parser3", "pony", "pgsql", "powershell", "processing", "prolog", "protobuf", "puppet", "purebasic", "profile", "q", "qml", "reasonml", "rib", "rsl", "roboconf", "sas", "sml", "sqf", "step21", "scala", "scheme", "scilab", "smali", "smalltalk", "stan", "stata", "stylus", "subunit", "tp", "taggerscript", "tcl", "tap", "thrift", "twig", "vbscript", "vbscript-html", "vhdl", "vala", "verilog", "vim", "wasm", "mathematica", "wren", "xl", "xquery", "zephir", "crmsh", "dsconfig", "graphql",
// third: "yul", "solidity", "abap", "hlsl", "gdscript"
public static readonly ALIAS_CODE_LANGUAGES: string[] = [
"js", "ts", "html", "toml", "c#", "bat",
"js", "ts", "html", "toml", "c#", "bat", "siyuan-template"
];
public static readonly SIYUAN_RENDER_CODE_LANGUAGES: string[] = [
"abc", "plantuml", "mermaid", "flowchart", "echarts", "mindmap", "graphviz", "math"