Index of every page on this site: llms.txt
All skills
github avatar

/markdown-to-html

@f10fdb8 official
by githubgithub/awesome-copilot42k stars
5,426
Run it yourself

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 "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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/markdown-to-html

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceshugo.md

≈1.8k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Hugo Reference

Hugo is the world's fastest static site generator. It builds sites in milliseconds and supports advanced content management features.

Installation

Windows

# Using Chocolatey
choco install hugo-extended

# Using Scoop
scoop install hugo-extended

# Using Winget
winget install Hugo.Hugo.Extended

macOS

# Using Homebrew
brew install hugo

Linux

# Debian/Ubuntu (snap)
snap install hugo --channel=extended

# Using package manager (may not be latest)
sudo apt-get install hugo

# Or download from https://gohugo.io/installation/

Quick Start

Create New Site

# Create site
hugo new site mysite
cd mysite

# Initialize git and add theme
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
echo "theme = 'ananke'" >> hugo.toml

# Create first post
hugo new content posts/my-first-post.md

# Start development server
hugo server -D

Directory Structure

mysite/
├── archetypes/      # Content templates
│   └── default.md
├── assets/          # Assets to process (SCSS, JS)
├── content/         # Markdown content
│   └── posts/
├── data/            # Data files (YAML, JSON, TOML)
├── i18n/            # Internationalization
├── layouts/         # Templates
│   ├── _default/
│   ├── partials/
│   └── shortcodes/
├── static/          # Static files (copied as-is)
├── themes/          # Themes
└── hugo.toml        # Configuration

CLI Commands

Command Description
hugo new site <name> Create new site
hugo new content <path> Create content file
hugo Build to public/
hugo server Start dev server
hugo mod init Initialize Hugo Modules
hugo mod tidy Clean up modules

Build Options

# Basic build
hugo

# Build with minification
hugo --minify

# Build with drafts
hugo -D

# Build for specific environment
hugo --environment production

# Build to custom directory
hugo -d ./dist

# Verbose output
hugo -v

Server Options

# Start with drafts
hugo server -D

# Bind to all interfaces
hugo server --bind 0.0.0.0

# Custom port
hugo server --port 8080

# Disable live reload
hugo server --disableLiveReload

# Navigate to changed content
hugo server --navigateToChanged

Configuration (hugo.toml)

# Basic settings
baseURL = 'https://example.com/'
languageCode = 'en-us'
title = 'My Hugo Site'
theme = 'ananke'

# Build settings
[build]
  writeStats = true

# Markdown configuration
[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      definitionList = true
      footnote = true
      linkify = true
      strikethrough = true
      table = true
      taskList = true
    [markup.goldmark.parser]
      autoHeadingID = true
      autoHeadingIDType = 'github'
    [markup.goldmark.renderer]
      unsafe = false
  [markup.highlight]
    style = 'monokai'
    lineNos = true

# Taxonomies
[taxonomies]
  category = 'categories'
  tag = 'tags'
  author = 'authors'

# Menus
[menus]
  [[menus.main]]
    name = 'Home'
    pageRef = '/'
    weight = 10
  [[menus.main]]
    name = 'Posts'
    pageRef = '/posts'
    weight = 20

# Parameters
[params]
  description = 'My awesome site'
  author = 'John Doe'

Front Matter

Hugo supports TOML, YAML, and JSON front matter:

TOML (default)

+++
title = 'My First Post'
date = 2025-01-28T12:00:00-05:00
draft = false
tags = ['hugo', 'tutorial']
categories = ['blog']
author = 'John Doe'
+++

Content here...

YAML

---
title: "My First Post"
date: 2025-01-28T12:00:00-05:00
draft: false
tags: ["hugo", "tutorial"]
---

Content here...

Templates

Base Template (_default/baseof.html)

<!DOCTYPE html>
<html>
<head>
  <title>{{ .Title }} | {{ .Site.Title }}</title>
  {{ partial "head.html" . }}
</head>
<body>
  {{ partial "header.html" . }}
  <main>
    {{ block "main" . }}{{ end }}
  </main>
  {{ partial "footer.html" . }}
</body>
</html>

Single Page (_default/single.html)

{{ define "main" }}
<article>
  <h1>{{ .Title }}</h1>
  <time>{{ .Date.Format "January 2, 2006" }}</time>
  {{ .Content }}
</article>
{{ end }}

List Page (_default/list.html)

{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ range .Pages }}
  <article>
    <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
    <p>{{ .Summary }}</p>
  </article>
{{ end }}
{{ end }}

