Skip to main content

A beautiful Markdown viewer for terminal with code execution support

Project description

MDX - Markdown Viewer for Terminal

PyPI License Python

A beautiful Markdown viewer for terminal with code execution support.

Features

  • 🎨 Beautiful syntax highlighting with multiple themes
  • 📑 Table of contents navigation
  • ⚡ Execute code blocks directly (bash, python)
  • 🔍 Search within documents (supports Chinese)
  • 📖 Multiple rendering modes
  • 🛠️ Development mode for debugging

Installation

pip install mdx-viewer

Usage

# View a markdown file
mdx README.md

# Show table of contents
mdx README.md --toc

# Execute code blocks
mdx README.md --execute

# Jump to specific line
mdx README.md --line 100

# Use different theme
mdx README.md --theme dracula

# Enable development mode
mdx README.md --dev

Options

Option Description
-e, --execute Execute code blocks
-t, --toc Show table of contents
-l, --line Jump to specific line
-m, --theme Syntax highlighting theme
-d, --dev Enable development mode

Keyboard Shortcuts

  • j/k or arrow keys: Scroll up/down
  • g: Go to top
  • G: Go to bottom
  • space/f: Page down
  • b: Page up
  • /: Search
  • n/N: Next/previous search result
  • t: Show table of contents
  • M: Switch theme
  • q: Quit

Search Functionality

  • Press / to enter search mode
  • Type your search term (supports Chinese)
  • Press Enter to search
  • Press n to find next result
  • Press N to find previous result
  • Press ESC to cancel search

Development Mode

Use --dev flag to enable development mode, which shows debug information in a floating window:

mdx --dev filename.md

Themes

Available syntax highlighting themes:

  • monokai (default)
  • dracula
  • github-dark
  • nord
  • solarized-dark

Example

# Read documentation
mdx docs/linux-0.11-filesystem-analysis.md --toc

# Execute tutorial code blocks
mdx docs/tutorial.md --execute

# Debug search functionality
mdx docs/linux-0.11-filesystem-analysis.md --dev

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdx_viewer-0.1.1.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mdx_viewer-0.1.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file mdx_viewer-0.1.1.tar.gz.

File metadata

  • Download URL: mdx_viewer-0.1.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mdx_viewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 75119b0867ce95cbe4b4911e0b6d2a122d6923e563f4186ac642c26aa9c9932d
MD5 7fdc2c46ce06a92b3d584aaa78f232eb
BLAKE2b-256 bc99431615f6f78c4410b327c49192784a15a18902b73c5642a0b5c353667836

See more details on using hashes here.

File details

Details for the file mdx_viewer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mdx_viewer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mdx_viewer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91eb8d47fc4bda472eada75cdc12433002b183a45815f5953c376a92d9262546
MD5 bb364615a077a191f28ed734bf7cdcb3
BLAKE2b-256 92f69ec518a81044af1e755c54aa71a4df8ebfe485c2a99df1a6fbbafd2343b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page