Code Syntax Blockプラグインで選択可能な言語を変更する

概要

WordPressのCode Syntax Blockプラグインはデフォルトでは選択可能な言語がフィルタされていて、使いたい言語が表示されていませんでした。

WordPressのUIからは設定を変更できないため、プラグインのソースコードを変更しました。

言語リストの変更

WordPressの仮想マシンにSSHして、/var/www/html/wp-content/plugins/code-syntax-block/prism-languages.php を編集します。

Prism – Supported Languages から使いそうな言語を追加しました。

12d11
<               "basic" => "BASIC",
14d12
<               "csharp" => "C#",
17c15
<               "dart" => "Dart",
>               "diff" => "Diff",
20,21c18,22
<               "fsharp" => "F#",
<               "graphql" => "GraphQL",
>               "dot" => "DOT (Graphviz)",
>               "erb" => "ERB",
>               "gherkin" => "Gherkin",
>               "git" => "Git",
>               "gitignore" => ".gitignore",
23c24,25
<               "haskell" => "Haskell",
<               "groovy" => "Groovy",
>               "http" => "HTTP",
24a27
>               "ini" => "Ini",
25a29
>               "javadoc" => "JavaDoc",
26a31
>               "jinja2" => "Jinja2",
28,29c33,37
<               "kotlin" => "Kotlin",
<               "lisp" => "Lisp",
>               "jsonp" => "JSONP",
>               "jq" => "JQ",
>               "latex" => "LaTeX",
>               "log" => "Log file",
>               "makefile" => "Makefile",
31c39
<               "matlab" => "MATLAB",
>               "mongodb" => "MongoDB",
33c41
<               "objectivec" => "Objective-C",
>               "perl" => "Perl",
35c43,44
<               "powershell" => "PowerShell",
>               "prolog" => "Prolog",
>               "promql" => "PromQL",
36a46
>               "protobuf" => "Protocol Buffers",
38c48,49
<               "jsx" => "React JSX",
>               "qml" => "QML",
>               "regex" => "Regex",
41,42c52,53
<               "rust" => "Rust",
<               "sass" => "Sass",
>               "scala" => "scala",
>               "splunk-sql" => "Splunk SPL",
45d55
<               "swift" => "Swift",
47a58
>               "uri" => "URI",
49d59
<               "visual-basic" => "Visual Basic", 

参考

コメントする