cl01/wp-content/plugins/code-syntax-block/prism-languages.php
2025-02-24 12:39:24 +08:00

68 lines
1.6 KiB
PHP
Executable File

<?php
/**
* Retrieve support languages
* @return array Hash of lang => language
*/
function mkaz_code_syntax_block_get_supported_languages() {
$languages = array(
"apacheconf" => "Apache Config",
"adoc" => "Asciidoc",
"bash" => "Bash/Shell",
"basic" => "BASIC",
"c" => "C-like",
"csharp" => "C#",
"cpp" => "C++",
"css" => "CSS",
"dart" => "Dart",
"django" => "Django",
"docker" => "Docker",
"fsharp" => "F#",
"graphql" => "GraphQL",
"go" => "Go",
"haskell" => "Haskell",
"markup" => "HTML",
"java" => "Java",
"javascript" => "JavaScript",
"json" => "JSON",
"kotlin" => "Kotlin",
"lisp" => "Lisp",
"markdown" => "Markdown",
"matlab" => "MATLAB",
"nginx" => "nginx",
"objectivec" => "Objective-C",
"php" => "PHP",
"powershell" => "PowerShell",
"properties" => ".properties",
"python" => "Python",
"jsx" => "React JSX",
"ruby" => "Ruby",
"rust" => "Rust",
"sass" => "Sass",
"sql" => "SQL",
"svg" => "SVG",
"swift" => "Swift",
"toml" => "TOML",
"typescript" => "TypeScript",
"vim" => "vim",
"visual-basic" => "Visual Basic",
"wasm" => "WebAssembly",
"xml" => "XML",
"yaml" => "YAML",
);
/**
* Filter the list of supported languages for the Syntax Highlighting colors.
* Use this filter to shorten or extend the language shown in the editor interface.
* The array key must match a Prism's supported alias, the array value is a descriptive
* field. For languages and aliases see: https://prismjs.com/#supported-languages
*
* @since 1.1.0
*
* @param string $languages Array of languages supported
*/
return apply_filters( 'mkaz_code_syntax_language_list', $languages );
}