Demo: Syntax Highlighting
More detail: Syntax Highlighting | Hugo
function helloWorld () {
alert("Hello, World!")
}
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
package hello
fun main(args: Array<String>) {
println("Hello World!")
}
#include <stdio.h>
/* Hello */
int main(void){
printf("Hello, World!");
return 0;
}
// 'Hello World!' program
#include <iostream>
int main(){
std::cout << "Hello World!" << std::endl;
return 0;
}
using System;
class HelloWorld{
public static void Main(){
System.Console.WriteLine("Hello, World!");
}
}
<html>
<body>
Hello, World!
</body>
</html>
package main
import fmt "fmt"
func main()
{
fmt.Printf("Hello, World!\n");
}
object HelloWorld with Application {
Console.println("Hello, World!");
}
<?php
echo 'Hello, World!';
?>
print("Hello, World!")
no named code block
## this is a comment
$ echo this is a command
this is a command
## edit the file
$vi foo.md
+++
date = "2014-09-28"
title = "creating a new theme"
+++
bah and humbug
:wq
## show it
$ cat foo.md
+++
date = "2014-09-28"
title = "creating a new theme"
+++
bah and humbug
$
highlight shortcode
example:
{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
// ... code
{{< /highlight >}}
result:
|
|