-
Notifications
You must be signed in to change notification settings - Fork 60
Markdown playground
A code block (note that by default, gd2md-html does not add language descriptors to code blocks.
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
A single-cell table also becomes a code block:
#include<stdio.h>
main()
{
printf("Hello World");
}
If you have any smart quotes in "code"
or code blocks, gd2md-html removes them during the conversion:
func main() {
fmt.Println("Why would you do this?")
}
gd2md-html supports an optional lang specification on the first line of the code sample (in the Doc source). The syntax is: lang: langspec
For example, here is a code block that specifies lang:c
on the first line:
#include<stdio.h>
main()
{
printf("Hello World");
}
This also works in single-cell tables: here is a single-cell table that specifies lang: java
on the first line:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World");
}
}
Code with some embedded HTML tags that should be displayed, not interpreted:
This is <code>some code</code>
and some <strong>bold text</strong>.
A single-cell table with some HTML inside:
This is some code
We want to handle as code block;
Preserve whitespace, <code>HTML tags</code>, etc.
Make a fenced code block in Markdown,
pre in HTML.
gd2md-html generates HTML tables.
A table:
Some text. |
some code
|
More text. | A list: |
You can also merge columns and rows in tables:
This row merges the first three columns.
one |
four | ||
one | two |
These two rows are merged
three |
four |
one | two | four |