视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
delimiters to show math inline: $\\sqrt{3x-1}+(1+x)^2$\n ```\n\n ```html\n \u003cp>This sentence uses \u003ccode>$\u003c/code> delimiters to show math inline:\n \u003cmath-renderer>\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\">\n \u003cmsqrt>\u003cmn>3\u003c/mn>\u003cmi>x\u003c/mi>\u003cmo>−\u003c/mo>\u003cmn>1\u003c/mn>\u003c/msqrt>\n \u003cmo>+\u003c/mo>\u003cmo>(\u003c/mo>\u003cmn>1\u003c/mn>\u003cmo>+\u003c/mo>\u003cmi>x\u003c/mi>\n \u003cmsup>\u003cmo>)\u003c/mo>\u003cmn>2\u003c/mn>\u003c/msup>\n \u003c/math>\n \u003c/math-renderer>\n \u003c/p>\n ```\n\n ```markdown\n **The Cauchy-Schwarz Inequality**\\\n $\\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)$\n ```\n\n ```html\n \u003cp>\u003cstrong>The Cauchy-Schwarz Inequality\u003c/strong>\u003cbr>\n \u003cmath-renderer>\n \u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\">\n \u003cmsup>\n \u003cmrow>\u003cmo>(\u003c/mo>\n \u003cmunderover>\u003cmo data-mjx-texclass=\"OP\">∑\u003c/mo>\n \u003cmrow>\u003cmi>k\u003c/mi>\u003cmo>=\u003c/mo>\u003cmn>1\u003c/mn>\u003c/mrow>\u003cmi>n\u003c/mi>\n \u003c/munderover>\n \u003cmsub>\u003cmi>a\u003c/mi>\u003cmi>k\u003c/mi>\u003c/msub>\n \u003cmsub>\u003cmi>b\u003c/mi>\u003cmi>k\u003c/mi>\u003c/msub>\n \u003cmo>)\u003c/mo>\n \u003c/mrow>\n \u003cmn>2\u003c/mn>\n \u003c/msup>\n \u003cmo>≤\u003c/mo>\n \u003cmrow>\u003cmo>(\u003c/mo>\n \u003cmunderover>\u003cmo>∑\u003c/mo>\n \u003cmrow>\u003cmi>k\u003c/mi>\u003cmo>=\u003c/mo>\u003cmn>1\u003c/mn>\u003c/mrow>\n \u003cmi>n\u003c/mi>\n \u003c/munderover>\n \u003cmsubsup>\u003cmi>a\u003c/mi>\u003cmi>k\u003c/mi>\u003cmn>2\u003c/mn>\u003c/msubsup>\n \u003cmo>)\u003c/mo>\n \u003c/mrow>\n \u003cmrow>\u003cmo>(\u003c/mo>\n \u003cmunderover>\u003cmo>∑\u003c/mo>\n \u003cmrow>\u003cmi>k\u003c/mi>\u003cmo>=\u003c/mo>\u003cmn>1\u003c/mn>\u003c/mrow>\n \u003cmi>n\u003c/mi>\n \u003c/munderover>\n \u003cmsubsup>\u003cmi>b\u003c/mi>\u003cmi>k\u003c/mi>\u003cmn>2\u003c/mn>\u003c/msubsup>\n \u003cmo>)\u003c/mo>\n \u003c/mrow>\n \u003c/math>\n \u003c/math-renderer>\u003c/p>\n ```\n```\n\n### Table Conversions\n\nFor more see [tables-to-html.md](references/tables-to-html.md)\n\n```text\n ```markdown\n | First Header | Second Header |\n | ------------- | ------------- |\n | Content Cell | Content Cell |\n | Content Cell | Content Cell |\n ```\n\n ```html\n \u003ctable>\n \u003cthead>\u003ctr>\u003cth>First Header\u003c/th>\u003cth>Second Header\u003c/th>\u003c/tr>\u003c/thead>\n \u003ctbody>\n \u003ctr>\u003ctd>Content Cell\u003c/td>\u003ctd>Content Cell\u003c/td>\u003c/tr>\n \u003ctr>\u003ctd>Content Cell\u003c/td>\u003ctd>Content Cell\u003c/td>\u003c/tr>\n \u003c/tbody>\n \u003c/table>\n ```\n\n ```markdown\n | Left-aligned | Center-aligned | Right-aligned |\n | :--- | :---: | ---: |\n | git status | git status | git status |\n | git diff | git diff | git diff |\n ```\n\n ```html\n \u003ctable>\n \u003cthead>\n \u003ctr>\n \u003cth align=\"left\">Left-aligned\u003c/th>\n \u003cth align=\"center\">Center-aligned\u003c/th>\n \u003cth align=\"right\">Right-aligned\u003c/th>\n \u003c/tr>\n \u003c/thead>\n \u003ctbody>\n \u003ctr>\n \u003ctd align=\"left\">git status\u003c/td>\n \u003ctd align=\"center\">git status\u003c/td>\n \u003ctd align=\"right\">git status\u003c/td>\n \u003c/tr>\n \u003ctr>\n \u003ctd align=\"left\">git diff\u003c/td>\n \u003ctd align=\"center\">git diff\u003c/td>\n \u003ctd align=\"right\">git diff\u003c/td>\n \u003c/tr>\n \u003c/tbody>\n \u003c/table>\n ```\n```\n\n## Working with [`markedJS/marked`](references/marked.md)\n\n### Prerequisites\n\n- Node.js installed (for CLI or programmatic usage)\n- Install marked globally for CLI: `npm install -g marked`\n- Or install locally: `npm install marked`\n\n### Quick Conversion Methods\n\nSee [marked.md](references/marked.md) **Quick Conversion Methods**\n\n### Step-by-Step Workflows\n\nSee [marked.md](references/marked.md) **Step-by-Step Workflows**\n\n### CLI Configuration\n\n### Using Config Files\n\nCreate `~/.marked.json` for persistent options:\n\n```json\n{\n \"gfm\": true,\n \"breaks\": true\n}\n```\n\nOr use a custom config:\n\n```bash\nmarked -i input.md -o output.html -c config.json\n```\n\n### CLI Options Reference\n\n| Option | Description |\n|--------|-------------|\n| `-i, --input \u003cfile>` | Input Markdown file |\n| `-o, --output \u003cfile>` | Output HTML file |\n| `-s, --string \u003cstring>` | Parse string instead of file |\n| `-c, --config \u003cfile>` | Use custom config file |\n| `--gfm` | Enable GitHub Flavored Markdown |\n| `--breaks` | Convert newlines to `\u003cbr>` |\n| `--help` | Show all options |\n\n### Security Warning\n\n⚠️ **Marked does NOT sanitize output HTML.** For untrusted input, use a sanitizer:\n\n```javascript\nimport { marked } from 'marked';\nimport DOMPurify from 'dompurify';\n\nconst unsafeHtml = marked.parse(untrustedMarkdown);\nconst safeHtml = DOMPurify.sanitize(unsafeHtml);\n```\n\nRecommended sanitizers:\n\n- [DOMPurify](https://github.com/cure53/DOMPurify) (recommended)\n- [sanitize-html](https://github.com/apostrophecms/sanitize-html)\n- [js-xss](https://github.com/leizongmin/js-xss)\n\n### Supported Markdown Flavors\n\n| Flavor | Support |\n|--------|---------|\n| Original Markdown | 100% |\n| CommonMark 0.31 | 98% |\n| GitHub Flavored Markdown | 97% |\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Special characters at file start | Strip zero-width chars: `content.replace(/^[\\u200B\\u200C\\u200D\\uFEFF]/,\"\")` |\n| Code blocks not highlighting | Add a syntax highlighter like highlight.js |\n| Tables not rendering | Ensure `gfm: true` option is set |\n| Line breaks ignored | Set `breaks: true` in options |\n| XSS vulnerability concerns | Use DOMPurify to sanitize output |\n\n## Working with [`pandoc`](references/pandoc.md)\n\n### Prerequisites\n\n- Pandoc installed (download from \u003chttps://pandoc.org/installing.html>)\n- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)\n- Terminal/command prompt access\n\n### Quick Conversion Methods\n\n#### Method 1: CLI Basic Conversion\n\n```bash\n# Convert markdown to HTML\npandoc input.md -o output.html\n\n# Convert with standalone document (includes header/footer)\npandoc input.md -s -o output.html\n\n# Explicit format specification\npandoc input.md -f markdown -t html -s -o output.html\n```\n\n#### Method 2: Filter Mode (Interactive)\n\n```bash\n# Start pandoc as a filter\npandoc\n\n# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)\nHello *pandoc*!\n# Output: \u003cp>Hello \u003cem>pandoc\u003c/em>!\u003c/p>\n```\n\n#### Method 3: Format Conversion\n\n```bash\n# HTML to Markdown\npandoc -f html -t markdown input.html -o output.md\n\n# Markdown to LaTeX\npandoc input.md -s -o output.tex\n\n# Markdown to PDF (requires LaTeX)\npandoc input.md -s -o output.pdf\n\n# Markdown to Word\npandoc input.md -s -o output.docx\n```\n\n### CLI Configuration\n\n| Option | Description |\n|--------|-------------|\n| `-f, --from \u003cformat>` | Input format (markdown, html, latex, etc.) |\n| `-t, --to \u003cformat>` | Output format (html, latex, pdf, docx, etc.) |\n| `-s, --standalone` | Produce standalone document with header/footer |\n| `-o, --output \u003cfile>` | Output file (inferred from extension) |\n| `--mathml` | Convert TeX math to MathML |\n| `--metadata title=\"Title\"` | Set document metadata |\n| `--toc` | Include table of contents |\n| `--template \u003cfile>` | Use custom template |\n| `--help` | Show all options |\n\n### Security Warning\n\n⚠️ **Pandoc processes input faithfully.** When converting untrusted markdown:\n\n- Use `--sandbox` mode to disable external file access\n- Validate input before processing\n- Sanitize HTML output if displayed in browsers\n\n```bash\n# Run in sandbox mode for untrusted input\npandoc --sandbox input.md -o output.html\n```\n\n### Supported Markdown Flavors\n\n| Flavor | Support |\n|--------|---------|\n| Pandoc Markdown | 100% (native) |\n| CommonMark | Full (use `-f commonmark`) |\n| GitHub Flavored Markdown | Full (use `-f gfm`) |\n| MultiMarkdown | Partial |\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| PDF generation fails | Install LaTeX (MacTeX, MiKTeX, or texlive) |\n| Encoding issues on Windows | Run `chcp 65001` before using pandoc |\n| Missing standalone headers | Add `-s` flag for complete documents |\n| Math not rendering | Use `--mathml` or `--mathjax` option |\n| Tables not rendering | Ensure proper table syntax with pipes and dashes |\n\n## Working with [`gomarkdown/markdown`](references/gomarkdown.md)\n\n### Prerequisites\n\n- Go 1.18 or higher installed\n- Install the library: `go get github.com/gomarkdown/markdown`\n- For CLI tool: `go install github.com/gomarkdown/mdtohtml@latest`\n\n### Quick Conversion Methods\n\n#### Method 1: Simple Conversion (Go)\n\n```go\npackage main\n\nimport (\n \"fmt\"\n \"github.com/gomarkdown/markdown\"\n)\n\nfunc main() {\n md := []byte(\"# Hello World\\n\\nThis is **bold** text.\")\n html := markdown.ToHTML(md, nil, nil)\n fmt.Println(string(html))\n}\n```\n\n#### Method 2: CLI Tool\n\n```bash\n# Install mdtohtml\ngo install github.com/gomarkdown/mdtohtml@latest\n\n# Convert file\nmdtohtml input.md output.html\n\n# Convert file (output to stdout)\nmdtohtml input.md\n```\n\n#### Method 3: Custom Parser and Renderer\n\n```go\npackage main\n\nimport (\n \"github.com/gomarkdown/markdown\"\n \"github.com/gomarkdown/markdown/html\"\n \"github.com/gomarkdown/markdown/parser\"\n)\n\nfunc mdToHTML(md []byte) []byte {\n // Create parser with extensions\n extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock\n p := parser.NewWithExtensions(extensions)\n doc := p.Parse(md)\n\n // Create HTML renderer with extensions\n htmlFlags := html.CommonFlags | html.HrefTargetBlank\n opts := html.RendererOptions{Flags: htmlFlags}\n renderer := html.NewRenderer(opts)\n\n return markdown.Render(doc, renderer)\n}\n```\n\n### CLI Configuration\n\nThe `mdtohtml` CLI tool has minimal options:\n\n```bash\nmdtohtml input-file [output-file]\n```\n\nFor advanced configuration, use the Go library programmatically with parser and renderer options:\n\n| Parser Extension | Description |\n|------------------|-------------|\n| `parser.CommonExtensions` | Tables, fenced code, autolinks, strikethrough, etc. |\n| `parser.AutoHeadingIDs` | Generate IDs for headings |\n| `parser.NoEmptyLineBeforeBlock` | No blank line needed before blocks |\n| `parser.MathJax` | MathJax support for LaTeX math |\n\n| HTML Flag | Description |\n|-----------|-------------|\n| `html.CommonFlags` | Common HTML output flags |\n| `html.HrefTargetBlank` | Add `target=\"_blank\"` to links |\n| `html.CompletePage` | Generate complete HTML page |\n| `html.UseXHTML` | Generate XHTML output |\n\n### Security Warning\n\n⚠️ **gomarkdown does NOT sanitize output HTML.** For untrusted input, use Bluemonday:\n\n```go\nimport (\n \"github.com/microcosm-cc/bluemonday\"\n \"github.com/gomarkdown/markdown\"\n)\n\nmaybeUnsafeHTML := markdown.ToHTML(md, nil, nil)\nhtml := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)\n```\n\nRecommended sanitizer: [Bluemonday](https://github.com/microcosm-cc/bluemonday)\n\n### Supported Markdown Flavors\n\n| Flavor | Support |\n|--------|---------|\n| Original Markdown | 100% |\n| CommonMark | High (with extensions) |\n| GitHub Flavored Markdown | High (tables, fenced code, strikethrough) |\n| MathJax/LaTeX Math | Supported via extension |\n| Mmark | Supported |\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Windows/Mac newlines not parsed | Use `parser.NormalizeNewlines(input)` |\n| Tables not rendering | Enable `parser.Tables` extension |\n| Code blocks without highlighting | Integrate with syntax highlighter like Chroma |\n| Math not rendering | Enable `parser.MathJax` extension |\n| XSS vulnerabilities | Use Bluemonday to sanitize output |\n\n## Working with [`jekyll`](references/jekyll.md)\n\n### Prerequisites\n\n- Ruby version 2.7.0 or higher\n- RubyGems\n- GCC and Make (for native extensions)\n- Install Jekyll and Bundler: `gem install jekyll bundler`\n\n### Quick Conversion Methods\n\n#### Method 1: Create New Site\n\n```bash\n# Create a new Jekyll site\njekyll new myblog\n\n# Change to site directory\ncd myblog\n\n# Build and serve locally\nbundle exec jekyll serve\n\n# Access at http://localhost:4000\n```\n\n#### Method 2: Build Static Site\n\n```bash\n# Build site to _site directory\nbundle exec jekyll build\n\n# Build with production environment\nJEKYLL_ENV=production bundle exec jekyll build\n```\n\n#### Method 3: Live Reload Development\n\n```bash\n# Serve with live reload\nbundle exec jekyll serve --livereload\n\n# Serve with drafts\nbundle exec jekyll serve --drafts\n```\n\n### CLI Configuration\n\n| Command | Description |\n|---------|-------------|\n| `jekyll new \u003cpath>` | Create new Jekyll site |\n| `jekyll build` | Build site to `_site` directory |\n| `jekyll serve` | Build and serve locally |\n| `jekyll clean` | Remove generated files |\n| `jekyll doctor` | Check for configuration issues |\n\n| Serve Options | Description |\n|---------------|-------------|\n| `--livereload` | Reload browser on changes |\n| `--drafts` | Include draft posts |\n| `--port \u003cport>` | Set server port (default: 4000) |\n| `--host \u003chost>` | Set server host (default: localhost) |\n| `--baseurl \u003curl>` | Set base URL |\n\n### Security Warning\n\n⚠️ **Jekyll security considerations:**\n\n- Avoid using `safe: false` in production\n- Use `exclude` in `_config.yml` to prevent sensitive files from being published\n- Sanitize user-generated content if accepting external input\n- Keep Jekyll and plugins updated\n\n```yaml\n# _config.yml security settings\nexclude:\n - Gemfile\n - Gemfile.lock\n - node_modules\n - vendor\n```\n\n### Supported Markdown Flavors\n\n| Flavor | Support |\n|--------|---------|\n| Kramdown (default) | 100% |\n| CommonMark | Via plugin (jekyll-commonmark) |\n| GitHub Flavored Markdown | Via plugin (jekyll-commonmark-ghpages) |\n| RedCarpet | Via plugin (deprecated) |\n\nConfigure markdown processor in `_config.yml`:\n\n```yaml\nmarkdown: kramdown\nkramdown:\n input: GFM\n syntax_highlighter: rouge\n```\n\n### Troubleshooting\n\n| Issue | Solution |\n|-------|----------|\n| Ruby 3.0+ fails to serve | Run `bundle add webrick` |\n| Gem dependency errors | Run `bundle install` |\n| Slow builds | Use `--incremental` flag |\n| Liquid syntax errors | Check for unescaped `{` in content |\n| Plugin not loading | Add to `_config.yml` plugins list |\n\n## Working with [`hugo`](references/hugo.md)\n\n### Prerequisites\n\n- Hugo installed (download from \u003chttps://gohugo.io/installation/>)\n- Git (recommended for themes and modules)\n- Go (optional, for Hugo Modules)\n\n### Quick Conversion Methods\n\n#### Method 1: Create New Site\n\n```bash\n# Create a new Hugo site\nhugo new site mysite\n\n# Change to site directory\ncd mysite\n\n# Add a theme\ngit init\ngit submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke\necho \"theme = 'ananke'\" >> hugo.toml\n\n# Create content\nhugo new content posts/my-first-post.md\n\n# Start development server\nhugo server -D\n```\n\n#### Method 2: Build Static Site\n\n```bash\n# Build site to public directory\nhugo\n\n# Build with minification\nhugo --minify\n\n# Build for specific environment\nhugo --environment production\n```\n\n#### Method 3: Development Server\n\n```bash\n# Start server with drafts\nhugo server -D\n\n# Start with live reload and bind to all interfaces\nhugo server --bind 0.0.0.0 --baseURL http://localhost:1313/\n\n# Start with specific port\nhugo server --port 8080\n```\n\n### CLI Configuration\n\n| Command | Description |\n|---------|-------------|\n| `hugo new site \u003cname>` | Create new Hugo site |\n| `hugo new content \u003cpath>` | Create new content file |\n| `hugo` | Build site to `public` directory |\n| `hugo server` | Start development server |\n| `hugo mod init` | Initialize Hugo Modules |\n\n| Build Options | Description |\n|---------------|-------------|\n| `-D, --buildDrafts` | Include draft content |\n| `-E, --buildExpired` | Include expired content |\n| `-F, --buildFuture` | Include future-dated content |\n| `--minify` | Minify output |\n| `--gc` | Run garbage collection after build |\n| `-d, --destination \u003cpath>` | Output directory |\n\n| Server Options | Description |\n|----------------|-------------|\n| `--bind \u003cip>` | Interface to bind to |\n| `-p, --port \u003cport>` | Port number (default: 1313) |\n| `--liveReloadPort \u003cport>` | Live reload port |\n| `--disableLiveReload` | Disable live reload |\n| `--navigateToChanged` | Navigate to changed content |\n\n### Security Warning\n\n⚠️ **Hugo security considerations:**\n\n- Configure security policy in `hugo.toml` for external commands\n- Use `--enableGitInfo` carefully with public repositories\n- Validate shortcode parameters for user-generated content\n\n```toml\n# hugo.toml security settings\n[security]\n enableInlineShortcodes = false\n [security.exec]\n allow = ['^go
markdown-to-html【文档与办公】Convert 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 utilize markdown documents, converting them to html. Use when asked to "conv…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.'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 repository. For custom scripts knowledge is not confined to marked.js, but data conversion methods are utilized from tools like pandoc and gomarkdown/markdown for data conversion; jekyll/jekyll and gohugoio/hugo for templating systems.
The conversion script or tool should handle single files, batch conversions, and advanced configurations.
For more see basic-markdown-to-html.md
```markdown
# Level 1
## Level 2
One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`.
- `ul` list item 1
- `ul` list item 2
1. `ol` list item 1
2. `ol` list item 1
| Table Item | Description |
| One | One is the spelling of the number `1`. |
| Two | Two is the spelling of the number `2`. |
```js
var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));
```
```
```html
<h1>Level 1</h1>
<h2>Level 2</h2>
<p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p>
<ul>
<li>`ul` list item 1</li>
<li>`ul` list item 2</li>
</ul>
<ol>
<li>`ol` list item 1</li>
<li>`ol` list item 2</li>
</ol>
<table>
<thead>
<tr>
<th>Table Item</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One is the spelling of the number `1`.</td>
</tr>
<tr>
<td>Two</td>
<td>Two is the spelling of the number `2`.</td>
</tr>
</tbody>
</table>
<pre>
<code>var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));</code>
</pre>
```
For more see code-blocks-to-html.md
```markdown
your code here
```
```html
<pre><code class="language-md">
your code here
</code></pre>
```
```js
console.log("Hello world");
```
```html
<pre><code class="language-js">
console.log("Hello world");
</code></pre>
```
```markdown
```
```
visible backticks
```
```
```
```html
<pre><code>
```
visible backticks
```
</code></pre>
```
For more see collapsed-sections-to-html.md
```markdown
<details>
<summary>More info</summary>
### Header inside
- Lists
- **Formatting**
- Code blocks
```js
console.log("Hello");
```
</details>
```
```html
<details>
<summary>More info</summary>
<h3>Header inside</h3>
<ul>
<li>Lists</li>
<li><strong>Formatting</strong></li>
<li>Code blocks</li>
</ul>
<pre>
<code class="language-js">console.log("Hello");</code>
</pre>
</details>
```
For more see writing-mathematical-expressions-to-html.md
```markdown
This sentence uses `
markdown-to-html · Skills-SI 市场
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
```
```html
<p>This sentence uses <code>lt;/code> delimiters to show math inline:
<math-renderer><math xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt><mn>3</mn><mi>x</mi><mo>−</mo><mn>1</mn></msqrt>
<mo>+</mo><mo>(</mo><mn>1</mn><mo>+</mo><mi>x</mi>
<msup><mo>)</mo><mn>2</mn></msup>
</math>
</math-renderer>
</p>
```
```markdown
**The Cauchy-Schwarz Inequality**\
$\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)$
```
```html
<p><strong>The Cauchy-Schwarz Inequality</strong><br>
<math-renderer>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow><mo>(</mo>
<munderover><mo data-mjx-texclass="OP">∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi>
</munderover>
<msub><mi>a</mi><mi>k</mi></msub>
<msub><mi>b</mi><mi>k</mi></msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>≤</mo>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>a</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>b</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
</math>
</math-renderer></p>
```
Table Conversions
For more see tables-to-html.md
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
```html
<table>
<thead><tr><th>First Header</th><th>Second Header</th></tr></thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
```
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
```html
<table>
<thead>
<tr>
<th align="left">Left-aligned</th>
<th align="center">Center-aligned</th>
<th align="right">Right-aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">git status</td>
<td align="center">git status</td>
<td align="right">git status</td>
</tr>
<tr>
<td align="left">git diff</td>
<td align="center">git diff</td>
<td align="right">git diff</td>
</tr>
</tbody>
</table>
```
Working with markedJS/marked
Prerequisites
- Node.js installed (for CLI or programmatic usage)
- Install marked globally for CLI:
npm install -g marked
- Or install locally:
npm install marked
Quick Conversion Methods
See marked.md Quick Conversion Methods
Step-by-Step Workflows
See marked.md Step-by-Step Workflows
CLI Configuration
Using Config Files
Create ~/.marked.json for persistent options:
{
"gfm": true,
"breaks": true
}
Or use a custom config:
marked -i input.md -o output.html -c config.json
CLI Options Reference
Option Description -i, --input <file>Input Markdown file -o, --output <file>Output HTML file -s, --string <string>Parse string instead of file -c, --config <file>Use custom config file --gfmEnable GitHub Flavored Markdown --breaksConvert newlines to <br> --helpShow all options
Security Warning
⚠️ Marked does NOT sanitize output HTML. For untrusted input, use a sanitizer:
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const unsafeHtml = marked.parse(untrustedMarkdown);
const safeHtml = DOMPurify.sanitize(unsafeHtml);
Recommended sanitizers:
- DOMPurify (recommended)
- sanitize-html
- js-xss
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark 0.31 98% GitHub Flavored Markdown 97%
Troubleshooting
Issue Solution Special characters at file start Strip zero-width chars: content.replace(/^[\u200B\u200C\u200D\uFEFF]/,"") Code blocks not highlighting Add a syntax highlighter like highlight.js Tables not rendering Ensure gfm: true option is set Line breaks ignored Set breaks: true in options XSS vulnerability concerns Use DOMPurify to sanitize output
Working with pandoc
Prerequisites
- Pandoc installed (download from https://pandoc.org/installing.html)
- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)
- Terminal/command prompt access
Quick Conversion Methods
Method 1: CLI Basic Conversion
# Convert markdown to HTML
pandoc input.md -o output.html
# Convert with standalone document (includes header/footer)
pandoc input.md -s -o output.html
# Explicit format specification
pandoc input.md -f markdown -t html -s -o output.html
Method 2: Filter Mode (Interactive)
# Start pandoc as a filter
pandoc
# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)
Hello *pandoc*!
# Output: <p>Hello <em>pandoc</em>!</p>
Method 3: Format Conversion
# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md
# Markdown to LaTeX
pandoc input.md -s -o output.tex
# Markdown to PDF (requires LaTeX)
pandoc input.md -s -o output.pdf
# Markdown to Word
pandoc input.md -s -o output.docx
CLI Configuration
Option Description -f, --from <format>Input format (markdown, html, latex, etc.) -t, --to <format>Output format (html, latex, pdf, docx, etc.) -s, --standaloneProduce standalone document with header/footer -o, --output <file>Output file (inferred from extension) --mathmlConvert TeX math to MathML --metadata title="Title"Set document metadata --tocInclude table of contents --template <file>Use custom template --helpShow all options
Security Warning
⚠️ Pandoc processes input faithfully. When converting untrusted markdown:
- Use
--sandbox mode to disable external file access
- Validate input before processing
- Sanitize HTML output if displayed in browsers
# Run in sandbox mode for untrusted input
pandoc --sandbox input.md -o output.html
Supported Markdown Flavors
Flavor Support Pandoc Markdown 100% (native) CommonMark Full (use -f commonmark) GitHub Flavored Markdown Full (use -f gfm) MultiMarkdown Partial
Troubleshooting
Issue Solution PDF generation fails Install LaTeX (MacTeX, MiKTeX, or texlive) Encoding issues on Windows Run chcp 65001 before using pandoc Missing standalone headers Add -s flag for complete documents Math not rendering Use --mathml or --mathjax option Tables not rendering Ensure proper table syntax with pipes and dashes
Working with gomarkdown/markdown
Prerequisites
- Go 1.18 or higher installed
- Install the library:
go get github.com/gomarkdown/markdown
- For CLI tool:
go install github.com/gomarkdown/mdtohtml@latest
Quick Conversion Methods
Method 1: Simple Conversion (Go)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
)
func main() {
md := []byte("# Hello World\n\nThis is **bold** text.")
html := markdown.ToHTML(md, nil, nil)
fmt.Println(string(html))
}
Method 2: CLI Tool
# Install mdtohtml
go install github.com/gomarkdown/mdtohtml@latest
# Convert file
mdtohtml input.md output.html
# Convert file (output to stdout)
mdtohtml input.md
Method 3: Custom Parser and Renderer
package main
import (
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
)
func mdToHTML(md []byte) []byte {
// Create parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
p := parser.NewWithExtensions(extensions)
doc := p.Parse(md)
// Create HTML renderer with extensions
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
renderer := html.NewRenderer(opts)
return markdown.Render(doc, renderer)
}
CLI Configuration
The mdtohtml CLI tool has minimal options:
mdtohtml input-file [output-file]
For advanced configuration, use the Go library programmatically with parser and renderer options:
Parser Extension Description parser.CommonExtensionsTables, fenced code, autolinks, strikethrough, etc. parser.AutoHeadingIDsGenerate IDs for headings parser.NoEmptyLineBeforeBlockNo blank line needed before blocks parser.MathJaxMathJax support for LaTeX math
HTML Flag Description html.CommonFlagsCommon HTML output flags html.HrefTargetBlankAdd target="_blank" to links html.CompletePageGenerate complete HTML page html.UseXHTMLGenerate XHTML output
Security Warning
⚠️ gomarkdown does NOT sanitize output HTML. For untrusted input, use Bluemonday:
import (
"github.com/microcosm-cc/bluemonday"
"github.com/gomarkdown/markdown"
)
maybeUnsafeHTML := markdown.ToHTML(md, nil, nil)
html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)
Recommended sanitizer: Bluemonday
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark High (with extensions) GitHub Flavored Markdown High (tables, fenced code, strikethrough) MathJax/LaTeX Math Supported via extension Mmark Supported
Troubleshooting
Issue Solution Windows/Mac newlines not parsed Use parser.NormalizeNewlines(input) Tables not rendering Enable parser.Tables extension Code blocks without highlighting Integrate with syntax highlighter like Chroma Math not rendering Enable parser.MathJax extension XSS vulnerabilities Use Bluemonday to sanitize output
Working with jekyll
Prerequisites
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make (for native extensions)
- Install Jekyll and Bundler:
gem install jekyll bundler
Quick Conversion Methods
Method 1: Create New Site
# Create a new Jekyll site
jekyll new myblog
# Change to site directory
cd myblog
# Build and serve locally
bundle exec jekyll serve
# Access at http://localhost:4000
Method 2: Build Static Site
# Build site to _site directory
bundle exec jekyll build
# Build with production environment
JEKYLL_ENV=production bundle exec jekyll build
Method 3: Live Reload Development
# Serve with live reload
bundle exec jekyll serve --livereload
# Serve with drafts
bundle exec jekyll serve --drafts
CLI Configuration
Command Description jekyll new <path>Create new Jekyll site jekyll buildBuild site to _site directory jekyll serveBuild and serve locally jekyll cleanRemove generated files jekyll doctorCheck for configuration issues
Serve Options Description --livereloadReload browser on changes --draftsInclude draft posts --port <port>Set server port (default: 4000) --host <host>Set server host (default: localhost) --baseurl <url>Set base URL
Security Warning
⚠️ Jekyll security considerations:
- Avoid using
safe: false in production
- Use
exclude in _config.yml to prevent sensitive files from being published
- Sanitize user-generated content if accepting external input
- Keep Jekyll and plugins updated
# _config.yml security settings
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Supported Markdown Flavors
Flavor Support Kramdown (default) 100% CommonMark Via plugin (jekyll-commonmark) GitHub Flavored Markdown Via plugin (jekyll-commonmark-ghpages) RedCarpet Via plugin (deprecated)
Configure markdown processor in _config.yml:
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
Troubleshooting
Issue Solution Ruby 3.0+ fails to serve Run bundle add webrick Gem dependency errors Run bundle install Slow builds Use --incremental flag Liquid syntax errors Check for unescaped { in content Plugin not loading Add to _config.yml plugins list
Working with hugo
Prerequisites
- Hugo installed (download from https://gohugo.io/installation/)
- Git (recommended for themes and modules)
- Go (optional, for Hugo Modules)
Quick Conversion Methods
Method 1: Create New Site
# Create a new Hugo site
hugo new site mysite
# Change to site directory
cd mysite
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new content posts/my-first-post.md
# Start development server
hugo server -D
Method 2: Build Static Site
# Build site to public directory
hugo
# Build with minification
hugo --minify
# Build for specific environment
hugo --environment production
Method 3: Development Server
# Start server with drafts
hugo server -D
# Start with live reload and bind to all interfaces
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
# Start with specific port
hugo server --port 8080
CLI Configuration
Command Description hugo new site <name>Create new Hugo site hugo new content <path>Create new content file hugoBuild site to public directory hugo serverStart development server hugo mod initInitialize Hugo Modules
Build Options Description -D, --buildDraftsInclude draft content -E, --buildExpiredInclude expired content -F, --buildFutureInclude future-dated content --minifyMinify output --gcRun garbage collection after build -d, --destination <path>Output directory
Server Options Description --bind <ip>Interface to bind to -p, --port <port>Port number (default: 1313) --liveReloadPort <port>Live reload port --disableLiveReloadDisable live reload --navigateToChangedNavigate to changed content
Security Warning
⚠️ Hugo security considerations:
- Configure security policy in
hugo.toml for external commands
- Use
--enableGitInfo carefully with public repositories
- Validate shortcode parameters for user-generated content
# hugo.toml security settings
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^go#x27;, '^npx#x27;, '^postcss#x27;]
[security.funcs]
getenv = ['^HUGO_', '^CI#x27;]
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
Supported Markdown Flavors
Flavor Support Goldmark (default) 100% (CommonMark compliant) GitHub Flavored Markdown Full (tables, strikethrough, autolinks) CommonMark 100% Blackfriday (legacy) Deprecated, not recommended
Configure markdown in hugo.toml:
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.renderer]
unsafe = false # Set true to allow raw HTML
Troubleshooting
Issue Solution "Page not found" on paths Check baseURL in config Theme not loading Verify theme in themes/ or Hugo Modules Slow builds Use --templateMetrics to identify bottlenecks Raw HTML not rendering Set unsafe = true in goldmark config Images not loading Check static/ folder structure Module errors Run hugo mod tidy
References
Writing and Styling Markdown
- basic-markdown.md
- code-blocks.md
- collapsed-sections.md
- tables.md
- writing-mathematical-expressions.md
- Markdown Guide: https://www.markdownguide.org/basic-syntax/
- Styling Markdown: https://github.com/sindresorhus/github-markdown-css
markedJS/marked
- Official documentation: https://marked.js.org/
- Advanced options: https://marked.js.org/using_advanced
- Extensibility: https://marked.js.org/using_pro
- GitHub repository: https://github.com/markedjs/marked
pandoc
- Getting started: https://pandoc.org/getting-started.html
- Official documentation: https://pandoc.org/MANUAL.html
- Extensibility: https://pandoc.org/extras.html
- GitHub repository: https://github.com/jgm/pandoc
gomarkdown/markdown
- Official documentation: https://pkg.go.dev/github.com/gomarkdown/markdown
- Advanced configuration: https://pkg.go.dev/github.com/gomarkdown/markdown@v0.0.0-20250810172220-2e2c11897d1a/html
- Markdown processing: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
- GitHub repository: https://github.com/gomarkdown/markdown
jekyll
- Official documentation: https://jekyllrb.com/docs/
- Configuration options: https://jekyllrb.com/docs/configuration/options/
- Plugins: https://jekyllrb.com/docs/plugins/
- GitHub repository: https://github.com/jekyll/jekyll
hugo
- Official documentation: https://gohugo.io/documentation/
- All Settings: https://gohugo.io/configuration/all/
- Editor Plugins: https://gohugo.io/tools/editors/
- GitHub repository: https://github.com/gohugoio/hugo
markdown-to-html【文档与办公】Convert 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 utilize markdown documents, converting them to html. Use when asked to "conv…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.'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 repository. For custom scripts knowledge is not confined to marked.js, but data conversion methods are utilized from tools like pandoc and gomarkdown/markdown for data conversion; jekyll/jekyll and gohugoio/hugo for templating systems.
The conversion script or tool should handle single files, batch conversions, and advanced configurations.
For more see basic-markdown-to-html.md
```markdown
# Level 1
## Level 2
One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`.
- `ul` list item 1
- `ul` list item 2
1. `ol` list item 1
2. `ol` list item 1
| Table Item | Description |
| One | One is the spelling of the number `1`. |
| Two | Two is the spelling of the number `2`. |
```js
var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));
```
```
```html
<h1>Level 1</h1>
<h2>Level 2</h2>
<p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p>
<ul>
<li>`ul` list item 1</li>
<li>`ul` list item 2</li>
</ul>
<ol>
<li>`ol` list item 1</li>
<li>`ol` list item 2</li>
</ol>
<table>
<thead>
<tr>
<th>Table Item</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One is the spelling of the number `1`.</td>
</tr>
<tr>
<td>Two</td>
<td>Two is the spelling of the number `2`.</td>
</tr>
</tbody>
</table>
<pre>
<code>var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));</code>
</pre>
```
For more see code-blocks-to-html.md
```markdown
your code here
```
```html
<pre><code class="language-md">
your code here
</code></pre>
```
```js
console.log("Hello world");
```
```html
<pre><code class="language-js">
console.log("Hello world");
</code></pre>
```
```markdown
```
```
visible backticks
```
```
```
```html
<pre><code>
```
visible backticks
```
</code></pre>
```
For more see collapsed-sections-to-html.md
```markdown
<details>
<summary>More info</summary>
### Header inside
- Lists
- **Formatting**
- Code blocks
```js
console.log("Hello");
```
</details>
```
```html
<details>
<summary>More info</summary>
<h3>Header inside</h3>
<ul>
<li>Lists</li>
<li><strong>Formatting</strong></li>
<li>Code blocks</li>
</ul>
<pre>
<code class="language-js">console.log("Hello");</code>
</pre>
</details>
```
For more see writing-mathematical-expressions-to-html.md
```markdown
This sentence uses `
markdown-to-html · Skills-SI 市场
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
```
```html
<p>This sentence uses <code>lt;/code> delimiters to show math inline:
<math-renderer><math xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt><mn>3</mn><mi>x</mi><mo>−</mo><mn>1</mn></msqrt>
<mo>+</mo><mo>(</mo><mn>1</mn><mo>+</mo><mi>x</mi>
<msup><mo>)</mo><mn>2</mn></msup>
</math>
</math-renderer>
</p>
```
```markdown
**The Cauchy-Schwarz Inequality**\
$\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)$
```
```html
<p><strong>The Cauchy-Schwarz Inequality</strong><br>
<math-renderer>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow><mo>(</mo>
<munderover><mo data-mjx-texclass="OP">∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi>
</munderover>
<msub><mi>a</mi><mi>k</mi></msub>
<msub><mi>b</mi><mi>k</mi></msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>≤</mo>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>a</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>b</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
</math>
</math-renderer></p>
```
Table Conversions
For more see tables-to-html.md
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
```html
<table>
<thead><tr><th>First Header</th><th>Second Header</th></tr></thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
```
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
```html
<table>
<thead>
<tr>
<th align="left">Left-aligned</th>
<th align="center">Center-aligned</th>
<th align="right">Right-aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">git status</td>
<td align="center">git status</td>
<td align="right">git status</td>
</tr>
<tr>
<td align="left">git diff</td>
<td align="center">git diff</td>
<td align="right">git diff</td>
</tr>
</tbody>
</table>
```
Working with markedJS/marked
Prerequisites
- Node.js installed (for CLI or programmatic usage)
- Install marked globally for CLI:
npm install -g marked
- Or install locally:
npm install marked
Quick Conversion Methods
See marked.md Quick Conversion Methods
Step-by-Step Workflows
See marked.md Step-by-Step Workflows
CLI Configuration
Using Config Files
Create ~/.marked.json for persistent options:
{
"gfm": true,
"breaks": true
}
Or use a custom config:
marked -i input.md -o output.html -c config.json
CLI Options Reference
Option Description -i, --input <file>Input Markdown file -o, --output <file>Output HTML file -s, --string <string>Parse string instead of file -c, --config <file>Use custom config file --gfmEnable GitHub Flavored Markdown --breaksConvert newlines to <br> --helpShow all options
Security Warning
⚠️ Marked does NOT sanitize output HTML. For untrusted input, use a sanitizer:
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const unsafeHtml = marked.parse(untrustedMarkdown);
const safeHtml = DOMPurify.sanitize(unsafeHtml);
Recommended sanitizers:
- DOMPurify (recommended)
- sanitize-html
- js-xss
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark 0.31 98% GitHub Flavored Markdown 97%
Troubleshooting
Issue Solution Special characters at file start Strip zero-width chars: content.replace(/^[\u200B\u200C\u200D\uFEFF]/,"") Code blocks not highlighting Add a syntax highlighter like highlight.js Tables not rendering Ensure gfm: true option is set Line breaks ignored Set breaks: true in options XSS vulnerability concerns Use DOMPurify to sanitize output
Working with pandoc
Prerequisites
- Pandoc installed (download from https://pandoc.org/installing.html)
- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)
- Terminal/command prompt access
Quick Conversion Methods
Method 1: CLI Basic Conversion
# Convert markdown to HTML
pandoc input.md -o output.html
# Convert with standalone document (includes header/footer)
pandoc input.md -s -o output.html
# Explicit format specification
pandoc input.md -f markdown -t html -s -o output.html
Method 2: Filter Mode (Interactive)
# Start pandoc as a filter
pandoc
# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)
Hello *pandoc*!
# Output: <p>Hello <em>pandoc</em>!</p>
Method 3: Format Conversion
# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md
# Markdown to LaTeX
pandoc input.md -s -o output.tex
# Markdown to PDF (requires LaTeX)
pandoc input.md -s -o output.pdf
# Markdown to Word
pandoc input.md -s -o output.docx
CLI Configuration
Option Description -f, --from <format>Input format (markdown, html, latex, etc.) -t, --to <format>Output format (html, latex, pdf, docx, etc.) -s, --standaloneProduce standalone document with header/footer -o, --output <file>Output file (inferred from extension) --mathmlConvert TeX math to MathML --metadata title="Title"Set document metadata --tocInclude table of contents --template <file>Use custom template --helpShow all options
Security Warning
⚠️ Pandoc processes input faithfully. When converting untrusted markdown:
- Use
--sandbox mode to disable external file access
- Validate input before processing
- Sanitize HTML output if displayed in browsers
# Run in sandbox mode for untrusted input
pandoc --sandbox input.md -o output.html
Supported Markdown Flavors
Flavor Support Pandoc Markdown 100% (native) CommonMark Full (use -f commonmark) GitHub Flavored Markdown Full (use -f gfm) MultiMarkdown Partial
Troubleshooting
Issue Solution PDF generation fails Install LaTeX (MacTeX, MiKTeX, or texlive) Encoding issues on Windows Run chcp 65001 before using pandoc Missing standalone headers Add -s flag for complete documents Math not rendering Use --mathml or --mathjax option Tables not rendering Ensure proper table syntax with pipes and dashes
Working with gomarkdown/markdown
Prerequisites
- Go 1.18 or higher installed
- Install the library:
go get github.com/gomarkdown/markdown
- For CLI tool:
go install github.com/gomarkdown/mdtohtml@latest
Quick Conversion Methods
Method 1: Simple Conversion (Go)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
)
func main() {
md := []byte("# Hello World\n\nThis is **bold** text.")
html := markdown.ToHTML(md, nil, nil)
fmt.Println(string(html))
}
Method 2: CLI Tool
# Install mdtohtml
go install github.com/gomarkdown/mdtohtml@latest
# Convert file
mdtohtml input.md output.html
# Convert file (output to stdout)
mdtohtml input.md
Method 3: Custom Parser and Renderer
package main
import (
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
)
func mdToHTML(md []byte) []byte {
// Create parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
p := parser.NewWithExtensions(extensions)
doc := p.Parse(md)
// Create HTML renderer with extensions
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
renderer := html.NewRenderer(opts)
return markdown.Render(doc, renderer)
}
CLI Configuration
The mdtohtml CLI tool has minimal options:
mdtohtml input-file [output-file]
For advanced configuration, use the Go library programmatically with parser and renderer options:
Parser Extension Description parser.CommonExtensionsTables, fenced code, autolinks, strikethrough, etc. parser.AutoHeadingIDsGenerate IDs for headings parser.NoEmptyLineBeforeBlockNo blank line needed before blocks parser.MathJaxMathJax support for LaTeX math
HTML Flag Description html.CommonFlagsCommon HTML output flags html.HrefTargetBlankAdd target="_blank" to links html.CompletePageGenerate complete HTML page html.UseXHTMLGenerate XHTML output
Security Warning
⚠️ gomarkdown does NOT sanitize output HTML. For untrusted input, use Bluemonday:
import (
"github.com/microcosm-cc/bluemonday"
"github.com/gomarkdown/markdown"
)
maybeUnsafeHTML := markdown.ToHTML(md, nil, nil)
html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)
Recommended sanitizer: Bluemonday
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark High (with extensions) GitHub Flavored Markdown High (tables, fenced code, strikethrough) MathJax/LaTeX Math Supported via extension Mmark Supported
Troubleshooting
Issue Solution Windows/Mac newlines not parsed Use parser.NormalizeNewlines(input) Tables not rendering Enable parser.Tables extension Code blocks without highlighting Integrate with syntax highlighter like Chroma Math not rendering Enable parser.MathJax extension XSS vulnerabilities Use Bluemonday to sanitize output
Working with jekyll
Prerequisites
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make (for native extensions)
- Install Jekyll and Bundler:
gem install jekyll bundler
Quick Conversion Methods
Method 1: Create New Site
# Create a new Jekyll site
jekyll new myblog
# Change to site directory
cd myblog
# Build and serve locally
bundle exec jekyll serve
# Access at http://localhost:4000
Method 2: Build Static Site
# Build site to _site directory
bundle exec jekyll build
# Build with production environment
JEKYLL_ENV=production bundle exec jekyll build
Method 3: Live Reload Development
# Serve with live reload
bundle exec jekyll serve --livereload
# Serve with drafts
bundle exec jekyll serve --drafts
CLI Configuration
Command Description jekyll new <path>Create new Jekyll site jekyll buildBuild site to _site directory jekyll serveBuild and serve locally jekyll cleanRemove generated files jekyll doctorCheck for configuration issues
Serve Options Description --livereloadReload browser on changes --draftsInclude draft posts --port <port>Set server port (default: 4000) --host <host>Set server host (default: localhost) --baseurl <url>Set base URL
Security Warning
⚠️ Jekyll security considerations:
- Avoid using
safe: false in production
- Use
exclude in _config.yml to prevent sensitive files from being published
- Sanitize user-generated content if accepting external input
- Keep Jekyll and plugins updated
# _config.yml security settings
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Supported Markdown Flavors
Flavor Support Kramdown (default) 100% CommonMark Via plugin (jekyll-commonmark) GitHub Flavored Markdown Via plugin (jekyll-commonmark-ghpages) RedCarpet Via plugin (deprecated)
Configure markdown processor in _config.yml:
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
Troubleshooting
Issue Solution Ruby 3.0+ fails to serve Run bundle add webrick Gem dependency errors Run bundle install Slow builds Use --incremental flag Liquid syntax errors Check for unescaped { in content Plugin not loading Add to _config.yml plugins list
Working with hugo
Prerequisites
- Hugo installed (download from https://gohugo.io/installation/)
- Git (recommended for themes and modules)
- Go (optional, for Hugo Modules)
Quick Conversion Methods
Method 1: Create New Site
# Create a new Hugo site
hugo new site mysite
# Change to site directory
cd mysite
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new content posts/my-first-post.md
# Start development server
hugo server -D
Method 2: Build Static Site
# Build site to public directory
hugo
# Build with minification
hugo --minify
# Build for specific environment
hugo --environment production
Method 3: Development Server
# Start server with drafts
hugo server -D
# Start with live reload and bind to all interfaces
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
# Start with specific port
hugo server --port 8080
CLI Configuration
Command Description hugo new site <name>Create new Hugo site hugo new content <path>Create new content file hugoBuild site to public directory hugo serverStart development server hugo mod initInitialize Hugo Modules
Build Options Description -D, --buildDraftsInclude draft content -E, --buildExpiredInclude expired content -F, --buildFutureInclude future-dated content --minifyMinify output --gcRun garbage collection after build -d, --destination <path>Output directory
Server Options Description --bind <ip>Interface to bind to -p, --port <port>Port number (default: 1313) --liveReloadPort <port>Live reload port --disableLiveReloadDisable live reload --navigateToChangedNavigate to changed content
Security Warning
⚠️ Hugo security considerations:
- Configure security policy in
hugo.toml for external commands
- Use
--enableGitInfo carefully with public repositories
- Validate shortcode parameters for user-generated content
# hugo.toml security settings
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^go#x27;, '^npx#x27;, '^postcss#x27;]
[security.funcs]
getenv = ['^HUGO_', '^CI#x27;]
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
Supported Markdown Flavors
Flavor Support Goldmark (default) 100% (CommonMark compliant) GitHub Flavored Markdown Full (tables, strikethrough, autolinks) CommonMark 100% Blackfriday (legacy) Deprecated, not recommended
Configure markdown in hugo.toml:
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.renderer]
unsafe = false # Set true to allow raw HTML
Troubleshooting
Issue Solution "Page not found" on paths Check baseURL in config Theme not loading Verify theme in themes/ or Hugo Modules Slow builds Use --templateMetrics to identify bottlenecks Raw HTML not rendering Set unsafe = true in goldmark config Images not loading Check static/ folder structure Module errors Run hugo mod tidy
References
Writing and Styling Markdown
- basic-markdown.md
- code-blocks.md
- collapsed-sections.md
- tables.md
- writing-mathematical-expressions.md
- Markdown Guide: https://www.markdownguide.org/basic-syntax/
- Styling Markdown: https://github.com/sindresorhus/github-markdown-css
markedJS/marked
- Official documentation: https://marked.js.org/
- Advanced options: https://marked.js.org/using_advanced
- Extensibility: https://marked.js.org/using_pro
- GitHub repository: https://github.com/markedjs/marked
pandoc
- Getting started: https://pandoc.org/getting-started.html
- Official documentation: https://pandoc.org/MANUAL.html
- Extensibility: https://pandoc.org/extras.html
- GitHub repository: https://github.com/jgm/pandoc
gomarkdown/markdown
- Official documentation: https://pkg.go.dev/github.com/gomarkdown/markdown
- Advanced configuration: https://pkg.go.dev/github.com/gomarkdown/markdown@v0.0.0-20250810172220-2e2c11897d1a/html
- Markdown processing: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
- GitHub repository: https://github.com/gomarkdown/markdown
jekyll
- Official documentation: https://jekyllrb.com/docs/
- Configuration options: https://jekyllrb.com/docs/configuration/options/
- Plugins: https://jekyllrb.com/docs/plugins/
- GitHub repository: https://github.com/jekyll/jekyll
hugo
- Official documentation: https://gohugo.io/documentation/
- All Settings: https://gohugo.io/configuration/all/
- Editor Plugins: https://gohugo.io/tools/editors/
- GitHub repository: https://github.com/gohugoio/hugo
npx skills add boshi-xixixi/traeskill --skill markdown-to-html复制命令到本地终端执行;安装前请先审查源代码和许可证。
本站技能 · Skill 主要索引自公开 GitHub 仓库,用户提交须经审核;相关权利归实际权利人。公开可见不等于授权,下载与使用须遵守原始许可。如涉嫌侵权,请来信或在线反馈,我们将依法核实,并对需移除的内容采取下架、删除或断开链接等措施。
ZIP · 完整技能目录,含资源与许可证
SKILL.md · 仅技能说明原文
安装前,请检查技能脚本与权限。
源代码markdown-to-html【文档与办公】Convert 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 utilize markdown documents, converting them to html. Use when asked to "conv…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.'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 repository. For custom scripts knowledge is not confined to marked.js, but data conversion methods are utilized from tools like pandoc and gomarkdown/markdown for data conversion; jekyll/jekyll and gohugoio/hugo for templating systems.
The conversion script or tool should handle single files, batch conversions, and advanced configurations.
For more see basic-markdown-to-html.md
```markdown
# Level 1
## Level 2
One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`.
- `ul` list item 1
- `ul` list item 2
1. `ol` list item 1
2. `ol` list item 1
| Table Item | Description |
| One | One is the spelling of the number `1`. |
| Two | Two is the spelling of the number `2`. |
```js
var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));
```
```
```html
<h1>Level 1</h1>
<h2>Level 2</h2>
<p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p>
<ul>
<li>`ul` list item 1</li>
<li>`ul` list item 2</li>
</ul>
<ol>
<li>`ol` list item 1</li>
<li>`ol` list item 2</li>
</ol>
<table>
<thead>
<tr>
<th>Table Item</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One is the spelling of the number `1`.</td>
</tr>
<tr>
<td>Two</td>
<td>Two is the spelling of the number `2`.</td>
</tr>
</tbody>
</table>
<pre>
<code>var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));</code>
</pre>
```
For more see code-blocks-to-html.md
```markdown
your code here
```
```html
<pre><code class="language-md">
your code here
</code></pre>
```
```js
console.log("Hello world");
```
```html
<pre><code class="language-js">
console.log("Hello world");
</code></pre>
```
```markdown
```
```
visible backticks
```
```
```
```html
<pre><code>
```
visible backticks
```
</code></pre>
```
For more see collapsed-sections-to-html.md
```markdown
<details>
<summary>More info</summary>
### Header inside
- Lists
- **Formatting**
- Code blocks
```js
console.log("Hello");
```
</details>
```
```html
<details>
<summary>More info</summary>
<h3>Header inside</h3>
<ul>
<li>Lists</li>
<li><strong>Formatting</strong></li>
<li>Code blocks</li>
</ul>
<pre>
<code class="language-js">console.log("Hello");</code>
</pre>
</details>
```
For more see writing-mathematical-expressions-to-html.md
```markdown
This sentence uses `
markdown-to-html · Skills-SI 市场
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
```
```html
<p>This sentence uses <code>lt;/code> delimiters to show math inline:
<math-renderer><math xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt><mn>3</mn><mi>x</mi><mo>−</mo><mn>1</mn></msqrt>
<mo>+</mo><mo>(</mo><mn>1</mn><mo>+</mo><mi>x</mi>
<msup><mo>)</mo><mn>2</mn></msup>
</math>
</math-renderer>
</p>
```
```markdown
**The Cauchy-Schwarz Inequality**\
$\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)$
```
```html
<p><strong>The Cauchy-Schwarz Inequality</strong><br>
<math-renderer>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow><mo>(</mo>
<munderover><mo data-mjx-texclass="OP">∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi>
</munderover>
<msub><mi>a</mi><mi>k</mi></msub>
<msub><mi>b</mi><mi>k</mi></msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>≤</mo>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>a</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>b</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
</math>
</math-renderer></p>
```
Table Conversions
For more see tables-to-html.md
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
```html
<table>
<thead><tr><th>First Header</th><th>Second Header</th></tr></thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
```
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
```html
<table>
<thead>
<tr>
<th align="left">Left-aligned</th>
<th align="center">Center-aligned</th>
<th align="right">Right-aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">git status</td>
<td align="center">git status</td>
<td align="right">git status</td>
</tr>
<tr>
<td align="left">git diff</td>
<td align="center">git diff</td>
<td align="right">git diff</td>
</tr>
</tbody>
</table>
```
Working with markedJS/marked
Prerequisites
- Node.js installed (for CLI or programmatic usage)
- Install marked globally for CLI:
npm install -g marked
- Or install locally:
npm install marked
Quick Conversion Methods
See marked.md Quick Conversion Methods
Step-by-Step Workflows
See marked.md Step-by-Step Workflows
CLI Configuration
Using Config Files
Create ~/.marked.json for persistent options:
{
"gfm": true,
"breaks": true
}
Or use a custom config:
marked -i input.md -o output.html -c config.json
CLI Options Reference
Option Description -i, --input <file>Input Markdown file -o, --output <file>Output HTML file -s, --string <string>Parse string instead of file -c, --config <file>Use custom config file --gfmEnable GitHub Flavored Markdown --breaksConvert newlines to <br> --helpShow all options
Security Warning
⚠️ Marked does NOT sanitize output HTML. For untrusted input, use a sanitizer:
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const unsafeHtml = marked.parse(untrustedMarkdown);
const safeHtml = DOMPurify.sanitize(unsafeHtml);
Recommended sanitizers:
- DOMPurify (recommended)
- sanitize-html
- js-xss
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark 0.31 98% GitHub Flavored Markdown 97%
Troubleshooting
Issue Solution Special characters at file start Strip zero-width chars: content.replace(/^[\u200B\u200C\u200D\uFEFF]/,"") Code blocks not highlighting Add a syntax highlighter like highlight.js Tables not rendering Ensure gfm: true option is set Line breaks ignored Set breaks: true in options XSS vulnerability concerns Use DOMPurify to sanitize output
Working with pandoc
Prerequisites
- Pandoc installed (download from https://pandoc.org/installing.html)
- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)
- Terminal/command prompt access
Quick Conversion Methods
Method 1: CLI Basic Conversion
# Convert markdown to HTML
pandoc input.md -o output.html
# Convert with standalone document (includes header/footer)
pandoc input.md -s -o output.html
# Explicit format specification
pandoc input.md -f markdown -t html -s -o output.html
Method 2: Filter Mode (Interactive)
# Start pandoc as a filter
pandoc
# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)
Hello *pandoc*!
# Output: <p>Hello <em>pandoc</em>!</p>
Method 3: Format Conversion
# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md
# Markdown to LaTeX
pandoc input.md -s -o output.tex
# Markdown to PDF (requires LaTeX)
pandoc input.md -s -o output.pdf
# Markdown to Word
pandoc input.md -s -o output.docx
CLI Configuration
Option Description -f, --from <format>Input format (markdown, html, latex, etc.) -t, --to <format>Output format (html, latex, pdf, docx, etc.) -s, --standaloneProduce standalone document with header/footer -o, --output <file>Output file (inferred from extension) --mathmlConvert TeX math to MathML --metadata title="Title"Set document metadata --tocInclude table of contents --template <file>Use custom template --helpShow all options
Security Warning
⚠️ Pandoc processes input faithfully. When converting untrusted markdown:
- Use
--sandbox mode to disable external file access
- Validate input before processing
- Sanitize HTML output if displayed in browsers
# Run in sandbox mode for untrusted input
pandoc --sandbox input.md -o output.html
Supported Markdown Flavors
Flavor Support Pandoc Markdown 100% (native) CommonMark Full (use -f commonmark) GitHub Flavored Markdown Full (use -f gfm) MultiMarkdown Partial
Troubleshooting
Issue Solution PDF generation fails Install LaTeX (MacTeX, MiKTeX, or texlive) Encoding issues on Windows Run chcp 65001 before using pandoc Missing standalone headers Add -s flag for complete documents Math not rendering Use --mathml or --mathjax option Tables not rendering Ensure proper table syntax with pipes and dashes
Working with gomarkdown/markdown
Prerequisites
- Go 1.18 or higher installed
- Install the library:
go get github.com/gomarkdown/markdown
- For CLI tool:
go install github.com/gomarkdown/mdtohtml@latest
Quick Conversion Methods
Method 1: Simple Conversion (Go)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
)
func main() {
md := []byte("# Hello World\n\nThis is **bold** text.")
html := markdown.ToHTML(md, nil, nil)
fmt.Println(string(html))
}
Method 2: CLI Tool
# Install mdtohtml
go install github.com/gomarkdown/mdtohtml@latest
# Convert file
mdtohtml input.md output.html
# Convert file (output to stdout)
mdtohtml input.md
Method 3: Custom Parser and Renderer
package main
import (
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
)
func mdToHTML(md []byte) []byte {
// Create parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
p := parser.NewWithExtensions(extensions)
doc := p.Parse(md)
// Create HTML renderer with extensions
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
renderer := html.NewRenderer(opts)
return markdown.Render(doc, renderer)
}
CLI Configuration
The mdtohtml CLI tool has minimal options:
mdtohtml input-file [output-file]
For advanced configuration, use the Go library programmatically with parser and renderer options:
Parser Extension Description parser.CommonExtensionsTables, fenced code, autolinks, strikethrough, etc. parser.AutoHeadingIDsGenerate IDs for headings parser.NoEmptyLineBeforeBlockNo blank line needed before blocks parser.MathJaxMathJax support for LaTeX math
HTML Flag Description html.CommonFlagsCommon HTML output flags html.HrefTargetBlankAdd target="_blank" to links html.CompletePageGenerate complete HTML page html.UseXHTMLGenerate XHTML output
Security Warning
⚠️ gomarkdown does NOT sanitize output HTML. For untrusted input, use Bluemonday:
import (
"github.com/microcosm-cc/bluemonday"
"github.com/gomarkdown/markdown"
)
maybeUnsafeHTML := markdown.ToHTML(md, nil, nil)
html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)
Recommended sanitizer: Bluemonday
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark High (with extensions) GitHub Flavored Markdown High (tables, fenced code, strikethrough) MathJax/LaTeX Math Supported via extension Mmark Supported
Troubleshooting
Issue Solution Windows/Mac newlines not parsed Use parser.NormalizeNewlines(input) Tables not rendering Enable parser.Tables extension Code blocks without highlighting Integrate with syntax highlighter like Chroma Math not rendering Enable parser.MathJax extension XSS vulnerabilities Use Bluemonday to sanitize output
Working with jekyll
Prerequisites
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make (for native extensions)
- Install Jekyll and Bundler:
gem install jekyll bundler
Quick Conversion Methods
Method 1: Create New Site
# Create a new Jekyll site
jekyll new myblog
# Change to site directory
cd myblog
# Build and serve locally
bundle exec jekyll serve
# Access at http://localhost:4000
Method 2: Build Static Site
# Build site to _site directory
bundle exec jekyll build
# Build with production environment
JEKYLL_ENV=production bundle exec jekyll build
Method 3: Live Reload Development
# Serve with live reload
bundle exec jekyll serve --livereload
# Serve with drafts
bundle exec jekyll serve --drafts
CLI Configuration
Command Description jekyll new <path>Create new Jekyll site jekyll buildBuild site to _site directory jekyll serveBuild and serve locally jekyll cleanRemove generated files jekyll doctorCheck for configuration issues
Serve Options Description --livereloadReload browser on changes --draftsInclude draft posts --port <port>Set server port (default: 4000) --host <host>Set server host (default: localhost) --baseurl <url>Set base URL
Security Warning
⚠️ Jekyll security considerations:
- Avoid using
safe: false in production
- Use
exclude in _config.yml to prevent sensitive files from being published
- Sanitize user-generated content if accepting external input
- Keep Jekyll and plugins updated
# _config.yml security settings
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Supported Markdown Flavors
Flavor Support Kramdown (default) 100% CommonMark Via plugin (jekyll-commonmark) GitHub Flavored Markdown Via plugin (jekyll-commonmark-ghpages) RedCarpet Via plugin (deprecated)
Configure markdown processor in _config.yml:
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
Troubleshooting
Issue Solution Ruby 3.0+ fails to serve Run bundle add webrick Gem dependency errors Run bundle install Slow builds Use --incremental flag Liquid syntax errors Check for unescaped { in content Plugin not loading Add to _config.yml plugins list
Working with hugo
Prerequisites
- Hugo installed (download from https://gohugo.io/installation/)
- Git (recommended for themes and modules)
- Go (optional, for Hugo Modules)
Quick Conversion Methods
Method 1: Create New Site
# Create a new Hugo site
hugo new site mysite
# Change to site directory
cd mysite
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new content posts/my-first-post.md
# Start development server
hugo server -D
Method 2: Build Static Site
# Build site to public directory
hugo
# Build with minification
hugo --minify
# Build for specific environment
hugo --environment production
Method 3: Development Server
# Start server with drafts
hugo server -D
# Start with live reload and bind to all interfaces
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
# Start with specific port
hugo server --port 8080
CLI Configuration
Command Description hugo new site <name>Create new Hugo site hugo new content <path>Create new content file hugoBuild site to public directory hugo serverStart development server hugo mod initInitialize Hugo Modules
Build Options Description -D, --buildDraftsInclude draft content -E, --buildExpiredInclude expired content -F, --buildFutureInclude future-dated content --minifyMinify output --gcRun garbage collection after build -d, --destination <path>Output directory
Server Options Description --bind <ip>Interface to bind to -p, --port <port>Port number (default: 1313) --liveReloadPort <port>Live reload port --disableLiveReloadDisable live reload --navigateToChangedNavigate to changed content
Security Warning
⚠️ Hugo security considerations:
- Configure security policy in
hugo.toml for external commands
- Use
--enableGitInfo carefully with public repositories
- Validate shortcode parameters for user-generated content
# hugo.toml security settings
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^go#x27;, '^npx#x27;, '^postcss#x27;]
[security.funcs]
getenv = ['^HUGO_', '^CI#x27;]
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
Supported Markdown Flavors
Flavor Support Goldmark (default) 100% (CommonMark compliant) GitHub Flavored Markdown Full (tables, strikethrough, autolinks) CommonMark 100% Blackfriday (legacy) Deprecated, not recommended
Configure markdown in hugo.toml:
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.renderer]
unsafe = false # Set true to allow raw HTML
Troubleshooting
Issue Solution "Page not found" on paths Check baseURL in config Theme not loading Verify theme in themes/ or Hugo Modules Slow builds Use --templateMetrics to identify bottlenecks Raw HTML not rendering Set unsafe = true in goldmark config Images not loading Check static/ folder structure Module errors Run hugo mod tidy
References
Writing and Styling Markdown
- basic-markdown.md
- code-blocks.md
- collapsed-sections.md
- tables.md
- writing-mathematical-expressions.md
- Markdown Guide: https://www.markdownguide.org/basic-syntax/
- Styling Markdown: https://github.com/sindresorhus/github-markdown-css
markedJS/marked
- Official documentation: https://marked.js.org/
- Advanced options: https://marked.js.org/using_advanced
- Extensibility: https://marked.js.org/using_pro
- GitHub repository: https://github.com/markedjs/marked
pandoc
- Getting started: https://pandoc.org/getting-started.html
- Official documentation: https://pandoc.org/MANUAL.html
- Extensibility: https://pandoc.org/extras.html
- GitHub repository: https://github.com/jgm/pandoc
gomarkdown/markdown
- Official documentation: https://pkg.go.dev/github.com/gomarkdown/markdown
- Advanced configuration: https://pkg.go.dev/github.com/gomarkdown/markdown@v0.0.0-20250810172220-2e2c11897d1a/html
- Markdown processing: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
- GitHub repository: https://github.com/gomarkdown/markdown
jekyll
- Official documentation: https://jekyllrb.com/docs/
- Configuration options: https://jekyllrb.com/docs/configuration/options/
- Plugins: https://jekyllrb.com/docs/plugins/
- GitHub repository: https://github.com/jekyll/jekyll
hugo
- Official documentation: https://gohugo.io/documentation/
- All Settings: https://gohugo.io/configuration/all/
- Editor Plugins: https://gohugo.io/tools/editors/
- GitHub repository: https://github.com/gohugoio/hugo
npx skills add boshi-xixixi/traeskill --skill markdown-to-html复制命令到本地终端执行;安装前请先审查源代码和许可证。
本站技能 · Skill 主要索引自公开 GitHub 仓库,用户提交须经审核;相关权利归实际权利人。公开可见不等于授权,下载与使用须遵守原始许可。如涉嫌侵权,请来信或在线反馈,我们将依法核实,并对需移除的内容采取下架、删除或断开链接等措施。
ZIP · 完整技能目录,含资源与许可证
SKILL.md · 仅技能说明原文
安装前,请检查技能脚本与权限。
源代码markdown-to-html【文档与办公】Convert 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 utilize markdown documents, converting them to html. Use when asked to "conv…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.'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 repository. For custom scripts knowledge is not confined to marked.js, but data conversion methods are utilized from tools like pandoc and gomarkdown/markdown for data conversion; jekyll/jekyll and gohugoio/hugo for templating systems.
The conversion script or tool should handle single files, batch conversions, and advanced configurations.
For more see basic-markdown-to-html.md
```markdown
# Level 1
## Level 2
One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`.
- `ul` list item 1
- `ul` list item 2
1. `ol` list item 1
2. `ol` list item 1
| Table Item | Description |
| One | One is the spelling of the number `1`. |
| Two | Two is the spelling of the number `2`. |
```js
var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));
```
```
```html
<h1>Level 1</h1>
<h2>Level 2</h2>
<p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p>
<ul>
<li>`ul` list item 1</li>
<li>`ul` list item 2</li>
</ul>
<ol>
<li>`ol` list item 1</li>
<li>`ol` list item 2</li>
</ol>
<table>
<thead>
<tr>
<th>Table Item</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One is the spelling of the number `1`.</td>
</tr>
<tr>
<td>Two</td>
<td>Two is the spelling of the number `2`.</td>
</tr>
</tbody>
</table>
<pre>
<code>var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));</code>
</pre>
```
For more see code-blocks-to-html.md
```markdown
your code here
```
```html
<pre><code class="language-md">
your code here
</code></pre>
```
```js
console.log("Hello world");
```
```html
<pre><code class="language-js">
console.log("Hello world");
</code></pre>
```
```markdown
```
```
visible backticks
```
```
```
```html
<pre><code>
```
visible backticks
```
</code></pre>
```
For more see collapsed-sections-to-html.md
```markdown
<details>
<summary>More info</summary>
### Header inside
- Lists
- **Formatting**
- Code blocks
```js
console.log("Hello");
```
</details>
```
```html
<details>
<summary>More info</summary>
<h3>Header inside</h3>
<ul>
<li>Lists</li>
<li><strong>Formatting</strong></li>
<li>Code blocks</li>
</ul>
<pre>
<code class="language-js">console.log("Hello");</code>
</pre>
</details>
```
For more see writing-mathematical-expressions-to-html.md
```markdown
This sentence uses `
markdown-to-html · Skills-SI 市场
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
```
```html
<p>This sentence uses <code>lt;/code> delimiters to show math inline:
<math-renderer><math xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt><mn>3</mn><mi>x</mi><mo>−</mo><mn>1</mn></msqrt>
<mo>+</mo><mo>(</mo><mn>1</mn><mo>+</mo><mi>x</mi>
<msup><mo>)</mo><mn>2</mn></msup>
</math>
</math-renderer>
</p>
```
```markdown
**The Cauchy-Schwarz Inequality**\
$\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)$
```
```html
<p><strong>The Cauchy-Schwarz Inequality</strong><br>
<math-renderer>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow><mo>(</mo>
<munderover><mo data-mjx-texclass="OP">∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi>
</munderover>
<msub><mi>a</mi><mi>k</mi></msub>
<msub><mi>b</mi><mi>k</mi></msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>≤</mo>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>a</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>b</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
</math>
</math-renderer></p>
```
Table Conversions
For more see tables-to-html.md
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
```html
<table>
<thead><tr><th>First Header</th><th>Second Header</th></tr></thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
```
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
```html
<table>
<thead>
<tr>
<th align="left">Left-aligned</th>
<th align="center">Center-aligned</th>
<th align="right">Right-aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">git status</td>
<td align="center">git status</td>
<td align="right">git status</td>
</tr>
<tr>
<td align="left">git diff</td>
<td align="center">git diff</td>
<td align="right">git diff</td>
</tr>
</tbody>
</table>
```
Working with markedJS/marked
Prerequisites
- Node.js installed (for CLI or programmatic usage)
- Install marked globally for CLI:
npm install -g marked
- Or install locally:
npm install marked
Quick Conversion Methods
See marked.md Quick Conversion Methods
Step-by-Step Workflows
See marked.md Step-by-Step Workflows
CLI Configuration
Using Config Files
Create ~/.marked.json for persistent options:
{
"gfm": true,
"breaks": true
}
Or use a custom config:
marked -i input.md -o output.html -c config.json
CLI Options Reference
Option Description -i, --input <file>Input Markdown file -o, --output <file>Output HTML file -s, --string <string>Parse string instead of file -c, --config <file>Use custom config file --gfmEnable GitHub Flavored Markdown --breaksConvert newlines to <br> --helpShow all options
Security Warning
⚠️ Marked does NOT sanitize output HTML. For untrusted input, use a sanitizer:
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const unsafeHtml = marked.parse(untrustedMarkdown);
const safeHtml = DOMPurify.sanitize(unsafeHtml);
Recommended sanitizers:
- DOMPurify (recommended)
- sanitize-html
- js-xss
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark 0.31 98% GitHub Flavored Markdown 97%
Troubleshooting
Issue Solution Special characters at file start Strip zero-width chars: content.replace(/^[\u200B\u200C\u200D\uFEFF]/,"") Code blocks not highlighting Add a syntax highlighter like highlight.js Tables not rendering Ensure gfm: true option is set Line breaks ignored Set breaks: true in options XSS vulnerability concerns Use DOMPurify to sanitize output
Working with pandoc
Prerequisites
- Pandoc installed (download from https://pandoc.org/installing.html)
- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)
- Terminal/command prompt access
Quick Conversion Methods
Method 1: CLI Basic Conversion
# Convert markdown to HTML
pandoc input.md -o output.html
# Convert with standalone document (includes header/footer)
pandoc input.md -s -o output.html
# Explicit format specification
pandoc input.md -f markdown -t html -s -o output.html
Method 2: Filter Mode (Interactive)
# Start pandoc as a filter
pandoc
# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)
Hello *pandoc*!
# Output: <p>Hello <em>pandoc</em>!</p>
Method 3: Format Conversion
# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md
# Markdown to LaTeX
pandoc input.md -s -o output.tex
# Markdown to PDF (requires LaTeX)
pandoc input.md -s -o output.pdf
# Markdown to Word
pandoc input.md -s -o output.docx
CLI Configuration
Option Description -f, --from <format>Input format (markdown, html, latex, etc.) -t, --to <format>Output format (html, latex, pdf, docx, etc.) -s, --standaloneProduce standalone document with header/footer -o, --output <file>Output file (inferred from extension) --mathmlConvert TeX math to MathML --metadata title="Title"Set document metadata --tocInclude table of contents --template <file>Use custom template --helpShow all options
Security Warning
⚠️ Pandoc processes input faithfully. When converting untrusted markdown:
- Use
--sandbox mode to disable external file access
- Validate input before processing
- Sanitize HTML output if displayed in browsers
# Run in sandbox mode for untrusted input
pandoc --sandbox input.md -o output.html
Supported Markdown Flavors
Flavor Support Pandoc Markdown 100% (native) CommonMark Full (use -f commonmark) GitHub Flavored Markdown Full (use -f gfm) MultiMarkdown Partial
Troubleshooting
Issue Solution PDF generation fails Install LaTeX (MacTeX, MiKTeX, or texlive) Encoding issues on Windows Run chcp 65001 before using pandoc Missing standalone headers Add -s flag for complete documents Math not rendering Use --mathml or --mathjax option Tables not rendering Ensure proper table syntax with pipes and dashes
Working with gomarkdown/markdown
Prerequisites
- Go 1.18 or higher installed
- Install the library:
go get github.com/gomarkdown/markdown
- For CLI tool:
go install github.com/gomarkdown/mdtohtml@latest
Quick Conversion Methods
Method 1: Simple Conversion (Go)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
)
func main() {
md := []byte("# Hello World\n\nThis is **bold** text.")
html := markdown.ToHTML(md, nil, nil)
fmt.Println(string(html))
}
Method 2: CLI Tool
# Install mdtohtml
go install github.com/gomarkdown/mdtohtml@latest
# Convert file
mdtohtml input.md output.html
# Convert file (output to stdout)
mdtohtml input.md
Method 3: Custom Parser and Renderer
package main
import (
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
)
func mdToHTML(md []byte) []byte {
// Create parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
p := parser.NewWithExtensions(extensions)
doc := p.Parse(md)
// Create HTML renderer with extensions
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
renderer := html.NewRenderer(opts)
return markdown.Render(doc, renderer)
}
CLI Configuration
The mdtohtml CLI tool has minimal options:
mdtohtml input-file [output-file]
For advanced configuration, use the Go library programmatically with parser and renderer options:
Parser Extension Description parser.CommonExtensionsTables, fenced code, autolinks, strikethrough, etc. parser.AutoHeadingIDsGenerate IDs for headings parser.NoEmptyLineBeforeBlockNo blank line needed before blocks parser.MathJaxMathJax support for LaTeX math
HTML Flag Description html.CommonFlagsCommon HTML output flags html.HrefTargetBlankAdd target="_blank" to links html.CompletePageGenerate complete HTML page html.UseXHTMLGenerate XHTML output
Security Warning
⚠️ gomarkdown does NOT sanitize output HTML. For untrusted input, use Bluemonday:
import (
"github.com/microcosm-cc/bluemonday"
"github.com/gomarkdown/markdown"
)
maybeUnsafeHTML := markdown.ToHTML(md, nil, nil)
html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)
Recommended sanitizer: Bluemonday
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark High (with extensions) GitHub Flavored Markdown High (tables, fenced code, strikethrough) MathJax/LaTeX Math Supported via extension Mmark Supported
Troubleshooting
Issue Solution Windows/Mac newlines not parsed Use parser.NormalizeNewlines(input) Tables not rendering Enable parser.Tables extension Code blocks without highlighting Integrate with syntax highlighter like Chroma Math not rendering Enable parser.MathJax extension XSS vulnerabilities Use Bluemonday to sanitize output
Working with jekyll
Prerequisites
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make (for native extensions)
- Install Jekyll and Bundler:
gem install jekyll bundler
Quick Conversion Methods
Method 1: Create New Site
# Create a new Jekyll site
jekyll new myblog
# Change to site directory
cd myblog
# Build and serve locally
bundle exec jekyll serve
# Access at http://localhost:4000
Method 2: Build Static Site
# Build site to _site directory
bundle exec jekyll build
# Build with production environment
JEKYLL_ENV=production bundle exec jekyll build
Method 3: Live Reload Development
# Serve with live reload
bundle exec jekyll serve --livereload
# Serve with drafts
bundle exec jekyll serve --drafts
CLI Configuration
Command Description jekyll new <path>Create new Jekyll site jekyll buildBuild site to _site directory jekyll serveBuild and serve locally jekyll cleanRemove generated files jekyll doctorCheck for configuration issues
Serve Options Description --livereloadReload browser on changes --draftsInclude draft posts --port <port>Set server port (default: 4000) --host <host>Set server host (default: localhost) --baseurl <url>Set base URL
Security Warning
⚠️ Jekyll security considerations:
- Avoid using
safe: false in production
- Use
exclude in _config.yml to prevent sensitive files from being published
- Sanitize user-generated content if accepting external input
- Keep Jekyll and plugins updated
# _config.yml security settings
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Supported Markdown Flavors
Flavor Support Kramdown (default) 100% CommonMark Via plugin (jekyll-commonmark) GitHub Flavored Markdown Via plugin (jekyll-commonmark-ghpages) RedCarpet Via plugin (deprecated)
Configure markdown processor in _config.yml:
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
Troubleshooting
Issue Solution Ruby 3.0+ fails to serve Run bundle add webrick Gem dependency errors Run bundle install Slow builds Use --incremental flag Liquid syntax errors Check for unescaped { in content Plugin not loading Add to _config.yml plugins list
Working with hugo
Prerequisites
- Hugo installed (download from https://gohugo.io/installation/)
- Git (recommended for themes and modules)
- Go (optional, for Hugo Modules)
Quick Conversion Methods
Method 1: Create New Site
# Create a new Hugo site
hugo new site mysite
# Change to site directory
cd mysite
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new content posts/my-first-post.md
# Start development server
hugo server -D
Method 2: Build Static Site
# Build site to public directory
hugo
# Build with minification
hugo --minify
# Build for specific environment
hugo --environment production
Method 3: Development Server
# Start server with drafts
hugo server -D
# Start with live reload and bind to all interfaces
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
# Start with specific port
hugo server --port 8080
CLI Configuration
Command Description hugo new site <name>Create new Hugo site hugo new content <path>Create new content file hugoBuild site to public directory hugo serverStart development server hugo mod initInitialize Hugo Modules
Build Options Description -D, --buildDraftsInclude draft content -E, --buildExpiredInclude expired content -F, --buildFutureInclude future-dated content --minifyMinify output --gcRun garbage collection after build -d, --destination <path>Output directory
Server Options Description --bind <ip>Interface to bind to -p, --port <port>Port number (default: 1313) --liveReloadPort <port>Live reload port --disableLiveReloadDisable live reload --navigateToChangedNavigate to changed content
Security Warning
⚠️ Hugo security considerations:
- Configure security policy in
hugo.toml for external commands
- Use
--enableGitInfo carefully with public repositories
- Validate shortcode parameters for user-generated content
# hugo.toml security settings
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^go#x27;, '^npx#x27;, '^postcss#x27;]
[security.funcs]
getenv = ['^HUGO_', '^CI#x27;]
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
Supported Markdown Flavors
Flavor Support Goldmark (default) 100% (CommonMark compliant) GitHub Flavored Markdown Full (tables, strikethrough, autolinks) CommonMark 100% Blackfriday (legacy) Deprecated, not recommended
Configure markdown in hugo.toml:
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.renderer]
unsafe = false # Set true to allow raw HTML
Troubleshooting
Issue Solution "Page not found" on paths Check baseURL in config Theme not loading Verify theme in themes/ or Hugo Modules Slow builds Use --templateMetrics to identify bottlenecks Raw HTML not rendering Set unsafe = true in goldmark config Images not loading Check static/ folder structure Module errors Run hugo mod tidy
References
Writing and Styling Markdown
- basic-markdown.md
- code-blocks.md
- collapsed-sections.md
- tables.md
- writing-mathematical-expressions.md
- Markdown Guide: https://www.markdownguide.org/basic-syntax/
- Styling Markdown: https://github.com/sindresorhus/github-markdown-css
markedJS/marked
- Official documentation: https://marked.js.org/
- Advanced options: https://marked.js.org/using_advanced
- Extensibility: https://marked.js.org/using_pro
- GitHub repository: https://github.com/markedjs/marked
pandoc
- Getting started: https://pandoc.org/getting-started.html
- Official documentation: https://pandoc.org/MANUAL.html
- Extensibility: https://pandoc.org/extras.html
- GitHub repository: https://github.com/jgm/pandoc
gomarkdown/markdown
- Official documentation: https://pkg.go.dev/github.com/gomarkdown/markdown
- Advanced configuration: https://pkg.go.dev/github.com/gomarkdown/markdown@v0.0.0-20250810172220-2e2c11897d1a/html
- Markdown processing: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
- GitHub repository: https://github.com/gomarkdown/markdown
jekyll
- Official documentation: https://jekyllrb.com/docs/
- Configuration options: https://jekyllrb.com/docs/configuration/options/
- Plugins: https://jekyllrb.com/docs/plugins/
- GitHub repository: https://github.com/jekyll/jekyll
hugo
- Official documentation: https://gohugo.io/documentation/
- All Settings: https://gohugo.io/configuration/all/
- Editor Plugins: https://gohugo.io/tools/editors/
- GitHub repository: https://github.com/gohugoio/hugo
npx skills add boshi-xixixi/traeskill --skill markdown-to-html复制命令到本地终端执行;安装前请先审查源代码和许可证。
本站技能 · Skill 主要索引自公开 GitHub 仓库,用户提交须经审核;相关权利归实际权利人。公开可见不等于授权,下载与使用须遵守原始许可。如涉嫌侵权,请来信或在线反馈,我们将依法核实,并对需移除的内容采取下架、删除或断开链接等措施。
ZIP · 完整技能目录,含资源与许可证
SKILL.md · 仅技能说明原文
安装前,请检查技能脚本与权限。
源代码markdown-to-html【文档与办公】Convert 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 utilize markdown documents, converting them to html. Use when asked to "conv…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
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 utilize markdown documents, converting them to html. Use when asked to "convert markdown to html", "transform md to html", "render markdown", "generate html from markdown", or when working with .md files and/or web a templating system that converts markdown to HTML output. Supports CLI and Node.js workflows with GFM, CommonMark, and standard Markdown flavors.'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 repository. For custom scripts knowledge is not confined to marked.js, but data conversion methods are utilized from tools like pandoc and gomarkdown/markdown for data conversion; jekyll/jekyll and gohugoio/hugo for templating systems.
The conversion script or tool should handle single files, batch conversions, and advanced configurations.
For more see basic-markdown-to-html.md
```markdown
# Level 1
## Level 2
One sentence with a [link](https://example.com), and a HTML snippet like `<p>paragraph tag</p>`.
- `ul` list item 1
- `ul` list item 2
1. `ol` list item 1
2. `ol` list item 1
| Table Item | Description |
| One | One is the spelling of the number `1`. |
| Two | Two is the spelling of the number `2`. |
```js
var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));
```
```
```html
<h1>Level 1</h1>
<h2>Level 2</h2>
<p>One sentence with a <a href="https://example.com">link</a>, and a HTML snippet like <code><p>paragraph tag</p></code>.</p>
<ul>
<li>`ul` list item 1</li>
<li>`ul` list item 2</li>
</ul>
<ol>
<li>`ol` list item 1</li>
<li>`ol` list item 2</li>
</ol>
<table>
<thead>
<tr>
<th>Table Item</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One is the spelling of the number `1`.</td>
</tr>
<tr>
<td>Two</td>
<td>Two is the spelling of the number `2`.</td>
</tr>
</tbody>
</table>
<pre>
<code>var one = 1;
var two = 2;
function simpleMath(x, y) {
return x + y;
}
console.log(simpleMath(one, two));</code>
</pre>
```
For more see code-blocks-to-html.md
```markdown
your code here
```
```html
<pre><code class="language-md">
your code here
</code></pre>
```
```js
console.log("Hello world");
```
```html
<pre><code class="language-js">
console.log("Hello world");
</code></pre>
```
```markdown
```
```
visible backticks
```
```
```
```html
<pre><code>
```
visible backticks
```
</code></pre>
```
For more see collapsed-sections-to-html.md
```markdown
<details>
<summary>More info</summary>
### Header inside
- Lists
- **Formatting**
- Code blocks
```js
console.log("Hello");
```
</details>
```
```html
<details>
<summary>More info</summary>
<h3>Header inside</h3>
<ul>
<li>Lists</li>
<li><strong>Formatting</strong></li>
<li>Code blocks</li>
</ul>
<pre>
<code class="language-js">console.log("Hello");</code>
</pre>
</details>
```
For more see writing-mathematical-expressions-to-html.md
```markdown
This sentence uses `
markdown-to-html · Skills-SI 市场
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
```
```html
<p>This sentence uses <code>lt;/code> delimiters to show math inline:
<math-renderer><math xmlns="http://www.w3.org/1998/Math/MathML">
<msqrt><mn>3</mn><mi>x</mi><mo>−</mo><mn>1</mn></msqrt>
<mo>+</mo><mo>(</mo><mn>1</mn><mo>+</mo><mi>x</mi>
<msup><mo>)</mo><mn>2</mn></msup>
</math>
</math-renderer>
</p>
```
```markdown
**The Cauchy-Schwarz Inequality**\
$\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)$
```
```html
<p><strong>The Cauchy-Schwarz Inequality</strong><br>
<math-renderer>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow><mo>(</mo>
<munderover><mo data-mjx-texclass="OP">∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi>
</munderover>
<msub><mi>a</mi><mi>k</mi></msub>
<msub><mi>b</mi><mi>k</mi></msub>
<mo>)</mo>
</mrow>
<mn>2</mn>
</msup>
<mo>≤</mo>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>a</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
<mrow><mo>(</mo>
<munderover><mo>∑</mo>
<mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow>
<mi>n</mi>
</munderover>
<msubsup><mi>b</mi><mi>k</mi><mn>2</mn></msubsup>
<mo>)</mo>
</mrow>
</math>
</math-renderer></p>
```
Table Conversions
For more see tables-to-html.md
```markdown
| First Header | Second Header |
| ------------- | ------------- |
| Content Cell | Content Cell |
| Content Cell | Content Cell |
```
```html
<table>
<thead><tr><th>First Header</th><th>Second Header</th></tr></thead>
<tbody>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
<tr><td>Content Cell</td><td>Content Cell</td></tr>
</tbody>
</table>
```
```markdown
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| git status | git status | git status |
| git diff | git diff | git diff |
```
```html
<table>
<thead>
<tr>
<th align="left">Left-aligned</th>
<th align="center">Center-aligned</th>
<th align="right">Right-aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left">git status</td>
<td align="center">git status</td>
<td align="right">git status</td>
</tr>
<tr>
<td align="left">git diff</td>
<td align="center">git diff</td>
<td align="right">git diff</td>
</tr>
</tbody>
</table>
```
Working with markedJS/marked
Prerequisites
- Node.js installed (for CLI or programmatic usage)
- Install marked globally for CLI:
npm install -g marked
- Or install locally:
npm install marked
Quick Conversion Methods
See marked.md Quick Conversion Methods
Step-by-Step Workflows
See marked.md Step-by-Step Workflows
CLI Configuration
Using Config Files
Create ~/.marked.json for persistent options:
{
"gfm": true,
"breaks": true
}
Or use a custom config:
marked -i input.md -o output.html -c config.json
CLI Options Reference
Option Description -i, --input <file>Input Markdown file -o, --output <file>Output HTML file -s, --string <string>Parse string instead of file -c, --config <file>Use custom config file --gfmEnable GitHub Flavored Markdown --breaksConvert newlines to <br> --helpShow all options
Security Warning
⚠️ Marked does NOT sanitize output HTML. For untrusted input, use a sanitizer:
import { marked } from 'marked';
import DOMPurify from 'dompurify';
const unsafeHtml = marked.parse(untrustedMarkdown);
const safeHtml = DOMPurify.sanitize(unsafeHtml);
Recommended sanitizers:
- DOMPurify (recommended)
- sanitize-html
- js-xss
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark 0.31 98% GitHub Flavored Markdown 97%
Troubleshooting
Issue Solution Special characters at file start Strip zero-width chars: content.replace(/^[\u200B\u200C\u200D\uFEFF]/,"") Code blocks not highlighting Add a syntax highlighter like highlight.js Tables not rendering Ensure gfm: true option is set Line breaks ignored Set breaks: true in options XSS vulnerability concerns Use DOMPurify to sanitize output
Working with pandoc
Prerequisites
- Pandoc installed (download from https://pandoc.org/installing.html)
- For PDF output: LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux)
- Terminal/command prompt access
Quick Conversion Methods
Method 1: CLI Basic Conversion
# Convert markdown to HTML
pandoc input.md -o output.html
# Convert with standalone document (includes header/footer)
pandoc input.md -s -o output.html
# Explicit format specification
pandoc input.md -f markdown -t html -s -o output.html
Method 2: Filter Mode (Interactive)
# Start pandoc as a filter
pandoc
# Type markdown, then Ctrl-D (Linux/macOS) or Ctrl-Z+Enter (Windows)
Hello *pandoc*!
# Output: <p>Hello <em>pandoc</em>!</p>
Method 3: Format Conversion
# HTML to Markdown
pandoc -f html -t markdown input.html -o output.md
# Markdown to LaTeX
pandoc input.md -s -o output.tex
# Markdown to PDF (requires LaTeX)
pandoc input.md -s -o output.pdf
# Markdown to Word
pandoc input.md -s -o output.docx
CLI Configuration
Option Description -f, --from <format>Input format (markdown, html, latex, etc.) -t, --to <format>Output format (html, latex, pdf, docx, etc.) -s, --standaloneProduce standalone document with header/footer -o, --output <file>Output file (inferred from extension) --mathmlConvert TeX math to MathML --metadata title="Title"Set document metadata --tocInclude table of contents --template <file>Use custom template --helpShow all options
Security Warning
⚠️ Pandoc processes input faithfully. When converting untrusted markdown:
- Use
--sandbox mode to disable external file access
- Validate input before processing
- Sanitize HTML output if displayed in browsers
# Run in sandbox mode for untrusted input
pandoc --sandbox input.md -o output.html
Supported Markdown Flavors
Flavor Support Pandoc Markdown 100% (native) CommonMark Full (use -f commonmark) GitHub Flavored Markdown Full (use -f gfm) MultiMarkdown Partial
Troubleshooting
Issue Solution PDF generation fails Install LaTeX (MacTeX, MiKTeX, or texlive) Encoding issues on Windows Run chcp 65001 before using pandoc Missing standalone headers Add -s flag for complete documents Math not rendering Use --mathml or --mathjax option Tables not rendering Ensure proper table syntax with pipes and dashes
Working with gomarkdown/markdown
Prerequisites
- Go 1.18 or higher installed
- Install the library:
go get github.com/gomarkdown/markdown
- For CLI tool:
go install github.com/gomarkdown/mdtohtml@latest
Quick Conversion Methods
Method 1: Simple Conversion (Go)
package main
import (
"fmt"
"github.com/gomarkdown/markdown"
)
func main() {
md := []byte("# Hello World\n\nThis is **bold** text.")
html := markdown.ToHTML(md, nil, nil)
fmt.Println(string(html))
}
Method 2: CLI Tool
# Install mdtohtml
go install github.com/gomarkdown/mdtohtml@latest
# Convert file
mdtohtml input.md output.html
# Convert file (output to stdout)
mdtohtml input.md
Method 3: Custom Parser and Renderer
package main
import (
"github.com/gomarkdown/markdown"
"github.com/gomarkdown/markdown/html"
"github.com/gomarkdown/markdown/parser"
)
func mdToHTML(md []byte) []byte {
// Create parser with extensions
extensions := parser.CommonExtensions | parser.AutoHeadingIDs | parser.NoEmptyLineBeforeBlock
p := parser.NewWithExtensions(extensions)
doc := p.Parse(md)
// Create HTML renderer with extensions
htmlFlags := html.CommonFlags | html.HrefTargetBlank
opts := html.RendererOptions{Flags: htmlFlags}
renderer := html.NewRenderer(opts)
return markdown.Render(doc, renderer)
}
CLI Configuration
The mdtohtml CLI tool has minimal options:
mdtohtml input-file [output-file]
For advanced configuration, use the Go library programmatically with parser and renderer options:
Parser Extension Description parser.CommonExtensionsTables, fenced code, autolinks, strikethrough, etc. parser.AutoHeadingIDsGenerate IDs for headings parser.NoEmptyLineBeforeBlockNo blank line needed before blocks parser.MathJaxMathJax support for LaTeX math
HTML Flag Description html.CommonFlagsCommon HTML output flags html.HrefTargetBlankAdd target="_blank" to links html.CompletePageGenerate complete HTML page html.UseXHTMLGenerate XHTML output
Security Warning
⚠️ gomarkdown does NOT sanitize output HTML. For untrusted input, use Bluemonday:
import (
"github.com/microcosm-cc/bluemonday"
"github.com/gomarkdown/markdown"
)
maybeUnsafeHTML := markdown.ToHTML(md, nil, nil)
html := bluemonday.UGCPolicy().SanitizeBytes(maybeUnsafeHTML)
Recommended sanitizer: Bluemonday
Supported Markdown Flavors
Flavor Support Original Markdown 100% CommonMark High (with extensions) GitHub Flavored Markdown High (tables, fenced code, strikethrough) MathJax/LaTeX Math Supported via extension Mmark Supported
Troubleshooting
Issue Solution Windows/Mac newlines not parsed Use parser.NormalizeNewlines(input) Tables not rendering Enable parser.Tables extension Code blocks without highlighting Integrate with syntax highlighter like Chroma Math not rendering Enable parser.MathJax extension XSS vulnerabilities Use Bluemonday to sanitize output
Working with jekyll
Prerequisites
- Ruby version 2.7.0 or higher
- RubyGems
- GCC and Make (for native extensions)
- Install Jekyll and Bundler:
gem install jekyll bundler
Quick Conversion Methods
Method 1: Create New Site
# Create a new Jekyll site
jekyll new myblog
# Change to site directory
cd myblog
# Build and serve locally
bundle exec jekyll serve
# Access at http://localhost:4000
Method 2: Build Static Site
# Build site to _site directory
bundle exec jekyll build
# Build with production environment
JEKYLL_ENV=production bundle exec jekyll build
Method 3: Live Reload Development
# Serve with live reload
bundle exec jekyll serve --livereload
# Serve with drafts
bundle exec jekyll serve --drafts
CLI Configuration
Command Description jekyll new <path>Create new Jekyll site jekyll buildBuild site to _site directory jekyll serveBuild and serve locally jekyll cleanRemove generated files jekyll doctorCheck for configuration issues
Serve Options Description --livereloadReload browser on changes --draftsInclude draft posts --port <port>Set server port (default: 4000) --host <host>Set server host (default: localhost) --baseurl <url>Set base URL
Security Warning
⚠️ Jekyll security considerations:
- Avoid using
safe: false in production
- Use
exclude in _config.yml to prevent sensitive files from being published
- Sanitize user-generated content if accepting external input
- Keep Jekyll and plugins updated
# _config.yml security settings
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
Supported Markdown Flavors
Flavor Support Kramdown (default) 100% CommonMark Via plugin (jekyll-commonmark) GitHub Flavored Markdown Via plugin (jekyll-commonmark-ghpages) RedCarpet Via plugin (deprecated)
Configure markdown processor in _config.yml:
markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge
Troubleshooting
Issue Solution Ruby 3.0+ fails to serve Run bundle add webrick Gem dependency errors Run bundle install Slow builds Use --incremental flag Liquid syntax errors Check for unescaped { in content Plugin not loading Add to _config.yml plugins list
Working with hugo
Prerequisites
- Hugo installed (download from https://gohugo.io/installation/)
- Git (recommended for themes and modules)
- Go (optional, for Hugo Modules)
Quick Conversion Methods
Method 1: Create New Site
# Create a new Hugo site
hugo new site mysite
# Change to site directory
cd mysite
# Add a theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml
# Create content
hugo new content posts/my-first-post.md
# Start development server
hugo server -D
Method 2: Build Static Site
# Build site to public directory
hugo
# Build with minification
hugo --minify
# Build for specific environment
hugo --environment production
Method 3: Development Server
# Start server with drafts
hugo server -D
# Start with live reload and bind to all interfaces
hugo server --bind 0.0.0.0 --baseURL http://localhost:1313/
# Start with specific port
hugo server --port 8080
CLI Configuration
Command Description hugo new site <name>Create new Hugo site hugo new content <path>Create new content file hugoBuild site to public directory hugo serverStart development server hugo mod initInitialize Hugo Modules
Build Options Description -D, --buildDraftsInclude draft content -E, --buildExpiredInclude expired content -F, --buildFutureInclude future-dated content --minifyMinify output --gcRun garbage collection after build -d, --destination <path>Output directory
Server Options Description --bind <ip>Interface to bind to -p, --port <port>Port number (default: 1313) --liveReloadPort <port>Live reload port --disableLiveReloadDisable live reload --navigateToChangedNavigate to changed content
Security Warning
⚠️ Hugo security considerations:
- Configure security policy in
hugo.toml for external commands
- Use
--enableGitInfo carefully with public repositories
- Validate shortcode parameters for user-generated content
# hugo.toml security settings
[security]
enableInlineShortcodes = false
[security.exec]
allow = ['^go#x27;, '^npx#x27;, '^postcss#x27;]
[security.funcs]
getenv = ['^HUGO_', '^CI#x27;]
[security.http]
methods = ['(?i)GET|POST']
urls = ['.*']
Supported Markdown Flavors
Flavor Support Goldmark (default) 100% (CommonMark compliant) GitHub Flavored Markdown Full (tables, strikethrough, autolinks) CommonMark 100% Blackfriday (legacy) Deprecated, not recommended
Configure markdown in hugo.toml:
[markup]
[markup.goldmark]
[markup.goldmark.extensions]
definitionList = true
footnote = true
linkify = true
strikethrough = true
table = true
taskList = true
[markup.goldmark.renderer]
unsafe = false # Set true to allow raw HTML
Troubleshooting
Issue Solution "Page not found" on paths Check baseURL in config Theme not loading Verify theme in themes/ or Hugo Modules Slow builds Use --templateMetrics to identify bottlenecks Raw HTML not rendering Set unsafe = true in goldmark config Images not loading Check static/ folder structure Module errors Run hugo mod tidy
References
Writing and Styling Markdown
- basic-markdown.md
- code-blocks.md
- collapsed-sections.md
- tables.md
- writing-mathematical-expressions.md
- Markdown Guide: https://www.markdownguide.org/basic-syntax/
- Styling Markdown: https://github.com/sindresorhus/github-markdown-css
markedJS/marked
- Official documentation: https://marked.js.org/
- Advanced options: https://marked.js.org/using_advanced
- Extensibility: https://marked.js.org/using_pro
- GitHub repository: https://github.com/markedjs/marked
pandoc
- Getting started: https://pandoc.org/getting-started.html
- Official documentation: https://pandoc.org/MANUAL.html
- Extensibility: https://pandoc.org/extras.html
- GitHub repository: https://github.com/jgm/pandoc
gomarkdown/markdown
- Official documentation: https://pkg.go.dev/github.com/gomarkdown/markdown
- Advanced configuration: https://pkg.go.dev/github.com/gomarkdown/markdown@v0.0.0-20250810172220-2e2c11897d1a/html
- Markdown processing: https://blog.kowalczyk.info/article/cxn3/advanced-markdown-processing-in-go.html
- GitHub repository: https://github.com/gomarkdown/markdown
jekyll
- Official documentation: https://jekyllrb.com/docs/
- Configuration options: https://jekyllrb.com/docs/configuration/options/
- Plugins: https://jekyllrb.com/docs/plugins/
- GitHub repository: https://github.com/jekyll/jekyll
hugo
- Official documentation: https://gohugo.io/documentation/
- All Settings: https://gohugo.io/configuration/all/
- Editor Plugins: https://gohugo.io/tools/editors/
- GitHub repository: https://github.com/gohugoio/hugo
npx skills add boshi-xixixi/traeskill --skill markdown-to-html复制命令到本地终端执行;安装前请先审查源代码和许可证。
本站技能 · Skill 主要索引自公开 GitHub 仓库,用户提交须经审核;相关权利归实际权利人。公开可见不等于授权,下载与使用须遵守原始许可。如涉嫌侵权,请来信或在线反馈,我们将依法核实,并对需移除的内容采取下架、删除或断开链接等措施。
ZIP · 完整技能目录,含资源与许可证
SKILL.md · 仅技能说明原文
安装前,请检查技能脚本与权限。
源代码