Metadata-Version: 2.4
Name: md-preview
Version: 1.0.0
Summary: Render Markdown files with beautiful Bootstrap styling in your browser
Author-email: Your Name <your.email@example.com>
Maintainer-email: Your Name <your.email@example.com>
License: MIT
Project-URL: Homepage, https://github.com/fabiomatricardi/markdown-preview-pypi-package
Project-URL: Documentation, https://github.com/fabiomatricardi/markdown-preview-pypi-package#readme
Project-URL: Repository, https://github.com/fabiomatricardi/markdown-preview-pypi-package
Project-URL: Changelog, https://github.com/fabiomatricardi/markdown-preview-pypi-package/releases
Keywords: markdown,preview,bootstrap,cli,documentation
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: Markup
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: markdown>=3.4
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Dynamic: license-file

# 🌟 md-preview v2.0

**TRUE BOOTSTRAP RENDERING** - Headers, tables, lists, blockquotes, and code blocks all styled with authentic Bootstrap aesthetics. No more "GitHub CSS + random code theme" mismatch!

![Bootstrap Preview](https://blog.ronin.cloud/content/images/size/w2000/2022/02/markdown.png)  
*Left: Flatly theme • Right: Darkly theme (full UI consistency)*

## ✨ What Changed in v2.0?
| Feature | v1.x | v2.0 |
|---------|------|------|
| **Headers** | GitHub style | ✅ Bootstrap typography |
| **Tables** | Basic borders | ✅ `.table-striped` + hover effects |
| **Blockquotes** | Plain italics | ✅ Bootstrap alerts with icons |
| **Lists** | Default bullets | ✅ Bootstrap spacing & semantics |
| **Code Blocks** | Only syntax colored | ✅ Full Bootstrap card styling + copy buttons |
| **Theme Scope** | Code blocks only | ✅ **ENTIRE PAGE** (true UI kit) |
| **Responsiveness** | Limited | ✅ Mobile-first Bootstrap grid |

## 🎨 Available Bootstrap Themes
| Theme | CLI Flag | Type | Best For |
|-------|----------|------|----------|
| **Cosmo** | `default` | Light | Friendly documentation |
| **Flatly** | `flatly` | Light | Modern clean interfaces |
| **Litera** | `litera` | Light | Readable long-form content |
| **Darkly** | `darkly` | Dark | Dark mode lovers (vibrant) |
| **Cyborg** | `cyborg` | Dark | Futuristic/terminal aesthetic |
| **Superhero** | `superhero` | Dark | Bold presentations |

> 💡 **All themes include**:  
> - Responsive tables with hover effects  
> - Blockquotes styled as Bootstrap alerts  
> - Consistent spacing & typography  
> - Mobile-optimized layout  
> - Syntax highlighting that matches theme mode

## 🚀 Usage
```bash
# Install updated package
pip install --upgrade .

# Preview with default Bootstrap theme (Cosmo)
md-preview README.md

# Use popular Flatly theme (clean light design)
md-preview report.md --style flatly

# Dark mode workflow
md-preview notes.md --style darkly

# See ALL elements styled consistently:
echo '# Header\n\n- List item\n\n| Table | Header |\n|-------|--------|\n| Cell  | Data   |\n\n> Blockquote\n\n```python\nprint("Code")\n```' > test.md
md-preview test.md --style cyborg
```

---

# 🌟 md-preview

Render Markdown files with beautiful, modern themes directly in your browser. Zero configuration, instant preview.

<img src='https://user-images.githubusercontent.com/11283502/116907735-a58d7280-ac4a-11eb-8dbd-b905648593f8.png'>  
*Left: GitHub Light • Right: Dracula Dark (auto-switches with OS theme)*

## ✨ Features
- 🎨 **5 gorgeous themes**: GitHub (default), Dracula, Catppuccin, Solarized, Atom
- 🌓 **Automatic dark mode** (respects OS preference)
- 💡 **Syntax highlighting** with copy buttons on code blocks
- 📱 **Fully responsive** design (mobile/desktop)
- 🔒 **No network required after first load** (CDN assets cached by browser)
- 🚀 **Blazing fast** - pure Python, no heavy dependencies
- 🌐 **Works everywhere**: Windows, macOS, Linux


> what if you have some more features to add?


### Tables rendering

#### 🌓 Recommended highlight.js Themes (via `--style` flag):
| Style Arg | Theme | Vibe |
|-----------|-------|------|
| `github` (default) | `github.min.css` | Familiar, professional |
| `dracula` | `dracula.min.css` | Dark, vibrant, developer favorite |
| `catppuccin` | `catppuccin-macchiato.min.css` | Modern pastel dark theme |
| `solarized` | `solarized-dark.min.css` | Classic low-contrast |
| `atom` | `atom-one-dark.min.css` | Smooth dark UI |

> 💡 **Pro Insight**: `github-markdown-css` **already includes dark mode** via system preference detection. Pair with a dark `highlight.js` theme (e.g., `dracula`) for full dark-mode harmony.

## 📦 Installation

### Option 1: Install as package (recommended)
```bash
pip install .
```

### Example of rendered Python code

```python
#!/usr/bin/env python3
"""
md-preview: Render Markdown files with beautiful themes in your browser
"""
import argparse
import html
import pathlib
import sys
import tempfile
import webbrowser

try:
    import markdown
except ImportError:
    print("❌ 'markdown' library not found. Install with: pip install markdown", file=sys.stderr)
    sys.exit(1)

# CORRECTED THEME MAPPINGS (verified CDN paths)
THEME_MAP = {
    "github": "github.min",
    "dracula": "dracula.min",
    "catppuccin": "catppuccin.min",  # FIXED: was catppuccin-macchiato (invalid CDN path)
    "solarized": "solarized-dark.min",
    "atom": "atom-one-dark.min",
}
DEFAULT_THEME = "github"
HIGHLIGHT_VERSION = "11.9.0"  # For cache-busting
```
