๐ Getting Started with md2html-action
Welcome to md2html-action! This guide will help you quickly start converting Markdown files to beautiful, styled HTML using this powerful GitHub Action.
๐ฏ What is md2html-action?
md2html-action is a GitHub Action that converts Markdown files to stunning HTML using Pandoc. Itโs designed to work with pure vanilla Markdown - no special setup, frontmatter, or configuration required!
โจ Key Features
- ๐ Zero Configuration - Works with any standard Markdown file
- ๐จ 6 Professional Themes - Academic, Technical, Blog, Corporate, Default, and Minimal
- ๐ฑ Fully Responsive - Beautiful on desktop, tablet, and mobile
- ๐ Auto Table of Contents - Generated automatically from your headings
- ๐งฎ Math Support - LaTeX math rendering via Pandoc
- โก Fast & Reliable - Optimized for speed and performance
๐ ๏ธ Prerequisites
Before you begin, ensure you have:
- โ A GitHub repository
- โ Basic knowledge of Markdown syntax
- โ Basic understanding of GitHub Actions (helpful but not required)
๐ Quick Setup
Step 1: Create Your Workflow
Create .github/workflows/convert-docs.yml
in your
repository:
name: Convert Markdown to HTML
on:
push:
paths: ["docs/**/*.md"]
pull_request:
paths: ["docs/**/*.md"]
jobs:
convert:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Convert Markdown to HTML
uses: CameronBrooks11/md2html-action@main
with:
source-dir: "docs" # Directory containing your .md files
output-dir: "html" # Where to save the HTML files
stylesheet: "technical" # Choose: default, minimal, academic, technical, blog, corporate
template: "default" # Choose: default, minimal, github
Step 2: Create Your First Markdown File
Create a docs/
directory and add
docs/index.md
:
# My Documentation
Welcome to my documentation site!
## Getting Started
This is a simple Markdown file that will be converted to beautiful HTML.
### Features
- Pure Markdown support
- No frontmatter required
- Automatic table of contents
- Responsive design
## Code Examples
Here's some Python code:
\```python
def hello_world():
print("Hello from md2html-action!")\```
## Links
- [GitHub Repository](https://github.com/your-username/your-repo)
- [Documentation](https://your-username.github.io/your-repo/)
Step 3: Push and Watch the Magic
Commit and push your changes:
git add . git commit -m "Add md2html-action documentation" git push
Check the Actions tab in your GitHub repository
Watch as your Markdown is converted to stunning HTML!
๐จ Choosing Your Theme
md2html-action includes 6 professional themes:
Theme | Best For | Description |
---|---|---|
๐ Academic | Research papers, theses | Traditional typography, scholarly formatting |
๐ป Technical | API docs, developer guides | Modern tech company design with Inter fonts |
๐ Blog | Personal blogs, articles | Comfortable reading typography |
๐ข Corporate | Business docs, reports | Professional, authoritative styling |
๐จ Default | General documentation | Clean, balanced design |
โก Minimal | Simple sites | Lightweight, fast-loading |
To change themes, simply update the stylesheet
parameter
in your workflow:
- uses: CameronBrooks11/md2html-action@main
with:
stylesheet: "academic" # Change this to any theme name
๐ Writing Effective Markdown
Essential Markdown Syntax
md2html-action works with any standard Markdown file. Here are the key elements:
Headers and Navigation
# Main Title (H1)
## Section (H2)
### Subsection (H3)
#### Details (H4)
Pro Tip: Headers automatically generate a table of contents!
Text Formatting
**Bold text** for emphasis
_Italic text_ for subtle emphasis`inline code` for technical terms
~~Strikethrough~~ for corrections
Lists and Tasks
Unordered lists:
- First item
- Second item
- Nested item
- Another nested item
Ordered lists:
1. Step one
2. Step two
3. Step three
Task lists:
- [x] Completed task
- [ ] Pending task
- [ ] Future task
Links and Images
[Link text](https://example.com)
[Internal link](other-page.md)


Code Blocks
Use triple backticks with language specification:
```python
def example_function():
"""This is a Python function."""
return "Hello, World!"
```
```javascript
const greeting = (name) => {
return `Hello, ${name}!`;
;
}```
```bash
# Shell commands
npm install
git commit -m "Update docs"
```
Tables
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Data 1 | Data 2 | Data 3 | | Row 2 | More | Data |
Blockquotes
> This is a blockquote.
> It can span multiple lines.
>
> Perfect for highlighting important information!
๐ง Working with Pure Markdown
One of md2html-actionโs greatest strengths is its support for pure vanilla Markdown:
โ What Works Out of the Box
# My Documentation
This is a simple Markdown file that requires no special setup!
## Features
- Pure Markdown support
- No frontmatter required
- Automatic title extraction from `# Heading`
- Table of contents generation
- Responsive design
## Code Example
\```python
def hello():
print("No configuration needed!")\```
## Links
- [Another page](getting-started.md)
- [External link](https://github.com)
๐๏ธ Optional Frontmatter
While not required, you can add frontmatter for more control:
---
title: "Custom Page Title"
description: "SEO-friendly page description"
author: "Your Name"
date: "2024-01-01"
---
# Your Content Here
The frontmatter above is completely optional but gives you more control over metadata.
๐ Organizing Your Documentation
Recommended Directory Structure
your-repository/
โโโ docs/ # Your Markdown files
โ โโโ index.md # Homepage
โ โโโ getting-started.md # Getting started guide
โ โโโ api/ # API documentation
โ โ โโโ index.md
โ โ โโโ endpoints.md
โ โโโ guides/ # User guides
โ โ โโโ installation.md
โ โ โโโ configuration.md
โ โโโ media/ # Images and assets
โ โโโ logo.png
โ โโโ screenshots/
โโโ .github/
โ โโโ workflows/
โ โโโ docs.yml # Your md2html-action workflow โโโ README.md
Navigation Best Practices
- Start with index.md - This becomes your homepage
- Use clear, descriptive filenames -
getting-started.md
notstart.md
- Create logical hierarchies - Group related content in folders
- Link between pages - Use relative links like
[Guide](guides/installation.md)
- Include a media folder - Keep images organized
๐ฑ Mobile-Friendly Tips
All themes are fully responsive, but you can optimize for mobile:
Image Sizing

<!-- Images automatically scale to container width -->
Table Formatting
| Feature | Mobile | Desktop |
| ------- | ------------- | ------------ |
| Layout | Single column | Multi-column | | TOC | Collapsible | Sidebar |
Content Structure
- Use shorter paragraphs on mobile
- Break up long sections with subheadings
- Include plenty of whitespace
โก Performance Tips
- Optimize Images - Use compressed images (WebP, optimized JPG/PNG)
- Choose the Right Theme - Minimal theme loads fastest
- Organize Content - Split very long pages into multiple files
- Use Proper Headings - Creates better TOC structure
๐ฏ Next Steps
Now that you understand the basics:
๐ Read the Advanced Configuration Guide - Learn about custom templates, advanced Pandoc options, and deployment strategies
๐จ Explore the Demo Gallery - See all themes in action at the demo gallery
๐ง Customize Your Setup - Experiment with different themes and templates
๐ Check Real Examples - Browse the source code of this documentation for reference
๐ Troubleshooting
Common Issues
Problem: Action not triggering
Solution: Check your workflow file paths and ensure
youโre pushing to the correct branch
Problem: Styles not applying
Solution: Verify the stylesheet name in your workflow
matches available themes
Problem: Images not showing
Solution: Use relative paths and ensure images are in
your source directory
Problem: TOC not generating
Solution: Make sure youโre using proper Markdown
headers (#
, ##
, ###
)
Getting Help
- ๐ Check the Issues - Browse existing GitHub issues for solutions
- ๐ฌ Start a Discussion - Ask questions in GitHub Discussions
- ๐ Read the Source - The action is open source and well-documented
Ready to dive deeper? Continue to Advanced Configuration for power-user features!