$npx -y skills add github/awesome-copilot --skill markdown-to-htmlConvert Markdown files to HTML similar to marked.js, pandoc, gomarkdown/markdown, or similar tools; or writing custom script to convert markdown to html and/or working on web template systems like jekyll/jekyll, gohugoio/hugo, or similar web templating systems that util
| 1 | # Markdown to HTML Conversion |
| 2 | |
| 3 | Expert skill for converting Markdown documents to HTML using the marked.js library, or writing data conversion scripts; in this case scripts similar to [markedJS/marked](https://github.com/markedjs/marked) repository. For custom scripts knowledge is not confined to `marked.js`, but data conversion methods are utilized from tools like [pandoc](https://github.com/jgm/pandoc) and [gomarkdown/markdown](https://github.com/gomarkdown/markdown) for data conversion; [jekyll/jekyll](https://github.com/jekyll/jekyll) and [gohugoio/hugo](https://github.com/gohugoio/hugo) for templating systems. |
| 4 | |
| 5 | The conversion script or tool should handle single files, batch conversions, and advanced configurations. |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | - User asks to "convert markdown to html" or "transform md files" |
| 10 | - User wants to "render markdown" as HTML output |
| 11 | - User needs to generate HTML documentation from .md files |
| 12 | - User is building static sites from Markdown content |
| 13 | - User is building template system that converts markdown to html |
| 14 | - User is working on a tool, widget, or custom template for an existing templating system |
| 15 | - User wants to preview Markdown as rendered HTML |
| 16 | |
| 17 | ## Converting Markdown to HTML |
| 18 | |
| 19 | ### Essential Basic Conversions |
| 20 | |
| 21 | For more see [basic-markdown-to-html.md](references/basic-markdown-to-html.md) |
| 22 | |
| 23 | ```text |
| 24 | ```markdown |
| 25 | # Level 1 |
| 26 | ## Level 2 |
| 27 | |
| 28 | One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`. |
| 29 | |
| 30 | - `ul` list item 1 |
| 31 | - `ul` list item 2 |
| 32 | |
| 33 | 1. `ol` list item 1 |
| 34 | 2. `ol` list item 1 |
| 35 | |
| 36 | | Table Item | Description | |
| 37 | | One | One is the spelling of the number `1`. | |
| 38 | | Two | Two is the spelling of the number `2`. | |
| 39 | |
| 40 | ```js |
| 41 | var one = 1; |
| 42 | var two = 2; |
| 43 | |
| 44 | function simpleMath(x, y) { |
| 45 | return x + y; |
| 46 | } |
| 47 | console.log(simpleMath(one, two)); |
| 48 | ``` |
| 49 | ``` |
| 50 | |
| 51 | ```html |
| 52 | <h1>Level 1</h1> |
| 53 | <h2>Level 2</h2> |
| 54 | |
| 55 | <p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p> |
| 56 | |
| 57 | <ul> |
| 58 | <li>`ul` list item 1</li> |
| 59 | <li>`ul` list item 2</li> |
| 60 | </ul> |
| 61 | |
| 62 | <ol> |
| 63 | <li>`ol` list item 1</li> |
| 64 | <li>`ol` list item 2</li> |
| 65 | </ol> |
| 66 | |
| 67 | <table> |
| 68 | <thead> |
| 69 | <tr> |
| 70 | <th>Table Item</th> |
| 71 | <th>Description</th> |
| 72 | </tr> |
| 73 | </thead> |
| 74 | <tbody> |
| 75 | <tr> |
| 76 | <td>One</td> |
| 77 | <td>One is the spelling of the number `1`.</td> |
| 78 | </tr> |
| 79 | <tr> |
| 80 | <td>Two</td> |
| 81 | <td>Two is the spelling of the number `2`.</td> |
| 82 | </tr> |
| 83 | </tbody> |
| 84 | </table> |
| 85 | |
| 86 | <pre> |
| 87 | <code>var one = 1; |
| 88 | var two = 2; |
| 89 | |
| 90 | function simpleMath(x, y) { |
| 91 | return x + y; |
| 92 | } |
| 93 | console.log(simpleMath(one, two));</code> |
| 94 | </pre> |
| 95 | ``` |
| 96 | ``` |
| 97 | |
| 98 | ### Code Block Conversions |
| 99 | |
| 100 | For more see [code-blocks-to-html.md](references/code-blocks-to-html.md) |
| 101 | |
| 102 | ```text |
| 103 | |
| 104 | ```markdown |
| 105 | your code here |
| 106 | ``` |
| 107 | |
| 108 | ```html |
| 109 | <pre><code class="language-md"> |
| 110 | your code here |
| 111 | </code></pre> |
| 112 | ``` |
| 113 | |
| 114 | ```js |
| 115 | console.log("Hello world"); |
| 116 | ``` |
| 117 | |
| 118 | ```html |
| 119 | <pre><code class="language-js"> |
| 120 | console.log("Hello world"); |
| 121 | </code></pre> |
| 122 | ``` |
| 123 | |
| 124 | ```markdown |
| 125 | ``` |
| 126 | |
| 127 | ``` |
| 128 | visible backticks |
| 129 | ``` |
| 130 | |
| 131 | ``` |
| 132 | ``` |
| 133 | |
| 134 | ```html |
| 135 | <pre><code> |
| 136 | ``` |
| 137 | |
| 138 | visible backticks |
| 139 | |
| 140 | ``` |
| 141 | </code></pre> |
| 142 | ``` |
| 143 | ``` |
| 144 | |
| 145 | ### Collapsed Section Conversions |
| 146 | |
| 147 | For more see [collapsed-sections-to-html.md](references/collapsed-sections-to-html.md) |
| 148 | |
| 149 | ```text |
| 150 | ```markdown |
| 151 | <details> |
| 152 | <summary>More info</summary> |
| 153 | |
| 154 | ### Header inside |
| 155 | |
| 156 | - Lists |
| 157 | - **Formatting** |
| 158 | - Code blocks |
| 159 | |
| 160 | ```js |
| 161 | console.log("Hello"); |
| 162 | ``` |
| 163 | |
| 164 | </details> |
| 165 | ``` |
| 166 | |
| 167 | ```html |
| 168 | <details> |
| 169 | <summary>More info</summary> |
| 170 | |
| 171 | <h3>Header inside</h3> |
| 172 | |
| 173 | <ul> |
| 174 | <li>Lists</li> |
| 175 | <li><strong>Formatting</strong></li> |
| 176 | <li>Code blocks</li> |
| 177 | </ul> |
| 178 | |
| 179 | <pre> |
| 180 | <code class="language-js">console.log("Hello");</code> |
| 181 | </pre> |
| 182 | |
| 183 | </details> |
| 184 | ``` |
| 185 | ``` |
| 186 | |
| 187 | ### Mathematical Expression Conversions |
| 188 | |
| 189 | For more see [writing-mathematical-expressions-to-html.md](references/writing-mathematical-expressions-to-html.md) |
| 190 | |
| 191 | ```text |
| 192 | ```markdown |
| 193 | This sentence uses `$` delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$ |