Skip to content

matpb/markdown-viewer-extension

Repository files navigation

Markdown Viewer πŸ“βœ¨

A Chrome extension that makes your markdown files look beautiful! Open any .md file in Chrome and watch it transform into gorgeously formatted HTML with syntax highlighting, dark mode, and more.

Version License Chrome


Why This Extension?

Ever opened a markdown file in your browser and been disappointed by the plain text? We felt the same way. This extension automatically detects markdown files and renders them with:

✨ Beautiful GitHub-style formatting - Looks just like GitHub 🎨 Syntax highlighting - 15+ programming languages supported πŸŒ— Dark & Light themes - Easy on the eyes, day or night πŸ“‹ One-click copy - Copy code blocks instantly βœ… Task lists - Checkboxes that actually look like checkboxes πŸ“„ Raw view toggle - See the original markdown anytime ✏️ Paste & render - Paste or type markdown directly and render it on the fly πŸ” Render selected text - Select markdown on any webpage and render it instantly


Installation

Quick Start (3 steps)

  1. Download this repository (click the green "Code" button β†’ Download ZIP)

  2. Load in Chrome:

    • Open Chrome and go to chrome://extensions/
    • Turn on Developer mode (toggle in top-right)
    • Click Load unpacked and select the folder
  3. Enable file access (important!):

    • Find Markdown Viewer in your extensions
    • Click Details
    • Enable "Allow access to file URLs"

That's it! πŸŽ‰


How to Use

View Markdown Files

Just drag any .md file into Chrome, or use File β†’ Open to browse for one. The extension automatically takes over and renders it beautifully.

Render Selected Text

See some markdown on a webpage? Select it and render it instantly:

  1. Highlight any text on a webpage
  2. Click the Markdown Viewer icon in the toolbar, or right-click and choose "Render selection as Markdown"
  3. A new tab opens with the selected text rendered as beautiful markdown

This works on any webpage β€” great for previewing markdown in GitHub comments, READMEs, documentation, chat messages, or anywhere else.

Paste & Render

Want to quickly preview some markdown? You can paste or type it directly:

  1. Click the extension icon (no text selection needed)
  2. Click the { } button in the top-right to open the editor
  3. Paste or type your markdown
  4. Click πŸ“„ (or press Ctrl/Cmd+Enter) to render it

Toggle back and forth between editing and rendered view anytime!

Toolbar Features

  • πŸŒ™/β˜€οΈ Toggle dark/light theme (your choice is saved)
  • { } Open the markdown editor / view raw source
  • πŸ“„ Render the editor content back to formatted markdown
  • Filename Always know which file you're viewing

Code Blocks

Hover over any code block to see a Copy button appear. Click it to copy the code to your clipboard!


What's Supported?

Markdown Features

  • Text formatting: bold, italic, strikethrough
  • Headers: All levels (H1-H6)
  • Lists: Ordered, unordered, and nested
  • Links & Images: External and relative paths
  • Tables: With alignment support
  • Task lists: - [x] and - [ ] become real checkboxes
  • Blockquotes: Clean, styled quotes
  • Horizontal rules: Visual separators
  • Inline & block code: Syntax highlighted

Programming Languages

Syntax highlighting works for:

JavaScript β€’ TypeScript β€’ JSX β€’ TSX β€’ Python β€’ Go β€’ Rust β€’ Java β€’ PHP β€’ Ruby β€’ Bash β€’ JSON β€’ YAML β€’ SQL β€’ CSS β€’ Markdown

Missing your favorite language? It's easy to add more!


Examples

Before

# My Project
This is my **project** with some `code`...

After

![Beautiful rendered markdown with styling, colors, and formatted code blocks]


Privacy & Security

πŸ”’ 100% Local - All rendering happens in your browser 🚫 No tracking - Zero analytics, zero data collection 🌐 No network requests - Works completely offline βœ… Open source - Review the code yourself

Your files never leave your computer.


Tips & Tricks

Using Relative Paths

Images and links can use relative paths:

![Logo](./assets/logo.png)
[Read more](./docs/guide.md)

Just make sure the paths are correct relative to your markdown file!

Keyboard Shortcuts

While viewing a file:

  • Ctrl/Cmd + F: Search in page
  • Ctrl/Cmd + +/-: Zoom in/out
  • F5: Reload if file changed on disk

Customization

Want to tweak the colors or add more languages? All the code is in plain JavaScript and CSS:

  • Styling: Edit styles/viewer.css
  • Code highlighting: Modify lib/prism.js
  • Markdown parsing: Configure viewer.js

After making changes, just click the reload button in chrome://extensions/.


Troubleshooting

Extension not working?

Issue: Markdown files still show as plain text Fix: Make sure "Allow access to file URLs" is enabled (see Installation step 3)

Issue: Code blocks have no syntax highlighting Fix: Specify the language in your markdown:

```javascript
// your code here
```

Issue: Images don't load Fix: Use absolute paths like file:///full/path/to/image.png or relative paths from the markdown file

Still stuck?

Open an issue on GitHub and we'll help you out!


Contributing

Found a bug? Want to add a feature? Contributions are welcome!

  1. Fork the repository
  2. Make your changes
  3. Test thoroughly
  4. Submit a pull request

Or just open an issue to discuss ideas!


Built With


Authors

Mathieu-Philippe Bourgeois (@matpb) Developer, creator of Cortex AI

Cortex - AI assistant Mathieu-Philippe's personal AI assistant, powered by Claude. Built to help with coding, automation, and creative projects.


License

MIT License - Free to use, modify, and share!

See LICENSE file for details.


Changelog

v1.2.0 (2026-02-11)

  • ✏️ Paste or type markdown directly in the editor and render it on the fly
  • πŸ”„ Toggle between editing and rendered view with the { } / πŸ“„ button
  • ⌨️ Ctrl/Cmd+Enter keyboard shortcut to render from editor
  • πŸ“ Updated empty state with editor instructions
  • 🚫 Helpful error page for restricted pages (chrome://, Web Store) with setup instructions
  • πŸ“¦ Added package.sh script for building the Chrome Web Store zip

v1.1.0 (2026-02-08)

  • πŸ” Render selected text as markdown from any webpage
  • πŸ–±οΈ Right-click context menu: "Render selection as Markdown"
  • πŸ–ΌοΈ Clickable extension icon to render selected text
  • πŸ› οΈ Friendly instructions when no text is selected
  • πŸ› Fixed table rendering contrast in light theme

v1.0.0 (2026-02-06)

  • πŸŽ‰ Initial release
  • ✨ GitHub Flavored Markdown support
  • 🎨 Syntax highlighting for 15+ languages
  • πŸŒ— Dark/light theme toggle
  • πŸ“‹ Copy buttons on code blocks
  • βœ… Task list rendering
  • πŸ“„ Raw markdown view

Made with ❀️ by humans and AI working together

If this extension makes your life easier, give it a ⭐ on GitHub!

About

Chrome extension to view markdown files as HTML with GitHub Flavored Markdown support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors