diff --git a/source/_posts/quickref.md b/source/_posts/quickref.md index bacc264..531d546 100644 --- a/source/_posts/quickref.md +++ b/source/_posts/quickref.md @@ -3,42 +3,37 @@ title: CheatSheets date: 2020-11-25 18:28:43 background: bg-gradient-to-l from-green-400 to-blue-500 hover:from-pink-500 hover:to-yellow-500 tags: - - guide - - reference + - guide + - reference categories: - - Other -intro: This is the magic syntax variant manual that you can use on CheatSheets.zip, It's a good practice for contributors. + - Other +intro: + This is the magic syntax variant manual that you can use on CheatSheets.zip, It's a good practice for contributors. plugins: - - copyCode + - copyCode --- - - -Getting Started --------------------- +## Getting Started ### Develop Setup - Clone Repository [View on Github](https://github.com/Fechin/reference.git) - ```shell script {.wrap} - $ git clone https://github.com/Fechin/reference.git - ``` + ```shell script {.wrap} + $ git clone https://github.com/Fechin/reference.git + ``` - Install Dependencies in the project directory - ```shell script - $ npm install - ``` + ```shell script + $ npm install + ``` - Start a Dev Server [http://localhost:4000](http://localhost:4000) - ```shell script - $ npm run dev - ``` + ```shell script + $ npm run dev + ``` - Create or modify `source/_posts/{name}.md` -- Send us pull request and chill -{.marker-timeline} - -It's a good practice to refer to the source code of the [CheatSheets reference](https://github.com/Fechin/reference/blob/main/source/_posts/quickref.md). - - +- Send us pull request and chill {.marker-timeline} +It's a good practice to refer to the source code of the +[CheatSheets reference](https://github.com/Fechin/reference/blob/main/source/_posts/quickref.md). ### Directory Structure @@ -67,7 +62,7 @@ It's a good practice to refer to the source code of the [CheatSheets reference]( ```yaml . -├── Section 1 +├── Section 1 # Header │ ├── Card 1 │ ├── Card 2 │ ├── Card 3 @@ -90,18 +85,18 @@ It's a good practice to refer to the source code of the [CheatSheets reference]( ├── Section 4 └── ... ``` ---------- + +--- + - One cheatsheet contains multiple sections - One section contains multiple cards - One card can contain Code, Table, List and Paragraph - One list can contain Code and Paragraph - One table can contain Code and Paragraph - - ### Syntax Variants -- [Section Variants](#section-variants) +- [Section Variants](#section-variants) - [Card Variants](#card-variants) - [Table Variants](#table-variants) - [List Variants](#list-variants) @@ -111,60 +106,52 @@ It's a good practice to refer to the source code of the [CheatSheets reference]( All the magic variants supported by CheatSheets.zip - -### Create source/_posts/demo.md +### Create source/\_posts/demo.md ```markdown -Getting Started ---------------- +## Getting Started ### List Card {.col-span-2} + - Share quick reference -- Cheatsheet for developers -... -{.style-timeline} +- Cheatsheet for developers ... {.style-timeline} ### Table Card -| id | name | -|----|---------| -| 1 | Roberta | + +| id | name | +| --- | ------- | +| 1 | Roberta | + {.show-header} ``` - - - - -Section Variants --------------------- +## Section Variants ### Section Overview {.secondary} - | - | - | -|-------------|---------------------------------| +| ----------- | ------------------------------- | | `{.cols-1}` | one-column layout | | `{.cols-2}` | two-column layout | | `{.cols-3}` | three-column layout _(default)_ | | ... | | | `{.cols-6}` | six-column layout | -------- +--- + - Section contains multiple cards - Use {.cols-`n`} to specify section as a `n`-column layout - Click the preview button below to focus on the section [Preview](/quickref#section-variants) {.link-arrow} - - - ### .cols-1 + ```text # One Column Example {.cols-1} -╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ -┆ 1 ┆ -╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ +╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ +┆ 1 ┆ +╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ┆ 2 ┆ ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ @@ -173,19 +160,17 @@ Section Variants #### ↓ Source Code ```markdown -One Column Example {.cols-1} ----------- +## One Column Example {.cols-1} ### 1 + ### 2 ``` [Preview](resolutions#lists-of-resolutions) {.link-arrow} - - - ### .cols-2 + ```text # Two Columns Example ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ @@ -199,19 +184,17 @@ One Column Example {.cols-1} #### ↓ Source Code ```markdown -Two Columns Example {.cols-2} ----------- +## Two Columns Example {.cols-2} ### 1 + ### 2 + ### 3 ``` [Preview](resolutions#getting-started) {.link-arrow} - - - ### .cols-3 (default) ```text @@ -219,66 +202,61 @@ Two Columns Example {.cols-2} ╭┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ ╰┈┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈┈╯ -╭┈┈┈┈┈┈┈┈┈┈╮ -┆ 4 ┆ -╰┈┈┈┈┈┈┈┈┈┈╯ +╭┈┈┈┈┈┈┈┈┈┈╮ +┆ 4 ┆ +╰┈┈┈┈┈┈┈┈┈┈╯ ``` #### ↓ Source Code ```markdown -Default ----------- +## Default ### 1 + ### 2 + ### 3 + ### 4 ``` - - - -Card Variants --------------------- +## Card Variants ### Card Overview {.secondary} #### Specifies the number of columns the card spans -| - | - | -|-----------------|---| -| `{.col-span-2}` | [Example](#col-span-2) | -| `{.col-span-3}` | | -| ... | | -| `.col-span-6}` | | +| - | - | +| --------------- | ---------------------- | +| `{.col-span-2}` | [Example](#col-span-2) | +| `{.col-span-3}` | | +| ... | | +| `.col-span-6}` | | #### Specifies the number of rows the card spans {.text-left} -| - | - | -|-----------------|---| -| `{.row-span-2}` | [Example](#row-span-2) | -| `{.row-span-3}` | | -| ... | | -| `{.row-span-6}` | | +| - | - | +| --------------- | ---------------------- | +| `{.row-span-2}` | [Example](#row-span-2) | +| `{.row-span-3}` | | +| ... | | +| `{.row-span-6}` | | #### Emphasize card (aka `H3` Section) -| - | - | -|----------------|-------------------------------------------------------| -| `{.primary}` | Red titles, [Example](#primary-card) | +| - | - | +| -------------- | ----------------------------------------- | +| `{.primary}` | Red titles, [Example](#primary-card) | | `{.secondary}` | Yellow titles, [Example](#secondary-card) | A complete example: [Cards Example](#cards-example) - - - ### .col-span-2 {.row-span-2} #### The fifth card spans two columns -```markdown +```text ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ @@ -286,18 +264,24 @@ A complete example: [Cards Example](#cards-example) ┆ 4 ┆ ┆ 5 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ ``` ------------ + +--- + ```markdown ### 1 + ### 2 + ### 3 + ### 4 + ### 5 {.col-span-2} ``` #### The second card spans two columns -```markdown +```text ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ @@ -305,43 +289,51 @@ A complete example: [Cards Example](#cards-example) ┆ 3 ┆ ┆ 4 ┆ ┆ 5 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ``` ------------ + +--- + ```markdown ### 1 + ### 2 {.col-span-2} + ### 3 + ### 4 + ### 5 ``` #### The fourth card spans two columns -```markdown +```text ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ -╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ -┆ 4 ┆ ┆ 5 ┆ -╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ +╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ +┆ 4 ┆ ┆ 5 ┆ +╰┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ``` ------------ + +--- + ```markdown ### 1 + ### 2 + ### 3 + ### 4 {.col-span-2} + ### 5 ``` - - - - ### .row-span-2 {.row-span-2} #### The first card spans two rows -```markdown +```text ╭┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ ┆ ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ @@ -349,18 +341,24 @@ A complete example: [Cards Example](#cards-example) ┆ ┆ ┆ 4 ┆ ┆ 5 ┆ ╰┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ``` ----------- + +--- + ```markdown ### 1 {.row-span-2} + ### 2 + ### 3 + ### 4 + ### 5 ``` #### The second card spans two rows -```markdown +```text ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ┆ ┆ ╰┈┈┈┈┈┈┈┈┈╯ @@ -368,40 +366,49 @@ A complete example: [Cards Example](#cards-example) ┆ 4 ┆ ┆ ┆ ┆ 5 ┆ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ``` ---------- + +--- + ```markdown ### 1 + ### 2 {.row-span-2} + ### 3 + ### 4 + ### 5 ``` #### The third card spans two rows -```markdown -╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈╮ -┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ -╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ┆ ┆ -╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ ┆ -┆ 4 ┆ ┆ 5 ┆ ┆ ┆ -╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈╯ +```text +╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈╮ +┆ 1 ┆ ┆ 2 ┆ ┆ 3 ┆ +╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ┆ ┆ +╭┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ ┆ +┆ 4 ┆ ┆ 5 ┆ ┆ ┆ +╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈┈┈┈┈┈╯ ``` ------------ + +--- + ```markdown ### 1 + ### 2 + ### 3 {.row-span-2} + ### 4 + ### 5 ``` - - - ### .col-span-2 .row-span-2 -```markdown +```text ╭┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈╮ ╭┈┈┈┈┈┈┈┈┈╮ ┆ 1 ┆ ┆ 2 ┆ ┆ ┆ ╰┈┈┈┈┈┈┈┈┈╯ @@ -417,23 +424,24 @@ A complete example: [Cards Example](#cards-example) ```markdown ### 1 {.col-span-2 .row-span-2} + ### 2 + ### 3 + ### 4 + ### 5 ``` + Spans rows and columns at the same time - - - -Table Variants --------------------- +## Table Variants ### Table Overview {.secondary} | - | - | -|------------------|------------------------------| +| ---------------- | ---------------------------- | | `{.show-header}` | Show the header of the table | | `{.shortcuts}` | Render shortcut key style | | `{.bold-first}` | Bold first column | @@ -442,13 +450,10 @@ Table Variants | `{.left-text}` | Align the last column left | | `{.no-wrap}` | Don't wrap text | - - - ### Basic table | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | @@ -457,113 +462,106 @@ Table Variants ```markdown | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | ``` - - - ### .shortcuts -| - | - | -|-------------|------------| -| `Ctrl` `N` | New File | -| `Ctrl` `S` | Save | +| - | - | +| ---------- | -------- | +| `Ctrl` `N` | New File | +| `Ctrl` `S` | Save | + {.shortcuts} #### ↓ Source Code ```markdown -| - | - | -|-------------|------------| -| `Ctrl` `N` | New File | -| `Ctrl` `S` | Save | +| - | - | +| ---------- | -------- | +| `Ctrl` `N` | New File | +| `Ctrl` `S` | Save | + {.shortcuts} ``` - - - ### .show-header | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.show-header} #### ↓ Source Code ```markdown | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.show-header} ``` - - - ### .left-text | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.left-text} #### ↓ Source Code ```markdown | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.left-text} ``` - - - ### .bold-first | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.bold-first} #### ↓ Source Code ```markdown | Pattern | Description | -|----------|------------------------| +| -------- | ---------------------- | | `[abc]` | Match a, b or c | | `[^abc]` | Match except a, b or c | | `[a-z]` | Match a to z | + {.bold-first} ``` - - - -List Variants --------------------- +## List Variants ### List Overview {.secondary} + List columns | - | - | -|-------------|------------------------| +| ----------- | ---------------------- | | `{.cols-1}` | one column _(default)_ | | `{.cols-2}` | two columns | | ... | | @@ -571,16 +569,14 @@ List columns List markers -| - | - | -|------------|------------------------| -| `{.marker-none}` | Marker is not set | -| `{.marker-timeline}` | Marker style like timeline | -| `{.marker-round}` | Round marker | - - - +| - | - | +| -------------------- | -------------------------- | +| `{.marker-none}` | Marker is not set | +| `{.marker-timeline}` | Marker style like timeline | +| `{.marker-round}` | Round marker | ### One Column (Default) + - Share quick reference. - cheat sheet for developers. - Contributed by open source angels. @@ -595,10 +591,8 @@ List markers - Manage your code snippets. ``` - - - ### .cols-3 + - Share - Quick - Reference @@ -606,9 +600,11 @@ List markers - Cheat Sheet - For - Developers - {.cols-3} + +{.cols-3} #### ↓ Source Code + ```markdown - Share - Quick @@ -617,104 +613,98 @@ List markers - Cheat Sheet - For - Developers + {.cols-3} ``` - - - ### .marker-timeline {.row-span-2} + - **Renamed** to `new_name` - ```shell script - $ git branch -m - ``` + ```shell script + $ git branch -m + ``` - **Push** and reset - ```shell script - $ git push origin -u - ``` -- **Delete** remote branch - ```shell script - $ git push origin --delete - ``` + ```shell script + $ git push origin -u + ``` +- **Delete** remote branch `shell script $ git push origin --delete ` + {.marker-timeline} #### ↓ Source Code -```markdown + +````markdown - **Renamed** to `new_name` - ```shell script - $ git branch -m - ``` + ```shell script + $ git branch -m + ``` - **Push** and reset - ```shell script - $ git push origin -u - ``` -- **Delete** remote branch - ```shell script - $ git push origin --delete - ``` + ```shell script + $ git push origin -u + ``` +- **Delete** remote branch `shell script $ git push origin --delete ` + {.marker-timeline} -``` - - - +```` ### .marker-none + - Share - Quick - Reference - And - Cheat Sheet - {.cols-2 .marker-none} + +{.cols-2 .marker-none} #### ↓ Source Code + ```markdown - Share - Quick - Reference - And - Cheat Sheet + {.cols-2 .marker-none} ``` - - - ### .marker-round + - Share - Quick - Reference - {.marker-round} + +{.marker-round} #### ↓ Source Code + ```markdown - Share - Quick - Reference + {.marker-round} ``` - - - -Code Variants --------------------- +## Code Variants ### Basic code ```js cheatsheets.zip.is(() => { - awesome.site() -}) + awesome.site(); +}); ``` ```js -here.is.some.more() +here.is.some.more(); ``` #### ↓ Source Code -```markdown -```js +`````markdown +````js cheatsheets.zip.is(() => { awesome.site() }) @@ -723,49 +713,47 @@ cheatsheets.zip.is(() => { ```js here.is.some.more() \``` -``` +```` +````` Code blocks can be placed one after the other. - - - ### Code with headings #### index.js ```js cheatsheets.zip.is(() => { - awesome.site() -}) + awesome.site(); +}); ``` #### other.js ```js -here.is.some.more() +here.is.some.more(); ``` #### ↓ Source Code -```markdown +````markdown #### index.js + ```js cheatsheets.zip.is(() => { - awesome.site() -}) -\``` -#### other.js -```js -here.is.some.more() -\``` + awesome.site(); +}); ``` +#### other.js + +```js +here.is.some.more(); +``` +```` + Code blocks can have headings. - - - ### Line wrapping ```js {.wrap} @@ -774,17 +762,14 @@ Code blocks can have headings. #### ↓ Source Code -```markdown {.wrap} +````markdown {.wrap} ```js {.wrap} -\``` ``` +```` Add `{.wrap}` to wrap long lines. - - - ### Long lines (default) ```js @@ -795,28 +780,20 @@ function createNode(nodeName: string, options: { key: string }) { Long lines will have scrollbars. - - - -Paragraph Variants --------------------- +## Paragraph Variants ### Header paragraphs The text that appears in the header - #### ↓ Source Code ```markdown {.wrap} ### Basic paragraphs + The text that appears in the header - ``` - - - ### Middle paragraphs {.row-span-2} - This is a list @@ -825,12 +802,13 @@ This paragraph will appear in the middle ```js cheatsheets.is(() => { - awesome.site() -}) + awesome.site(); +}); ``` #### ↓ Source Code -```markdown + +````markdown ### Middle paragraphs - This is a list @@ -839,37 +817,32 @@ This paragraph will appear in the middle ```js cheatsheets.is(() => { - awesome.site() -}) -\``` + awesome.site(); +}); ``` - - - +```` ### Footer paragraphs {.row-span-2} ```js cheatsheets.is(() => { - awesome.site() -}) + awesome.site(); +}); ``` #### ↓ Source Code -```markdown + +````markdown ```js cheatsheets.is(() => { - awesome.site() -}) -\``` - -This paragraph will appear in the footer + awesome.site(); +}); ``` This paragraph will appear in the footer +```` - - +This paragraph will appear in the footer ### Crosslink @@ -881,51 +854,36 @@ Add `{.link-arrow}` to make big loud external links: [Home](/) {.link-arrow} +## Cards Example - - -Cards Example --------------------- - -### row-span-2 {.row-span-2} +### row-span-2 {.row-span-2} ``` 1 ``` - - - -### col-span-2 {.col-span-2} +### col-span-2 {.col-span-2} ``` 2 ``` - - - ### Primary Card {.primary} ``` 3 ``` + Add `{.primary}` to make the title red. - - - ### Secondary Card {.secondary} ``` 4 ``` + Add `{.secondary}` to make the title yellow. - - - - ### col-span-3 {.col-span-3} ```