Skip to content

Commit d505642

Browse files
committed
Add popular PHP templating languages to code editor
Smarty and Twig are two very popular PHP templating engines and might be useful to some Bookstack users too.
1 parent 31c28be commit d505642

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

resources/js/code.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ import 'codemirror/mode/python/python';
2626
import 'codemirror/mode/ruby/ruby';
2727
import 'codemirror/mode/rust/rust';
2828
import 'codemirror/mode/shell/shell';
29+
import 'codemirror/mode/smarty/smarty';
2930
import 'codemirror/mode/sql/sql';
3031
import 'codemirror/mode/stex/stex';
3132
import 'codemirror/mode/swift/swift';
3233
import 'codemirror/mode/toml/toml';
34+
import 'codemirror/mode/twig/twig';
3335
import 'codemirror/mode/vb/vb';
3436
import 'codemirror/mode/vbscript/vbscript';
3537
import 'codemirror/mode/xml/xml';
@@ -94,11 +96,13 @@ const modeMap = {
9496
rs: 'rust',
9597
shell: 'shell',
9698
sh: 'shell',
99+
smarty: 'smarty',
97100
sql: 'text/x-sql',
98101
stext: 'text/x-stex',
99102
swift: 'text/x-swift',
100103
toml: 'toml',
101104
ts: 'text/typescript',
105+
twig: 'twig',
102106
typescript: 'text/typescript',
103107
vbs: 'vbscript',
104108
vbscript: 'vbscript',

resources/views/pages/parts/code-editor.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class="popup-background code-editor">
2525
$languages = [
2626
'Bash', 'CSS', 'C', 'C++', 'C#', 'Dart', 'Diff', 'Fortran', 'F#', 'Go', 'Haskell', 'HTML', 'INI',
2727
'Java', 'JavaScript', 'JSON', 'Julia', 'Kotlin', 'LaTeX', 'Lua', 'MarkDown', 'MATLAB', 'Nginx', 'OCaml',
28-
'Octave', 'Pascal', 'Perl', 'PHP', 'Powershell', 'Python', 'Ruby', 'Rust', 'Shell', 'SQL', 'Swift',
29-
'TypeScript', 'VBScript', 'VB.NET', 'XML', 'YAML',
28+
'Octave', 'Pascal', 'Perl', 'PHP', 'Powershell', 'Python', 'Ruby', 'Rust', 'Shell', 'Smarty', 'SQL', 'Swift',
29+
'Twig', 'TypeScript', 'VBScript', 'VB.NET', 'XML', 'YAML',
3030
];
3131
@endphp
3232

0 commit comments

Comments
 (0)