Syntax
The [syntax] table defines directives for the syntax highlighting support; see syntax highlight for more information and examples.
themeA theme to use for inline styles (optional)mapMap language names to file extensions (optional)profilesProfiles filter that determines when to use syntax highlighting (optional)
Language definitions are resolved by file extension and you can see the list of available languages and file extensions here.
Use the map table to create a mapping between a language identifier and a file extension. For example, let's say we want to use the lowercase rust keyword to refer to the Rust language we map our identfier to a known file extension:
[]
= "rs"
Then when we want to embed Rust code we can use the rust keyword with a fenced code block and the code will be highlighted as Rust:
This mapping technique is useful if you have a lot of existing documents that use an unknown language identifier.