Enhanced Markdown Code¶
Inline code¶
Regular inline code¶
Source Code
This code function human_test() { if empty($soul) { return 'php'; } else { return 'kitty'; } } is PHP.
Highlighted inline code¶
Uses the Pymdown InlineHilite extension
and the Pymdown Highlight extension.
Source Code
This code function human_test() { if empty($soul) { return 'php'; } else { return 'kitty'; } } is PHP.
It’s regular inline code that beings with a shebang (or hashbang, for sticklers) and the language, e.g. #!php.
Code blocks¶
Regular (no language declared)¶
Uses the Pymdown Highlight extension.
Source Code
With syntax highlighting (language declared)¶
Uses the Pymdown SuperFences extension
and the Pymdown Highlight extension.
Source Code
With syntax highlighting, code line highlighting and line numbers¶
Uses the Pymdown SuperFences extension
and the Pymdown Highlight extension.
Regular¶
Source Code
Inside Admonition block¶
Source Code
Code block
Uses the superfences extension to render code blocks here:
Tabbed code blocks¶
Uses the Pymdown SuperFences extension
and the Pymdown Highlight extension.
Source Code
=== "Bash"
```bash
#!/bin/bash
echo "Hello world!"
```
=== "C"
```c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
}
```
=== "C++"
```c++
#include <iostream>
int main() {
std::cout << "Hello world!" << std::endl;
return 0;
}
```
=== "C#"
```c#
using System;
class Program {
static void Main(string[] args) {
Console.WriteLine("Hello world!");
}
}
```