Render a markdown file and open it in the default browser.
Usage
- •
/mdview README.md- View README.md - •
/mdview docs/guide.md- View a specific doc file - •
/mdview- View README.md in current directory (default)
Steps
- •
Determine the file to view:
- •Use
$ARGUMENTSif provided - •Default to
README.mdif no argument given - •If argument is a directory, look for README.md in it
- •Use
- •
Verify the file exists:
bash[[ -f "$file" ]] || echo "File not found: $file"
- •
Render and open using mdview:
bashmdview "$file"
- •
Report the result to the user:
- •Confirm the file was rendered
- •Note the temporary HTML file location if relevant
Notes
- •mdview converts markdown to HTML and opens in the default browser
- •Images (including PlantUML URLs) are rendered inline
- •Code blocks get syntax highlighting
- •Works on WSL by opening in Windows browser