├── .prettierignore
├── PROFILE.md
├── README.md
├── frontmatter.md
├── graphic-design-tips.jpg
├── html-tags.md
├── index.html
├── markdown-image.png
├── mermaid.md
├── open-source-contributing.md
└── shields.md
/.prettierignore:
--------------------------------------------------------------------------------
1 | # Ignore all Markdown files:
2 | *.md
--------------------------------------------------------------------------------
/PROFILE.md:
--------------------------------------------------------------------------------
1 | # Notes for creating your Profile README
2 |
3 | Here are some resources to help you create your Profile README:
4 |
5 | 1. YouTube video [GitHub Profile Readme](https://youtu.be/KhGWbt1dAKQ) by Adrian Twarog.
6 | 1. YouTube videos on GitHub Profile Reviews by Eddie Jaoude such as [Your open source GitHub repos / profiles shoutouts and reviews](https://youtu.be/xsZIKzE7gy8). There good examples to pull from.
7 | 1. Google search for `github profile generator` which is a good way to get the code for your stats. Just make sure to customize the markdown as you see fit.
8 |
9 | ## Video notes (Adrian Twarog)
10 |
11 | - Create a repository with the name that is the same as your account name. THAT IS A MUST - IT MUST MATCH YOUR ACCOUNT NAME EXACTLY.
12 | - Set it to be public and initiate it with a README file.
13 | - Click edit on that README.md file and delete everything inside of it.
14 | - Start including your markdown or copy code from other profile README files that you like.
15 | - You want an intro paragraph, skills and languages you are studying, experience, links to articles you wrote, links to certifications, etc.
16 | - You can search GitHub for README stats or use Google to find sites that will create the code for you.
17 | - Generator: [README Generator](https://arturssmirnovs.github.io/github-profile-readme-generator/)
18 | - Article: [10 Standout GitHub Profile READMEs](https://dev.to/github/10-standout-github-profile-readmes-h2o)
19 |
20 | ## Example code
21 |
22 | You can use `align="center"` on HTML tags like `h2`, `div`, `img`, and `p` tags:
23 |
24 | ```
25 |
JIM KERNICKY
26 | ```
27 |
28 | Here is code for HTML5 in my SKILLS section icon:
29 |
30 | ```
31 |
32 | ```
33 |
34 | Find the code for the languages and technologies you use from other profiles and add the code into your profile. And of course use the markdown from this repo to structure your README.
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MARKDOWN CHEAT SHEET
2 |
3 | 
4 | 
5 | 
6 | 
7 |
8 |
9 |
10 | 
11 |
12 |
13 |
14 |
17 |
18 | Use this markdown cheat sheet as a guide for writing your markdown files. If you like it then clone or fork it, or at least click the **star** button.
19 |
20 | > FYI: if you are using the Vs Code extension `Prettier - Code formatter`, then you want to create a `.prettierignore` file and add markdown files (see my file) because it _WILL_ mess with your markdown.
21 |
22 | I'm breaking up all the markdown syntax into 8 categories:
23 |
24 | 1. Basics
25 | 1. Styles
26 | 1. Miscellaneous
27 | 1. Links
28 | 1. Lists
29 | 1. Code
30 | 1. Hidden
31 | 1. Visual Elements
32 |
33 | **NOTE**: To view markdown> in VS Code hit CTRL+SHIFT + V or click the preview button at top right in line with the file name tabs.
34 |
35 |
36 |
37 | ## ~~A Literal~~ Table of _Contents_
38 |
39 | | Category | Element | Accepts styles? |
40 | | -----------------------------------: | :-------------------------------------------- | :-------------: |
41 | | [Basics](#basics): | [Paragraphs](#paragraphs) | Yes |
42 | | | [Special characters](#special-characters) | `N/A` |
43 | | [Styles](#styles): | [Bold](#bold) | `N/A` |
44 | | | [Italic](#italic) | `N/A` |
45 | | | [Strike thru](#strike-thru) | `N/A` |
46 | | | [Underline](#underline) | `N/A` |
47 | | [Miscellaneous](#miscellaneous): | [Headings](#headings) | Yes |
48 | | | [Blockquotes](#blockquotes) | Yes |
49 | | | [Alerts](#alerts) | Yes |
50 | | | [Tables](#tables) | Yes |
51 | | | [Horizontal rules](#horizontal-rules) | No |
52 | | | [Descriptions](#descriptions) | Yes\* |
53 | | | [Frontmatter and YAML](#frontmatter-and-yaml) | No |
54 | | [Links](#links): | [External](#external) | Yes |
55 | | | [Anchor](#anchor) | Yes |
56 | | | [Footnotes](#footnotes) | Yes |
57 | | | [At mentions](#at-mentions) | `N/A` |
58 | | [Lists](#lists): | [Unordered](#unordered) | Yes |
59 | | | [Ordered](#ordered) | Yes |
60 | | | [Nested](#nested) | Yes |
61 | | | [Tasks](#tasks) | No |
62 | | [Code](#code): | [Inline](#inline) | Yes\* |
63 | | | [Tab](#tab) | No |
64 | | | [Generic](#generic) | No |
65 | | | [Language block](#language-block) | No |
66 | | | [Diff](#diff) | No |
67 | | [Hidden Elements](#hidden-elements): | [Comments](#comments) | No |
68 | | | [Spoiler](#spoiler) | Yes |
69 | | | [Details](#details) | No |
70 | | [Visual Elements](#visual-elements): | [Images](#images) | No |
71 | | | [Math](#math) | No |
72 | | | [Emojis](#emojis) | No |
73 | | | [Shields](#shields) | No |
74 | | | [Devicons](#devicons) | No |
75 | | | [Mermaid Diagrams](#mermaid-diagrams) | No |
76 | | | [HTML entities](#html-entities) | Yes\* |
77 | | [HTML](#html) | [Block elements](#block-elements) | - |
78 | | | [Inline elements](#inline-elements) | - |
79 | | | [HTML tag examples](#html-tag-examples) | - |
80 | | | [CSS Styles](#css-styles) | - |
81 | | | [Buttons](#buttons) | - |
82 | | [Resources](#resources) | N/A | - |
83 |
84 |
85 |
86 | ---
87 |
88 | ## Basics
89 |
90 | This is a short section on basic paragraphs, the symbols used in Markdown and how to escape them.
91 |
92 | ### Paragraphs
93 |
94 | Since paragraphs are a thing of their own, let's cover that one first:
95 |
96 | **Paragaphs**: Just use regular text but make sure to hit the ENTER key twice. Sometimes if you only hit ENTER once, the text will de displayed as the element directly above it _and_ there will not be a line break.
97 |
98 | ### Special characters
99 |
100 | Here are the characters you will use in Markdown. They will be covered in each section after this one:
101 |
102 | ````
103 | # Hash tags for headines and anchor links
104 | @ at symbol for at mentions
105 | [] for links, checked lists / tasks, and footnotes
106 | () for links
107 | ! for images
108 | ^ for footnote links
109 | x or X for tasks lists
110 | ` and ``` for inline code and codeblocks respectively
111 | * and ** for italic and bold respectively
112 | _ underscore for italics
113 | ~~ 2 tildes for strikethrough
114 | | for setting tables cells
115 | || double pipes for spoiler text on Discord
116 | : with dashes - for table cell alignments, for footnotes, and emojis
117 | * or - and a space for unordered lists
118 | 1., 2., 3., etc. for numbered lists
119 | * and + for diff code blocks
120 | > for blockquotes
121 | > > for indented / nested blockquotes
122 | 3 - or * for horizontal rules
123 |
124 | \ to escape most of the characters above, as in...
125 | \* escape asterisk,
126 | \| escape pipe, etc...
127 | " for titles in links and images
128 | ````
129 |
130 | **NOTE**: Some of the symbols have different effects when used in _Math Expressions_. See that section for information on those.
131 |
132 |
133 |
134 | ## Styles
135 |
136 | This category deals with the styling of words and can be used with every category with a few exceptions. You may not have thought of it but you can apply these effects to all or some of the words in:
137 |
138 | - Headings
139 | - Links
140 | - Lists (Not Tasks)
141 | - Blockquotes
142 | - Table cell values
143 | - HTML entities (except strikethrough)
144 | - Hidden (Spoiler only)
145 |
146 | These do not work for the obvious ones (Horizontal Rules, Images, and Emojis), and for all options in the Code category except inline code.
147 |
148 |
149 |
150 | ### Bold
151 |
152 | **Bold**: use either 2 **asterisks** or 2 **underscores** before and after the text for bold styling. The preferred syntax is to use asterisks for bold:
153 |
154 | ```markdown
155 | **two asterisks**
156 | **two underscores**
157 | ```
158 |
159 | The two underscores is being converted to asterisks in the block above (asterisks preferred), so let's try it in an inline code block: `__two underscores__`.
160 |
161 | ### Italic
162 |
163 | **Italic**: use a _single asterisk_ or _underscore_ before and after the text for italic styling. The preferred syntax is to use an underscore for italics:
164 |
165 | ```markdown
166 | _single asterisk_
167 | _single underscore_
168 | ```
169 |
170 | Here is an inline example with a single asterisk: `*single asterisk*` (underscores preferred).
171 |
172 | **_Bold and Italic_**: use either **_3 asterisks_** or **_2 asterisks and 1 underscore_** for bold and italic text. The preffered syntax is the latter:
173 |
174 | ```markdown
175 | **_3 asterisks_**
176 | **_2 asterisks and and 1 underscore_**
177 | ```
178 |
179 | ### Strike thru
180 |
181 | **Strikethrough**: use two tildes `~~` (~~) before and after text that you want to display as ~~strikethrough~~:
182 |
183 | ```
184 | ~~double tildes~~
185 | ```
186 |
187 | If you want, you can also do **~~bold strikethrough~~**, _~~italic strikethrough~~_, and **_~~bold italic strikethrough~~_**.
188 |
189 | ### Underline
190 |
191 | This can only be done with the `` HTML element. This is **_NOT_** part of Markdown.
192 |
193 | The links on GitHub are blue, bold and underlined (on hover). The `` HTML element underlines text and has normal font color and normal font-weight. No one familiar with GitHub will confuse it for a link. It's another styling effect that I find more useful than srikethrough.
194 |
195 | This is text underlined with the `ins` HTML tag.
196 |
197 | ```markdown
198 | This is text underlined with the `ins` HTML tag.
199 | ```
200 |
201 |
202 |
203 | ---
204 |
205 | ## Miscellaneous
206 |
207 | The elements in this category are all unique and do not fit into any of the other category:
208 |
209 | - Headings
210 | - Blockquotes
211 | - Descriptions
212 | - Tables
213 | - Horizontal rule
214 | - Frontmatter
215 |
216 | All elements in this category allow the text effects listed above except for horizontal rules and Frontmatter, and with an exception for descriptions.
217 |
218 | ### Headings
219 |
220 | There are 6 headings just like in HTML. Use a single hashtag for H1 and 6 hashtags for H6. The top title of this docuement is an H1 with a single hash, this section (**Miscellaneous**) uses 2 hashtags, and this sub-section (**Headings**) uses 3 hashtags.
221 |
222 | **NOTE**: There is an automatic horizontal rule added when you use syntax for H1 and H2.
223 |
224 | ```markdown
225 | # MARKDOWN CHEAT SHEET (Heading 1)
226 |
227 | ## Misc (Heading 2)
228 |
229 | ### Headings (heading 3)
230 |
231 | ### Heading 4 (you most likely will not use H5 or H6)
232 | ```
233 |
234 | Here is an example of using Bold, Italic, and Strikethrough in a heading:
235 |
236 | ```markdown
237 | ## ~~A Literal~~ Table of _Contents_
238 | ```
239 |
240 | As you can see, strikethrough and italic worked on the heading, but using bold did not increase the font weight for headings because they are already bold.
241 |
242 |
243 |
244 | ### Blockquotes
245 |
246 | This is a nice effect which adds a border-left and padding-left to offset it from normal text:
247 |
248 | > Use a **greater** than _sign_ (>) to quote a team member
249 | >
250 | > Create a space like above using > with no text (~~ignore~~)
251 |
252 | ```markdown
253 | > Use a **greater** than _sign_ (>) to quote a team member
254 | >
255 | > Create a space like above using > with no text (~~ignore~~)
256 | ```
257 |
258 |
259 |
260 | #### Alerts
261 |
262 | Alerts are used to highlight important text with colours and icons. There is support for five distinct kinds of alerts. They have syntax similar to blockquotes but include syntax for images which is what displays the specific icons for each alert type:
263 |
264 | ```md
265 | > [!NOTE]
266 | > Essential details that users should not overlook, even when browsing quickly.
267 |
268 | > [!TIP]
269 | > Additional advice to aid users in achieving better outcomes.
270 |
271 | > [!IMPORTANT]
272 | > Vital information required for users to attain success.
273 |
274 | > [!WARNING]
275 | > Urgent content that requires immediate user focus due to possible risks.
276 |
277 | > [!CAUTION]
278 | > Possible negative outcomes resulting from an action.
279 | ```
280 |
281 | > [!NOTE]
282 | > Essential details that users should not overlook, even when browsing quickly.
283 |
284 | > [!TIP]
285 | > Additional advice to aid users in achieving better outcomes.
286 |
287 | > [!IMPORTANT]
288 | > Vital information required for users to attain success.
289 |
290 | > [!WARNING]
291 | > Urgent content that requires immediate user focus due to possible risks.
292 |
293 | > [!CAUTION]
294 | > Possible negative outcomes resulting from an action.
295 |
296 | ### Tables
297 |
298 | Here is a generic table but the Table of Contents above is another version. The pipes create the columns, the colons with dashes create the alignment:
299 |
300 | - A colon on the left of the dashes is left-aligned,
301 | - A colon on the right is right-aligned,
302 | - And a colon on both ends is centered
303 |
304 | | Left aligned Content | Center aligned Content | Right aligned Content |
305 | | :-------------------- | :--------------------: | --------------------: |
306 | | Content Left | Content Center | Content Right |
307 | | Content Left | Content Center | Content Right |
308 | | _Italic_ | **Bold** | ~~Strikethrough~~ |
309 | | Underlined | Content Center | Content Right |
310 |
311 |
312 |
313 | ```markdown
314 | | Left aligned Content | Center aligned Content | Right aligned Content |
315 | | :-------------------- | :--------------------: | --------------------: |
316 | | Content Left | Content Center | Content Right |
317 | | Content Left | Content Center | Content Right |
318 | | _Italic_ | **Bold** | ~~Strikethrough~~ |
319 | | Underlined | Content Center | Content Right |
320 | ```
321 |
322 | Combination HTML and markdown table
323 |
324 | ```markdown
325 |
377 |
378 | ### Horizontal rules
379 |
380 | Use 3 asterisks or 3 dashes with or without a space to create a horizontal rule:
381 |
382 | ---
383 |
384 | ```
385 | - - -
386 | ---
387 | * * *
388 | ***
389 | ```
390 |
391 | **NOTE**: Make sure to hit ENTER twice if you intend to use 3 asterisks without spaces or it will set the text above it to an H3 tag. Directly below this paragraph is an HTML `` tag which looks identical to the HR at the top of this section.
392 |
393 |
394 |
395 | HR's look good for visual breaks. You could also use other keyboard symbols like periods:
396 |
397 | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
398 |
399 |
400 |
401 | ### Descriptions
402 |
403 | The following are HTML tags, **_NOT_** a part of markdown, but they do give you a nice indentation for visual variety.
404 |
405 | The text in the tags can only be styled with the HTML tags related to bold, italic, strikethrough, or _underline_. As you can see, I used the `ins`, `b`, `em`, and `s` tags in the example below:
406 |
407 | - `dl`: description list, the wrapper element for the other two
408 | - `dt`: description term, that which you are defining or highlighting
409 | - `dd`: description details, the actual definition or explanantion
410 |
411 |
412 |
Description List
413 |
Represents a description list. The dl element encloses a list of groups of terms (specified using the dt element) and descriptions (provided by dd elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs) (ignore).
414 |
415 |
416 | ```markdown
417 |
418 |
Description List
419 |
Represents a description list. The dl element encloses a list of groups of terms (specified using the dt element) and descriptions (provided by dd elements). Common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs) (ignore).
424 |
425 | ### Frontmatter and YAML
426 |
427 | Frontmatter in markdown files is not something you will use in general, but you should at least be aware of it. The actual syntax for markdown frontmatter (or _front matter_) is YAML syntax.
428 |
429 | What is YAML? That is not pertinent to this repo, but GitHub actions are written in YAML.
430 |
431 | Check out the file in this repo named [frontmatter.md](https://github.com/Kernix13/markdown-cheatsheet/blob/master/frontmatter.md) for an example of how it displays at the top of the file, as well as a description of what frontmatter is, and notes on syntax and YAML.
432 |
433 | In that file I use frontmatter and it looks like it prints out as if it was a table. It has just 2 rows: 1st) the keys which become the table headers, and 2nd) the values in the first row. What is interesting is how the _tags_ are output with borders. I did not use nesting in that example, but I would assume that would output differently.
434 |
435 | Here is an error I got when I tried nesting:
436 |
437 | > ERROR: `Error in user YAML: (): did not find expected '-' indicator while parsing a block collection at line 4 column 3`
438 |
439 |
440 |
441 | ## Links
442 |
443 | This category accepts all text effects and includes:
444 |
445 | - External links
446 | - Anchor links (same page)
447 | - Footnote links
448 |
449 | ### External
450 |
451 | **External Links**: The syntax is to use square brackets around the link text and parentheses for the URL. You can also add an additional title for the link by adding a space after the URL and adding the link title in double quotes:
452 |
453 | Here is a link to my [Beginner Git Commands](https://github.com/Kernix13/beginner-git-commands) repositiory. And here is the syntax:
454 |
455 | ```markdown
456 | [Link text](URL 'Optional link title')
457 | [Beginner Git Commands](https://github.com/Kernix13/beginner-git-commands 'Basic Git commands repo')
458 | ```
459 |
460 | **NOTE**: Only use a title if it adds information. Don't set the title text to be the same as the link text.
461 |
462 | Here is a bold, italic and strikethrough link:
463 |
464 | - **[Google](https://google.com)**
465 | - _[Google](https://google.com)_
466 | - ~~[Google](https://google.com)~~
467 | - [Google](https://google.com)
468 |
469 | Why would you use a strikethorugh effect on a link? I'm not sure. For a page under construction, being moved, etc?
470 |
471 |
503 |
504 | ### Footnotes
505 |
506 | **Footnote links**: I assume footnotes would be useful in a very technical or long README file. Use square brackets where you want a footnote link to appear and use a caret symbol (^) followed by the number of the footnote.
507 |
508 | Then below that add the same syntax followed by a colon and the note itself - none of that will display on the page. That will make the footnote text appear at the bottom of your file:
509 |
510 | Footnote.[^1]
511 |
512 | Some other important footnote.[^2]
513 |
514 | Use this for where you want the link: `[^1]`
515 |
516 | Here is the actual footnote syntax:
517 |
518 | ```markdown
519 | [^1]: This is footnote number one.
520 | [^2]: Here is the second footnote.
521 | ```
522 |
523 | [^1]: This is footnote number one.
524 | [^2]: Here is the second footnote.
525 |
526 | ### At mentions
527 |
528 | At mentions do not seem to work as links. This is an at mention test:
529 |
530 | @Kernix13: Hello. This does not work in a markdown file, but it does create a link in Issues and PRs, and maybe in other areas as well. I need to do more research into this. Like Hidden text, this may only work on different platforms like Discord.
531 |
532 |
533 |
534 | ---
535 |
536 | ## Lists
537 |
538 | This category has:
539 |
540 | - Unordered lists
541 | - Ordered lists
542 | - Nested lists
543 | - Task lists
544 |
545 | You can use all text effects but with one exception: None of the effects work for Task lists.
546 |
547 | ### Unordered
548 |
549 | **Unordered lists**: You can use either an asterisk (`*`) or a dash (`-`) followed by a space to make a bulleted list. I prefer using a dash since you do not need to use the SHIFT key:
550 |
551 | - _List item 1_
552 | - **List item 2**
553 | - List ~~item 3~~
554 |
555 | ```markdown
556 | - _List item 1_
557 | - **List item 2**
558 | - List ~~item 3~~
559 | ```
560 |
561 |
562 |
563 | ### Ordered
564 |
565 | **Ordered lists**: use a number followed by a period (1., 2., 3. etc.) and then a space to create an ordered list:
566 |
567 | 1. Ordered **item 1**
568 | 1. Ordered _item 2_
569 | 1. Ordered ~~item 3~~
570 |
571 | ```markdown
572 | 1. Ordered **item 1**
573 | 1. Ordered _item 2_
574 | 1. Ordered ~~item 3~~
575 | ```
576 |
577 | **NOTE**: By using "1." for each list item, you can cut & paste to change the order of items and the numbering will change to match the new order.
578 |
579 | Does this make sense? You can use both unordered and ordered together -> bullets with roamn numerals, or numbers with bullets:
580 |
581 | 1. - What?
582 | 1. - Really?
583 | 1. - Why?
584 |
585 | - 10. What is this
586 | - 15. Again?
587 | - 20. Any use cases?
588 |
589 |
640 |
641 | ### Tasks
642 |
643 | You can create what looks like checkboxes and display completed tasks with a checkmark. It takes the form of an unordered list with the first characters being a set of square brackets which **_MUST_** have a space in them. For a completed task, add either a lower or uppercase "X":
644 |
645 | - [ ] Incomplete _task_
646 | - [x] Completed **task**
647 | - [ ] Incomplete ~~subtask~~
648 | - [x] Completed subtask
649 |
650 | ```markdown
651 | - [ ] Incomplete _task_
652 | - [x] Completed **task**
653 | - [ ] Incomplete ~~subtask~~
654 | - [x] Completed subtask
655 | ```
656 |
657 |
658 |
659 | ---
660 |
661 | ## Code
662 |
663 | This category deals with inline code and various typs of code blocks and none of them accept Styles with the exception of `inline` and language code blocks using _markdown_ as the language:
664 |
665 | - Inline code
666 | - Generic code blocks
667 | - TAB code blocks
668 | - Code language blocks
669 | - `Diff` code blocks
670 |
671 | ### Inline
672 |
673 | Use a `single backtick` before and after text to display it as inline code:
674 |
675 | ```markdown
676 | `single backtick`
677 | ```
678 |
679 | Here are examples on inline as **`bold`**, _`italic`_, and ~~`strikethrough`~~. There is also a way to show language syntax highlighting (see _Language block_ section below) for inline code, but I think you need to use a package called `highlight.js`.
680 |
681 | ### Tab
682 |
683 | It took me a while how to show the 3 backticks for a code block (next section). For that and other tricky markdown that will not dispay, hit the TAB button twice then enter your code:
684 |
685 | This is a **code** _block_ made by ~~hitting~~ TAB 2 X's
686 |
687 | ### Generic
688 |
689 | To add code that requires more than 1 line then use 3 backticks, hit ENTER, add your code block, hit ENTER again and add 3 more back ticks.
690 |
691 | ```
692 | *, *::before, *::after {
693 | box-sizing: border-box;
694 | }
695 | ```
696 |
697 | ```
698 | *, *::before, *::after {
699 | box-sizing: border-box;
700 | }
701 | ```
702 |
703 | **From GitHub docs**: _To display triple backticks in a fenced code block, wrap them inside quadruple backticks_.
704 |
705 | However, you can also hit TAB twice:
706 |
707 | ```
708 | TAB twice to show the triple backticks
709 | ```
710 |
711 | ````
712 | ```
713 | Triples inside quadruples - TAB x 2 is easier
714 | ```
715 | ````
716 |
717 |
718 |
719 | ### Language block
720 |
721 | This is what you want to use for code blocks. To highlight parts of your code add the language after the opening triple backticks. You'll have to do your own research but so far I've used the following languages: `md` or `markdown`, `html`, `css`, `js` or `javascript`, `jsx`, `php`, `xml`, `python`, `sql`, `bash` or `shell` or `sh`, and `apacheconf` (for Apache servers). I tried using `node` and `npm` for my node-npm repo but it had no effect.
722 |
723 | ```css
724 | rules here
725 | ```
726 |
727 | **CSS**:
728 |
729 | ```css
730 | a {
731 | text-decoration: none;
732 | }
733 | ```
734 |
735 | **HTML**:
736 |
737 | ```html
738 |
739 | ```
740 |
741 | **JavaScript**:
742 |
743 | ```js
744 | console.log(${variable})
745 | ```
746 |
747 | **PHP**:
748 |
749 | ```php
750 |
751 | ```
752 |
753 | Here is a new one that I found on [Discord Markdown Text 101](https://gist.github.com/matthewzring/9f7bbfd102003963f9be7dbcf7d40e51) with a language prefix of `fix`. I assume this works on Discord but itdoes not work on GitHub:
754 |
755 | ```fix
756 | everything is blue
757 | = light blue after equal sign (but not in VS Code)
758 | ```
759 |
760 | ```fix
761 | everything is blue
762 | = light blue after equal sign (but not in VS Code)
763 | ```
764 |
765 | Here is the full list of supported languages and code syntax highlighting.
766 |
767 | Check out the article [Languages Supported by Github Flavored Markdown](https://www.rubycoloredglasses.com/2013/04/languages-supported-by-github-flavored-markdown/) from 12-8-2020. Also check out the [highlight.js](https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md) repo:
768 |
769 | ```markdown
770 | actionscript3
771 | apache
772 | applescript
773 | asp
774 | brainfuck
775 | c
776 | cfm
777 | cjs
778 | clojure
779 | cmake
780 | coffee-script, coffeescript, coffee
781 | cpp - C++
782 | cs
783 | csharp
784 | css
785 | csv
786 | bash, sh, zsh
787 | diff
788 | elixir
789 | erb - HTML + Embedded Ruby
790 | go
791 | haml
792 | http
793 | java
794 | javascript
795 | js
796 | json
797 | jsx
798 | less
799 | lolcode
800 | make - Makefile
801 | markdown
802 | matlab
803 | nginx
804 | objectivec
805 | pascal
806 | PHP
807 | Perl
808 | python
809 | profile - python profiler output
810 | rust
811 | salt, saltstate - Salt
812 | shell, sh, zsh, bash - Shell scripting
813 | scss
814 | sql
815 | svg
816 | swift
817 | rb, jruby, ruby - Ruby
818 | smalltalk
819 | vim, viml - Vim Script
820 | volt
821 | vhdl
822 | vue
823 | xml - XML and also used for HTML with inline CSS and Javascript
824 | yaml
825 | ```
826 |
827 | I've also noticed that `ini` and `TOML` as the language block language also show syntax highlighting.
828 |
829 | For terminal commands like for NPM, use `bash`, `sh`, or `zsh`.
830 |
831 | Trying to find a language to style terminal errors or errors & warnings in DevTools is difficult. The best languages I found for that are `c++` and `python`. The syntax highlighting isn't perfect but it at least has some highlighting.
832 |
833 |
834 |
835 | ### Diff
836 |
837 | This is really nice for highlighting text or code that was changed. Use `diff` after the opening triple backticks. Then use a minus sign (`-`) for what was changed, and a plus symbol (`+`) for the new version:
838 |
839 | ```diff
840 | - this code or text is the old version
841 | + this is what it was changed to
842 | ```
843 |
844 | ````
845 | ```diff
846 | - this code or text is the old version
847 | + this is what it was changed to
848 | ```
849 | ````
850 |
851 |
852 |
853 | ---
854 |
855 | ## Hidden Elements
856 |
857 | This is an odd category with 3 effects, one of which you have probably only seen on Discord:
858 |
859 | - Comments
860 | - Spoiler text
861 | - Details
862 |
863 | Only Spoiler text accepts text effects.
864 |
865 | ### Comments
866 |
867 | This is a nice way to add a comment in the editor view of your markdown file. This would be good for teams members editing a documentation page. The best way is to use HTML syntax:
868 |
869 |
870 |
871 | ```markdown
872 |
873 | ```
874 |
875 | Comments used in language code blocks will match the language. You can use the `CTRL+/` shortcut. For example, in JavaScript or PHP you will get `//` using that shortcut, or `/* */` in CSS, `#` in bash files, and `` in HTML.
876 |
877 | ### Spoiler
878 |
879 | On Discord you may sometimes see a black rectangle that reveals text or code when you click on it. Use double pipes before and after the word(s)/code that you want to conceal:
880 |
881 | ```markdown
882 | ||Spoiler text|| in Discord
883 | ```
884 |
885 | **NOTE**: This does not work on Slack or here on GitHub.
886 |
887 |
888 |
889 | ### Details
890 |
891 | This isn't a markdown thing but it is another example of using HTML tags in a Markdown file. It has the same effect as an accordian. I'm not sure why you would use this but here is how you would do it:
892 |
893 |
894 | Title 1
895 |
915 |
916 | ---
917 |
918 | ## Visual Elements
919 |
920 | The five sections below deal with adding visual-based elements to your markdown file that require some kind of extra code/syntax: `images`, `math expressions`, `emojis`, `shields`, `diagrams`, and `HTML entities`.
921 |
922 | ### Images
923 |
924 | Images use the same syntax as **Links** except for the addition of an exclamation mark (`!`) immediately before the opening square bracket. You can also use the optional title text. The example image below shows the dimensions but that is just an example. It's up to you to decide the image sizes you want for your files:
925 |
926 |
927 |
928 | 
929 |
930 | 
931 |
932 | raw.githubusercontent: I noticed that you can paste images into parts of GitHub. You can do it in a markdown file, but then you will have to pull the changes. I've also seen it done in `Pull requests` and `Issues` tabs. Here is an example:
933 |
934 | ```html
935 |
938 | ```
939 |
940 |
941 |
942 | ### Math
943 |
944 | Finally, per GitHub:
945 |
946 | > ...math expressions can be rendered in Markdown on GitHub using $$ as a delimiter for code blocks with math content or the $ delimiter for inline math expressions.
947 |
948 | 1. Use a single dollar sign (`$`) at the beginning and end of an inline math expression.
949 | 2. Use 2 dollar sign (`$$`) at the beginning and end for a block of math expressions.
950 |
951 | Inline example: this `$(ax^2 + bx + c = 0)$` renders as $(ax^2 + bx + c = 0)$.
952 |
953 | Inline exception: use `\$` to escape, and therefore use, a dollar sign in an equation (`$(\$4.00 - \$1.50 = \$2.50)$`): $(\$4.00 - \$1.50 = \$2.50)$
954 |
955 | Inline exception 2: use `$` for inline use of dollar sign before a math expression.
956 |
957 | Block example: `$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$` renders as:
958 |
959 | $$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
960 |
961 | Block example 2: This `$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$` renders as:
962 |
963 | $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
964 |
965 | Here are the important symbols to know:
966 |
967 | - `^` = exponent, e.g. $a^3$
968 | - `{ }` = required for certain expressions such as square root
969 | - `\pm` = plus\minus symbol: $\pm$
970 | - `\sqrt` = square root symbol: $\sqrt{b}$
971 | - `\over` = division: $a \over b$
972 | - `\leq` = less than or equal to: $\leq$
973 | - `\geq` = greater than or equal to: $\geq$
974 | - `\ne` = not equal to: $ \ne $
975 | - `\sum` = Sigma, summation symbol: $\sum$
976 | - `\val` = sub-script value: $a_i$
977 | - `\{val=num}^n` = start val and max (n) val for sum
978 | - `\Omega` and `\omega` = greek Omega or omega
979 | - `\int` = interval
980 | - `\bmod` and `\pmod` = modular operators
981 | - `\frac` = fractions
982 | - `\binom` = binomial coefficient
983 |
984 | Not sure for the following: `\left`, `\right`, `\forall`, `\partial`, `\rho`, `\nabla`, `\cdot`, `\vec`, `\mathrm`, `\in`, ...
985 |
986 | For some reason the symbols in the lists above are not all displaying (?)
987 |
988 | #### Examples for Greek letters
989 |
990 | Greek letters are commonly used in mathematics, and they are very easy to type in math mode. You just have to type the name of the letter after a backslash: if the first letter is lowercase, you will get a lowercase Greek letter, if the first letter is uppercase (and only the first letter), then you will get an uppercase letter. Note that some uppercase Greek letters look like Latin ones.
991 |
992 | Use `\alpha, \Alpha, \beta, \Beta, \gamma, \Gamma, \pi, \Pi, \phi, \varphi, \mu, \Phi, \Omega, \omega` for $\alpha \beta \gamma \Gamma \pi \Pi \phi \varphi \mu \Phi \Omega \omega \Theta \theta$, etc.
993 |
994 | #### Examples for Operators
995 |
996 | An operator is a function that is written as a word: e.g. trigonometric functions (sin, cos, tan), logarithms and exponentials (log, exp), limits (lim), as well as trace and determinant (tr, det).
997 |
998 | Use `\lim\limits_{x \to \infty} \exp(-x) = 0` for $\lim\limits_{x \to \infty} \exp(-x) = 0$
999 |
1000 | #### Examples of Powers and indices
1001 |
1002 | Powers and indices are equivalent to superscripts and subscripts in normal text mode. The caret character (`^`) is used to raise something, and the underscore (`_`) is for lowering. For example, use `k_{n+1} = n^2 + k_n^2 - k_{n-1}` for $k_{n+1} = n^2 + k_n^2 - k_{n-1}$.
1003 |
1004 | For powers with more than one digit, surround the power with `{ }`: use `n^{22}` for $n^{22}$.
1005 |
1006 | An underscore (`_`) can be used with a vertical bar (`{\displaystyle |}|`) to denote evaluation using subscript notation: use `f(n) = n^5 + 4n^2 + 2 |_{n=17}` for $f(n) = n^5 + 4n^2 + 2 |_{n=17}$.
1007 |
1008 | #### Examples of Fractions and Binomials
1009 |
1010 | A fraction is created using the `\frac{numerator}{denominator}` command. Use `\frac{n!}{k!(n-k)!} = \binom{n}{k}` for $$\frac{n!}{k!(n-k)!} = \binom{n}{k}$$
1011 |
1012 | You can embed fractions within fractions using `\frac{\frac{1}{x}+\frac{1}{y}}{y-z}`:
1013 |
1014 | $$\frac{\frac{1}{x}+\frac{1}{y}}{y-z}$$
1015 |
1016 | The `\tfrac` and `\dfrac` commands force the use of the respective styles, `\textstyle` and `\displaystyle`. Similarly, the `\tbinom` and `\dbinom` commands typeset the binomial coefficient.
1017 |
1018 | For relatively simple fractions, especially within the text, it may be more aesthetically pleasing to use powers and indices instead: `^3/_7` for $^3/_7$
1019 |
1020 | If you use them throughout the document, usage of `xfrac` package is recommended. This package provides `\sfrac` command to create slanted fractions. If fractions are used as an exponent, curly braces have to be used around the `\sfrac` command.
1021 |
1022 | Check out the Wikipedia article [LaTeX/Mathematics](https://en.wikibooks.org/wiki/LaTeX/Mathematics) for more information. Or click on the following links for specific sections not covered above:
1023 |
1024 | - [Multiplication of two numbers](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Multiplication_of_two_numbers)
1025 | - [Roots](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Roots)
1026 | - [Sums and integrals](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Sums_and_integrals)
1027 | - [Brackets, braces and delimiters](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Brackets,_braces_and_delimiters)
1028 | - [Matrices and arrays](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Matrices_and_arrays)
1029 | - [Adding text to equations](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Adding_text_to_equations)
1030 | - [Formatting mathematics symbols](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Formatting_mathematics_symbols)
1031 | - [Color](https://en.wikibooks.org/wiki/LaTeX/Mathematics#Color)
1032 |
1033 | Color example: try `k = {\color{red}x} \mathbin{\color{blue}-} 2` for $k = {\color{red}x} \mathbin{\color{blue}-} 2$
1034 |
1035 | Other links:
1036 |
1037 | - [MathJax](https://www.mathjax.org/)
1038 | - GitHub blog post [Math support in Markdown](https://github.blog/2022-05-19-math-support-in-markdown/)
1039 |
1040 |
1098 |
1099 | ### Shields
1100 |
1101 | Check the file `shields.md` for a full list.
1102 |
1103 | [Shields.io](https://shields.io/) generates shields/badges for different apects of your repo. Here are the shields I have for my [WriterAssist](https://github.com/Kernix13/WriterAssist) repo with descriptions above the badges:
1104 |
1105 | ```md
1106 | GitHub commit activity:
1107 | 
1108 | GitHub contributors:
1109 | 
1110 | GitHub all releases:
1111 | 
1112 | GitHub language count:
1113 | 
1114 | GitHub top language:
1115 | 
1116 | license
1117 | 
1118 | ```
1119 |
1120 | In the beginning just add what you can, even if the values are `0`, though some shields with a `null` value will display a zero, others will not even display the badge. Here are the badges I think are good for beginners:
1121 |
1122 | - **Analysis badges**: GitHub language count, GitHub top language, and GitHub search hit counter
1123 | - **Size badge**: GitHub repo file count
1124 | - **Downloads badge**: GitHub all releases
1125 | - **Funding badge**: GitHub sponsors (probably not for beginners)
1126 | - **Issue tracking badges**: GitHub issue/pull request detail, GitHub issues, GitHub closed issues, ...and many more, (_what is hacktoberfest?_)
1127 | - **License badge**: GitHub license
1128 | - **Social badges**: GitHub followers, forks, repo stars, users stars, watchers, ...
1129 | - **Version badge**: GitHub manifest version
1130 | - **Activity badges**: GitHub contributors, GitHub commit activity, GitHub last commit, GitHub release date,
1131 | - **Other badges**: GitHub discussions, GitHub package.json dynamic (keywords)
1132 |
1133 | Shield.io will build the links for you, but here is the breakdown of the structure:
1134 |
1135 | ```markdown
1136 | https://img.shields.io/github/ + Label/ + user/ + repo + ?options
1137 | ```
1138 |
1139 | You do not have to go to the shields website if you want shields for a repo that you already. Just change the repo part of the link. As of 8/26/2022 I have 3 shields for this repo. Here they are following the sequence above with `constant` standing for the string `https://img.shields.io/github/`:
1140 |
1141 | ```markdown
1142 |
1143 |
1144 | constant + forks/Kernix13/markdown-cheatsheet?style=flat-square
1145 |
1146 |
1147 |
1148 | constant + commit-activity/y/Kernix13/markdown-cheatsheet?style=flat-square
1149 |
1150 |
1151 |
1152 | constant + contributors/Kernix13/markdown-cheatsheet?style=flat-square
1153 | ```
1154 |
1155 | For the `?style=` part of the link, I like `flat-square` and `for-the-badge` (much larger). You can also choose _Copy HTML_ to get an `img` tag instead of a markdown link. I actually switched from the markdown syntax to an `img` tag inside of `` tags to get them to display inline:
1156 |
1157 | ```markdown
1158 |
1159 | ```
1160 |
1161 |
1162 |
1163 | ### Devicons
1164 |
1165 | Devicons are the language and web tool icons you see mostly in people's profile README files. Check out [Devicons on GitHub](https://github.com/devicons/devicon/tree/master/icons) for the full list languages and tools and let me know if you find another/better list:
1166 |
1167 | ```markdown
1168 |
1169 |
1170 | https://raw.githubusercontent.com/devicons/devicon/master/icons/bootstrap/bootstrap-plain-wordmark.svg
1171 |
1172 |
1173 |
1174 |
1175 | ```
1176 |
1177 | You will have to find all the language and tool icons that you want for your markdown files. Here are examples of Bootstrap and CSS3 devicons in 1) an `img` tag inside an `a` tag, 2) an `img` tag only, and 3) an `img` tag inside a `span` tag:
1178 |
1179 | #### Devicons in an anchor and image tag
1180 |
1181 |
1182 |
1183 |
1184 | #### Devicons in an image tag only
1185 |
1186 |
1187 |
1188 |
1189 | #### Devicons in a span and image tag
1190 |
1191 |
1192 |
1193 |
1194 | They are all inline except for the sole `img` tags. I think a span tag with `align="left"` or `center` would be best, although you could do `right` to have them stand out or as a visual change to the normal left alignment.
1195 |
1196 | When you see a profile README with language/tool icons that you would like to use, then go into the markdown to get a copy of the `src` and then add it to your profile README. Or go to the devicons repo linked above, search for your languages/tools in the icons folder and go into that folder. Click on an image, and if you like the image click the `Raw` button and copy the URL in the address bar to use as the `src` attribute.
1197 |
1198 | **NOTE 1**: The link attribute `target="_blank"` does not open links in a new tab.
1199 |
1200 | **NOTE 2**: You need to set the `width` and `height` for the devicon's `img` tags. Currently I have 40 or 48 pixels for my devicons. Find the pixel size that works for you.
1201 |
1202 |
1203 |
1204 | ### Mermaid Diagrams
1205 |
1206 | This is a new markdown element I just became aware of. Check out [Mermaid on GitHub](https://github.com/mermaid-js/mermaid#readme) for more information or go to their [docs page](https://mermaid.js.org/intro/). But it's basically a language code block that remders various diagrams with very specific syntax. And the diagrams have buttons for, zoom in/out, position change, and popout box. Check this out:
1207 |
1208 | graph TD;
1209 | A-->B;
1210 | A-->C;
1211 | B-->D;
1212 | C-->D;
1213 |
1214 | ```mermaid
1215 | graph TD;
1216 | A-->B;
1217 | A-->C;
1218 | B-->D;
1219 | C-->D;
1220 | ```
1221 |
1222 | Or this
1223 |
1224 | flowchart LR
1225 |
1226 | A[Hard] -->|Text| B(Round)
1227 | B --> C{Decision}
1228 | C -->|One| D[Result 1]
1229 | C -->|Two| E[Result 2]
1230 |
1231 | ```mermaid
1232 | flowchart LR
1233 |
1234 | A[Hard] -->|Text| B(Round)
1235 | B --> C{Decision}
1236 | C -->|One| D[Result 1]
1237 | C -->|Two| E[Result 2]
1238 | ```
1239 |
1240 | As I learn more I will add more but this is really cool! Check out my file `mermaid.md` for in-depth notes.
1241 |
1242 |
1527 |
1528 | ---
1529 |
1530 | ## HTML
1531 |
1532 |
1533 |
1534 | The one thing I want to look into is using videos, animated GIFs, more HTML tags in my markdown files, and also column layouts using tables.
1535 |
1536 | I used a GitHub generator for my Profile README. In there are `
1606 |
1607 | #### HTML tag examples
1608 |
1609 | The large gap above the title is from 2 ` ` tags. Use only one for a normal separation.
1610 |
1611 | | HTML Tag | Result |
1612 | | :------- | :--------------------------------------------: |
1613 | | `ins` | underlined text |
1614 | | `u` | No underline on GitHub |
1615 | | `kbd` | CTRL+C, ENTER |
1616 | | `samp` | This is monospaced font |
1617 | | `sup` | 23 |
1618 | | `sub` | H2O |
1619 |
1620 |
1690 |
1691 | #### CSS Styles
1692 |
1693 | If all of the above is not enough to differentiate your markdown files from a plain vanilla MD file, then you can also add CSS. You can not add a style sheet but you can add HTML as seen above. Which means you can add a `
1714 |
1715 |
Markdown css styles
1716 |
1717 |
1718 |
Box 1
1719 |
Box 2
1720 |
Box 3
1721 |
1722 | ```
1723 |
1724 |
1740 |
1741 |
1742 | Markdown css styles
1743 |
1744 |
1745 |
1746 |
1747 | Box 1
1748 |
1749 |
1750 | Box 2
1751 |
1752 |
1753 | Box 3
1754 |
1755 |
1756 |
1757 | > _**BAD NEWS**: You can not use a `
24 |
25 |
26 |
27 |