From a3bfca22b5fae8675e689c21fe1c39d3f3873253 Mon Sep 17 00:00:00 2001 From: Paul Lhussiez Date: Mon, 9 Sep 2019 15:45:44 +0200 Subject: [PATCH] Code display option --- pages/cheatsheet.md | 277 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 215 insertions(+), 62 deletions(-) diff --git a/pages/cheatsheet.md b/pages/cheatsheet.md index f88d4d0..42b4795 100644 --- a/pages/cheatsheet.md +++ b/pages/cheatsheet.md @@ -18,16 +18,6 @@ For every example, the raw markdown is given first. ## Specify Language - ```go - package main - - import "fmt" - - func main() { - fmt.Println("Hello World") - } - ``` - ```go package main @@ -38,9 +28,9 @@ func main() { } ``` -## Without Language +
Code - ``` + ```go package main import "fmt" @@ -49,6 +39,9 @@ func main() { fmt.Println("Hello World") } ``` +
+ +## Without Language ``` package main @@ -60,110 +53,149 @@ func main() { } ``` +
Code + + ``` + package main + + import "fmt" + + func main() { + fmt.Println("Hello World") + } + ``` +
+ ## Inline Code -```md This `text` should be displayed as `code`. Also, let's `try with a lot of chars as well`. -``` +
Code + +```md This `text` should be displayed as `code`. Also, let's `try with a lot of chars as well`. +``` +
# Admonitions ## With Title -```md !!! note "Title" This is a `note` with a title. -``` +
Code + +```md !!! note "Title" This is a `note` with a title. +``` +
## Without Title -```md !!! warning This is a `warning` admonition without a title. -``` +
Code + +```md !!! warning This is a `warning` admonition without a title. +``` +
## Extra Class -```md !!! danger wow "wow" This a `danger` admonition with the `wow` CSS class. -``` +
Code + +```md !!! danger wow "wow" This a `danger` admonition with the `wow` CSS class. +``` +
## Unknown Type -```md !!! unknown "Unknown Admonition Type" This is an `unknown` admonition, it will render just like a `note`/`info` one. -``` +
Code + +```md !!! unknown "Unknown Admonition Type" This is an `unknown` admonition, it will render just like a `note`/`info` one. +``` +
# Tables ## With Heading -```md | Column 1 | Column 2 | |------------|-----------| | First Row | First Row | | Third Row | Third Row | -``` +
Code + +```md | Column 1 | Column 2 | |------------|-----------| | First Row | First Row | | Third Row | Third Row | +``` +
## Without Heading -```md | | | |------------|------------| | First Row | First Row | | Second Row | Second Row | | Third Row | Third Row | -``` +
Code + +```md | | | |------------|------------| | First Row | First Row | | Second Row | Second Row | | Third Row | Third Row | +``` +
## Markdown Inside -```md | Column 1 | Column 2 | |----------------|----------------| -| **First Row** | _First Row_ | +| **First Row** | _First Row_ | | `Second Row` | ~~Second Row~~ | -``` +
Code + +```md | Column 1 | Column 2 | |----------------|----------------| -| **First Row** | _First Row_ | +| **First Row** | _First Row_ | | `Second Row` | ~~Second Row~~ | +``` +
# Paragraphs +## Simple + Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud _exercitation_ ullamco laboris nisi ut aliquip ex ea commodo @@ -173,31 +205,134 @@ cillum dolore eu fugiat nulla [pariatur](/). Excepteur sint occaecat cupidatat `non` proident, sunt in culpa qui officia deserunt mollit anim id est laborum. +
Code + +```md +Lorem ipsum dolor sit amet, **consectetur adipiscing** elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud _exercitation_ ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in ~~reprehenderit~~ in voluptate velit esse +cillum dolore eu fugiat nulla [pariatur](/). + +Excepteur sint occaecat cupidatat `non` proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. +``` +
+ +## Collapse + +## Simple Collapse + +
Click to open + +Markdown **content** + +```go +fmt.Println("Can contain code") +``` +
+ +
Code + +
+ Click to open + + Markdown **content** + + ```go + fmt.Println("Can contain code") + ``` +
+
+ +## Already Opened + +
Click to close + +This is my markdown content. +
+ +
Code + +
+ Click to close + + This is my markdown content. +
+
+ +## With Admonition Class + +
Warning Details + +A warning collapsible +
+ +
Code + +
+ Warning Details + + A warning collapsible +
+
+ +## Code + +
Code + +```go +// This is a custom detail just for code showing +fmt.Println("CODE!") +``` +
+ +
Code + +
+ Code + + ```go + // This is a custom detail just for code showing + fmt.Println("CODE!") + ``` +
+
+ # Pictures ## Simple Picture -```md ![test](/assets/avatar.jpg) -``` +
Code + +```md ![test](/assets/avatar.jpg) +``` +
## Picture with hover title -```md ![test](/assets/avatar.jpg "Doge") -``` +
Code + +```md ![test](/assets/avatar.jpg "Doge") +``` +
## Picture with Caption -```md ![test](/assets/avatar.jpg) *Picture Caption or Description* -``` +
Code + +```md ![test](/assets/avatar.jpg) *Picture Caption or Description* +``` +
## Side-by-side Pictures @@ -206,43 +341,46 @@ culpa qui officia deserunt mollit anim id est laborum. # Footnote - This is a footnote.[^1] - [^1]: The footnote text. - This is a footnote.[^1] [^1]: The footnote text. +
Code + + This is a footnote.[^1] + [^1]: The footnote text. +
+ # Lists ## Unordered - - Simple bullet lists, starting with `+`, `-` or `*` - - Add sublists by indenting - - Either with a tab or multiple spaces - - This will create a sublist - - Simple bullet lists, starting with `+`, `-` or `*` - Add sublists by indenting - Either with a tab or multiple spaces - This will create a sublist -## Ordered +
Code - 1. Lorem ipsum dolor sit amet - 2. Consectetur adipiscing elit - 3. Integer molestie lorem at massa + - Simple bullet lists, starting with `+`, `-` or `*` + - Add sublists by indenting + - Either with a tab or multiple spaces + - This will create a sublist +
+ +## Ordered 1. Lorem ipsum dolor sit amet 2. Consectetur adipiscing elit 3. Integer molestie lorem at massa -## Definition List +
Code - Golang - : AKA the Go Programming Language. + 1. Lorem ipsum dolor sit amet + 2. Consectetur adipiscing elit + 3. Integer molestie lorem at massa +
- Markdown - : Custom format to write stuff and translate it to HTML +## Definition List Golang : AKA the Go Programming Language. @@ -250,28 +388,43 @@ Golang Markdown : Custom format to write stuff and translate it to HTML +
Code + + Golang + : AKA the Go Programming Language. + + Markdown + : Custom format to write stuff and translate it to HTML +
+ # Quotes ## Anonymous Quote +> This is a quote. +> It can span on multiple lines. +> +> Like that I guess. + +
Code + > This is a quote. > It can span on multiple lines. > > Like that I guess. +
-> This is a quote. -> It can span on multiple lines. +## Citation Quote + +> This quote might be famous, so make sure you credit whoever said or wrote +> that. I mean, it's pretty important. > -> Like that I guess. +> Me -## Citation Quote +
Code > This quote might be famous, so make sure you credit whoever said or wrote > that. I mean, it's pretty important. > > Me - -> This quote might be famous, so make sure you credit whoever said or wrote -> that. I mean, it's pretty important. -> -> Me \ No newline at end of file +
\ No newline at end of file