Shortcodes

Built-in Shortcodes

{{< figure src="/images/photo.jpg" title="My Photo" >}}

{{< youtube dQw4w9WgXcQ >}}

{{< gist user 12345 >}}

{{< highlight go >}}
fmt.Println("Hello")
{{< /highlight >}}

Custom Shortcode (layouts/shortcodes/alert.html)

<div class="alert alert-{{ .Get "type" | default "info" }}">
  {{ .Inner | markdownify }}
</div>

Usage:

{{< alert type="warning" >}}
**Warning:** This is important!
{{< /alert >}}

Content Organization

Page Bundles

content/
├── posts/
│   └── my-post/           # Page bundle
│       ├── index.md       # Content
│       └── image.jpg      # Resources
└── _index.md              # Section page

Accessing Resources

{{ $image := .Resources.GetMatch "image.jpg" }}
{{ with $image }}
  <img src="{{ .RelPermalink }}" alt="...">
{{ end }}

Hugo Pipes (Asset Processing)

SCSS Compilation

{{ $styles := resources.Get "scss/main.scss" | toCSS | minify }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}">

JavaScript Bundling

{{ $js := resources.Get "js/main.js" | js.Build | minify }}
<script src="{{ $js.RelPermalink }}"></script>

Taxonomies

Configure

[taxonomies]
  tag = 'tags'
  category = 'categories'

Use in Front Matter

+++
tags = ['go', 'hugo']
categories = ['tutorials']
+++

List Taxonomy Terms

{{ range .Site.Taxonomies.tags }}
  <a href="{{ .Page.Permalink }}">{{ .Page.Title }} ({{ .Count }})</a>
{{ end }}

Multilingual Sites

defaultContentLanguage = 'en'

[languages]
  [languages.en]
    title = 'My Site'
    weight = 1
  [languages.es]
    title = 'Mi Sitio'
    weight = 2

Troubleshooting

Issue Solution
Page not found Check baseURL configuration
Theme not loading Verify theme path in config
Raw HTML not showing Set unsafe = true in goldmark config
Slow builds Use --templateMetrics to debug
Module errors Run hugo mod tidy
CSS not updating Clear browser cache or use fingerprinting

Resources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning12d5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a comprehensive guide for converting Markdown to HTML using industry-standard tools and libraries. It includes appropriate security warnings and detailed remediation steps for handling untrusted input.

  • Socket12d

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer9mo

    13/16 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at f10fdb8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 7 months ago
  • markdown
  • html
  • conversion
  • marked
  • pandoc
  • static-site-generator
  • jekyll
  • hugo
  • gfm

README badge

README badge for github/awesome-copilot/markdown-to-html

Converts Markdown files to HTML using marked.js, pandoc, or custom scripts, with support for GFM, CommonMark, and standard Markdown flavors. Handles single files, batch conversions, code blocks, tables, collapsed sections, and mathematical expressions. Suitable for static site generators like Jekyll and Hugo, or building custom markdown-to-HTML conversion tools.

Generated from the current SKILL.md.

Does this skill support GitHub Flavored Markdown?
Yes. The skill supports GFM, CommonMark, and standard Markdown flavors, with GFM enabled via the `gfm: true` option in marked.js or equivalent settings in pandoc.
What tools does this skill cover?
The skill provides guidance for marked.js (Node.js and CLI), pandoc (command-line tool), and custom conversion scripts. It also references jekyll and hugo for templating systems that convert markdown to HTML.
Does marked.js sanitize HTML output?
No. Marked does not sanitize output HTML. The skill recommends using DOMPurify, sanitize-html, or js-xss to sanitize untrusted markdown before display.
Can this skill handle batch conversions and advanced features like tables and math expressions?
Yes. The skill covers single and batch file conversions, tables with alignment, code blocks with language tags, collapsed sections (details/summary), and mathematical expressions with MathML rendering.
Does pandoc require additional software for PDF output?
Yes. Pandoc requires a LaTeX installation (MacTeX on macOS, MiKTeX on Windows, texlive on Linux) to generate PDF output from markdown.

Generated from the current SKILL.md. These answers refresh after source changes.