|
| 1 | +# Markdown Cheat Sheet |
| 2 | + |
| 3 | +Checkout `docs/md/docs/cheat-sheet.md` to see the markdown behind this page. Note that this is only |
| 4 | +a cheat-sheet, for a more complete list of specific markdown features of codedoc, check out the [official docs](https://codedoc.cc). |
| 5 | + |
| 6 | +> :Buttons |
| 7 | +> > :Button label=Official Docs, url=https://codedoc.cc |
| 8 | +
|
| 9 | +<br> |
| 10 | + |
| 11 | +> ⚠️⚠️ |
| 12 | +> Do not forget to **REMOVE THIS PAGE** from your actual documentation! |
| 13 | +> ⚠️⚠️ |
| 14 | +
|
| 15 | +<hr> |
| 16 | + |
| 17 | +## Buttons |
| 18 | + |
| 19 | +You can add buttons to your documents like this: |
| 20 | + |
| 21 | +```md | some-doc.md |
| 22 | +> :Buttons |
| 23 | +> > :Button label=Click Me!, url=https://www.google.com |
| 24 | +> |
| 25 | +> > :Button label=Click Me Too!, url=https://www.github.com |
| 26 | +``` |
| 27 | + |
| 28 | +Which looks like this: |
| 29 | + |
| 30 | +> :Buttons |
| 31 | +> > :Button label=Click Me!, url=https://www.google.com |
| 32 | +> |
| 33 | +> > :Button label=Click Me Too!, url=https://www.github.com |
| 34 | +
|
| 35 | +<br> |
| 36 | + |
| 37 | +You can create icon buttons as well. By default material icons are used: |
| 38 | + |
| 39 | +```md | some-doc.md |
| 40 | +> :Buttons |
| 41 | +> > :Button icon=true, label=android, url=https://www.google.com |
| 42 | +> |
| 43 | +> > :Button icon=true, label=code, url=https://www.github.com |
| 44 | +> |
| 45 | +> > :Button label=GitHub, url=https://www.github.com |
| 46 | +``` |
| 47 | + |
| 48 | +Which looks like this: |
| 49 | + |
| 50 | +> :Buttons |
| 51 | +> > :Button icon=true, label=android, url=https://www.google.com |
| 52 | +> |
| 53 | +> > :Button icon=true, label=code, url=https://www.github.com |
| 54 | +> |
| 55 | +> > :Button label=GitHub, url=https://www.github.com |
| 56 | +
|
| 57 | + |
| 58 | +<br> |
| 59 | + |
| 60 | +You can add a copy button after a `code` element. This button would |
| 61 | +copy the contents of the `code` element. |
| 62 | + |
| 63 | +```md | some-doc.md |
| 64 | +> :Buttons |
| 65 | +> > :CopyButton |
| 66 | +``` |
| 67 | +> :Buttons |
| 68 | +> > :CopyButton |
| 69 | +
|
| 70 | +<hr> |
| 71 | + |
| 72 | +## Tabs |
| 73 | + |
| 74 | +You can add tabbed content like this: |
| 75 | + |
| 76 | +```md | some-doc.md |
| 77 | +> :Tabs |
| 78 | +> > :Tab title=First Tab |
| 79 | +> > |
| 80 | +> > So this is the content of the first tab. Lets even have some code here: |
| 81 | +> > ```tsx | index.tsx |
| 82 | +> > import { Renderer } from '@connectv/html'; |
| 83 | +> > |
| 84 | +> > const renderer = new Renderer(); |
| 85 | +> > renderer.render(<div>Hellow World!</div>).on(document.body); |
| 86 | +> > ``` |
| 87 | +> |
| 88 | +> > :Tab title=Second Tab |
| 89 | +> > |
| 90 | +> > Perhaps some other content here, maybe some more code? |
| 91 | +> > |
| 92 | +> > ```tsx | another.tsx |
| 93 | +> > import { Renderer } from '@connectv/html'; |
| 94 | +> > import { timer } from 'rxjs'; |
| 95 | +> > |
| 96 | +> > const renderer = new Renderer(); |
| 97 | +> > renderer.render(<div>You have been here for {timer(0, 1000)} second(s).</div>) |
| 98 | +> > .on(document.body); |
| 99 | +> > ``` |
| 100 | +``` |
| 101 | + |
| 102 | +<br> |
| 103 | + |
| 104 | +> :Tabs |
| 105 | +> > :Tab title=First Tab |
| 106 | +> > |
| 107 | +> > So this is the content of the first tab. Lets even have some code here: |
| 108 | +> > ```tsx | index.tsx |
| 109 | +> > import { Renderer } from '@connectv/html'; |
| 110 | +> > |
| 111 | +> > const renderer = new Renderer(); |
| 112 | +> > renderer.render(<div>Hellow World!</div>).on(document.body); |
| 113 | +> > ``` |
| 114 | +> |
| 115 | +> > :Tab title=Second Tab |
| 116 | +> > |
| 117 | +> > Perhaps some other content here, maybe some more code? |
| 118 | +> > |
| 119 | +> > ```tsx | another.tsx |
| 120 | +> > import { Renderer } from '@connectv/html'; |
| 121 | +> > import { timer } from 'rxjs'; |
| 122 | +> > |
| 123 | +> > const renderer = new Renderer(); |
| 124 | +> > renderer.render(<div>You have been here for {timer(0, 1000)} second(s).</div>) |
| 125 | +> > .on(document.body); |
| 126 | +> > ``` |
| 127 | +
|
| 128 | +<hr> |
| 129 | +
|
| 130 | +## Collapse |
| 131 | +
|
| 132 | +You can add collapsible sections like this: |
| 133 | +
|
| 134 | +```md | some-doc.md |
| 135 | +> :Collapse label=Collapsible content (click to open) |
| 136 | +> |
| 137 | +> This content is collapsed by default. You can write _any_ markdown syntax you would |
| 138 | +> like here as this is simply just an enhanced `block quote` element. You can even have lists: |
| 139 | +> - with multiple |
| 140 | +> - items and stuff |
| 141 | +> |
| 142 | +> > :Collapse label=Or nested collapsible content (click to open) |
| 143 | +> > |
| 144 | +> > > :Collapse label=Collapception |
| 145 | +> > > |
| 146 | +> > > To any depth that your heart might desire. |
| 147 | +> |
| 148 | +> This component is particularly useful in the table of contents (the left-side menu, activatable by |
| 149 | +> clicking on the hamburger menu in the footer), when you have got many documents and you would want to |
| 150 | +> neatly categorize them. |
| 151 | +``` |
| 152 | +
|
| 153 | +<br> |
| 154 | + |
| 155 | +> :Collapse label=Collapsible content (click to open) |
| 156 | +> |
| 157 | +> This content is collapsed by default. You can write _any_ markdown syntax you would |
| 158 | +> like here as this is simply just an enhanced `block quote` element. You can even have lists: |
| 159 | +> - with multiple |
| 160 | +> - items and stuff |
| 161 | +> |
| 162 | +> > :Collapse label=Or nested collapsible content (click to open) |
| 163 | +> > |
| 164 | +> > > :Collapse label=Collapception (click to open) |
| 165 | +> > > |
| 166 | +> > > To any depth that your heart might desire. |
| 167 | +> |
| 168 | +> This component is particularly useful in the table of contents (the left-side menu, activatable by |
| 169 | +> clicking on the hamburger menu in the footer), when you have got many documents and you would want to |
| 170 | +> neatly categorize them. |
| 171 | +
|
| 172 | +<hr> |
| 173 | + |
| 174 | +## Dark/Light Content |
| 175 | + |
| 176 | +If you have some content that differs in light mode vs in dark mode, you |
| 177 | +can use `DarkLight` component: |
| 178 | + |
| 179 | +```md | some-doc.md |
| 180 | +> :DarkLight |
| 181 | +> > :InDark |
| 182 | +> > |
| 183 | +> > We are SO DARK! This content is only shown in dark-mode. Switch to light-mode |
| 184 | +> > by clicking on the dark/light toggle in the footer to see the light-mode specific content. |
| 185 | +> |
| 186 | +> > :InLight |
| 187 | +> > |
| 188 | +> > LIGHT bless you! This content is only shown in light-mode. Switch to dark-mode |
| 189 | +> > by clicking on the dark/light toggle in the footer to see the dark-mode specific content |
| 190 | +``` |
| 191 | + |
| 192 | +<br> |
| 193 | + |
| 194 | +> :DarkLight |
| 195 | +> > :InDark |
| 196 | +> > |
| 197 | +> > We are SO DARK! This content is only shown in dark-mode. Switch to light-mode |
| 198 | +> > by clicking on the dark/light toggle in the footer to see the light-mode specific content. |
| 199 | +> |
| 200 | +> > :InLight |
| 201 | +> > |
| 202 | +> > LIGHT bless you! This content is only shown in light-mode. Switch to dark-mode |
| 203 | +> > by clicking on the dark/light toggle in the footer to see the dark-mode specific content |
| 204 | +
|
| 205 | +> If you are wondering why someone would **EVER** need such a thing, well I did. Because I wanted |
| 206 | +> to display different banner images based on dark-mode / light-mode: |
| 207 | +> |
| 208 | +> ```md |
| 209 | +> > :DarkLight |
| 210 | +> > > :InLight |
| 211 | +> > > |
| 212 | +> > >  |
| 213 | +> > |
| 214 | +> > > :InDark |
| 215 | +> > > |
| 216 | +> > >  |
| 217 | +> ``` |
| 218 | +> |
| 219 | +> > :DarkLight |
| 220 | +> > > :InLight |
| 221 | +> > > |
| 222 | +> > >  |
| 223 | +> > |
| 224 | +> > > :InDark |
| 225 | +> > > |
| 226 | +> > >  |
| 227 | +> |
| 228 | +> Yeah I know the life of an idealist is never easy. |
| 229 | +
|
| 230 | +<hr> |
| 231 | +
|
| 232 | +## Navigation |
| 233 | +
|
| 234 | +You can add _previous_ and _next_ buttons to your pages like this: |
| 235 | +
|
| 236 | +```markdown |
| 237 | +> :ToCPrevNext |
| 238 | +``` |
| 239 | +
|
| 240 | +Which would then look like this: |
| 241 | + |
| 242 | +> :ToCPrevNext |
0 commit comments