{"id":30805548,"url":"https://github.com/aaronsb/markdown-mixed-media","last_synced_at":"2026-01-21T21:09:02.853Z","repository":{"id":311341611,"uuid":"1043081055","full_name":"aaronsb/markdown-mixed-media","owner":"aaronsb","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-11T21:27:06.000Z","size":127669,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-13T01:59:52.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaronsb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-23T05:20:02.000Z","updated_at":"2025-12-11T21:21:49.000Z","dependencies_parsed_at":"2025-08-24T09:20:30.228Z","dependency_job_id":"3603a2c1-52a0-4a91-bf1a-b860e5f7ac02","html_url":"https://github.com/aaronsb/markdown-mixed-media","commit_stats":null,"previous_names":["aaronsb/markdown-mixed-media"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aaronsb/markdown-mixed-media","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Fmarkdown-mixed-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Fmarkdown-mixed-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Fmarkdown-mixed-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Fmarkdown-mixed-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronsb","download_url":"https://codeload.github.com/aaronsb/markdown-mixed-media/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronsb%2Fmarkdown-mixed-media/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28642845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-06T00:58:51.581Z","updated_at":"2026-01-21T21:09:02.846Z","avatar_url":"https://github.com/aaronsb.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MMM - Markdown Mixed Media\n\nA powerful terminal-based markdown viewer and converter with inline image support, Mermaid diagrams, syntax highlighting, and export capabilities for PDF and ODT formats.\n\n![Demo Image](examples/demo.png)\n\n## ✨ Features\n\n- 📝 **Rich Markdown Rendering** - Full CommonMark support with styled terminal output\n- 🎨 **Advanced Syntax Highlighting** - Beautiful code blocks with semantic highlighting (bold keywords, italic functions, colored syntax)\n- 🖼️ **Inline Images** - Display images directly in terminal using Sixel/iTerm2/Kitty protocols via chafa\n- 📊 **Mermaid Diagrams** - Render flowcharts, sequence diagrams, and more (requires mermaid-cli)\n- 📄 **PDF Export** - Generate professional PDFs with customizable fonts and layouts\n- 📑 **ODT Export** - Create OpenDocument Text files for word processors\n- ⚙️ **Interactive Settings** - Configure rendering profiles, fonts, colors, and more\n- 🎯 **Standalone Binary** - Single executable that works independently after installation\n- 🔍 **SVG Support** - Render embedded SVG graphics in documents\n\n## 🚀 Quick Install\n\n### From AUR (Arch Linux)\n\n```bash\n# Using yay\nyay -S mmm\n\n# Using paru\nparu -S mmm\n\n# Or build manually\ngit clone https://aur.archlinux.org/mmm.git\ncd mmm\nmakepkg -si\n```\n\nFor the development version:\n```bash\nyay -S mmm-git\n```\n\n### From Source\n\n```bash\n# Clone the repository\ngit clone https://github.com/aaronsb/markdown-mixed-media.git\ncd markdown-mixed-media\n\n# Install dependencies\nnpm install\n\n# Build and install\n./scripts/install.sh\n\n# View any markdown file\nmmm README.md\n```\n\n## 📋 Prerequisites\n\n### Required\n- **Node.js** v20 or higher (for building)\n- **Git** (for cloning)\n\n### Optional (but recommended)\n- **chafa** - For image rendering in terminal\n- **mermaid-cli** - For Mermaid diagram support\n\n### Installing Dependencies\n\n**Ubuntu/Debian:**\n```bash\n# Image support\nsudo apt-get install chafa\n\n# Mermaid diagrams\nnpm install -g @mermaid-js/mermaid-cli\n# or\nsudo apt-get install mermaid\n```\n\n**Arch Linux:**\n```bash\n# Image support\nsudo pacman -S chafa\n\n# Mermaid diagrams\nyay -S mermaid-cli\n# or\nsudo pacman -S mermaid-cli\n```\n\n**macOS:**\n```bash\n# Image support\nbrew install chafa\n\n# Mermaid diagrams\nbrew install mermaid-cli\n# or\nnpm install -g @mermaid-js/mermaid-cli\n```\n\n**Fedora:**\n```bash\n# Image support\nsudo dnf install chafa\n\n# Mermaid diagrams\nnpm install -g @mermaid-js/mermaid-cli\n```\n\n## 📖 Usage\n\n```bash\nmmm [file] [options]\ncat file.md | mmm               # Read from stdin\n\nOptions:\n  --help, -h     Show help\n  --version      Show version\n  --check        Check dependencies and exit\n  --settings     Configure MMM settings interactively\n  --pdf          Generate PDF instead of terminal output\n  --odt          Generate ODT instead of terminal output\n  --profile      Specify render profile (default: terminal)\n\nExamples:\n  mmm README.md                    # View in terminal\n  cat README.md | mmm              # Read from piped input\n  echo \"# Hello\" | mmm             # Render markdown from echo\n  mmm --pdf README.md              # Generate PDF (auto-named)\n  mmm --pdf README.md output.pdf   # Generate PDF with custom name\n  mmm --odt README.md              # Generate ODT document\n  mmm --settings                   # Configure settings\n  mmm --check                      # Check dependencies\n```\n\n## ⚙️ Configuration\n\nMMM supports extensive configuration through the interactive settings menu:\n\n```bash\nmmm --settings\n```\n\n### Available Settings\n\n#### Terminal Settings\n- Terminal width fallback\n- Image transparency threshold\n- Table word wrapping\n- Table width percentage\n\n#### Image Settings\n- Width percentage (10-100%)\n- Alignment (left, center, right)\n- DPI for PDF/ODT output\n\n#### Mermaid Settings\n- Diagram width and height\n- Theme selection (dark, light, forest, neutral)\n- Background color\n- Font customization\n- DPI for high-quality output\n\n#### PDF Settings\n- Page size (A4, Letter, Legal, A3)\n- Orientation (portrait, landscape)\n- Headers and footers\n- Page numbers\n- **Font selection** (NEW!)\n  - Body font\n  - Heading font\n  - Code font\n  - Interactive font browser with system font detection\n\n#### ODT Settings\n- Page configuration\n- Export options\n\n### Configuration File\n\nSettings are stored in `~/.config/mmm/config.json` with multiple profiles:\n- `terminal` - Default terminal viewing\n- `pdf` - PDF export settings\n- `odt` - ODT export settings\n- `print` - Print-optimized settings\n\n## 🎨 Supported Markdown Features\n\n### Standard Markdown\n- **Bold**, *italic*, ~~strikethrough~~, `inline code`\n- Headers (H1-H6)\n- Lists (ordered and unordered, nested)\n- Blockquotes\n- Horizontal rules\n- Links and images\n- Tables with borders\n\n### Code Blocks with Syntax Highlighting\n\n```javascript\n// Enhanced syntax highlighting with:\n// - Bold keywords (if, function, class)\n// - Italic function calls\n// - Colored strings, numbers, comments\nfunction greet(name) {\n  console.log(`Hello, ${name}!`);\n  return true;\n}\n```\n\nSupported languages:\n- JavaScript/TypeScript\n- Python\n- Go\n- Rust\n- Java\n- C/C++\n- Ruby\n- Bash/Shell\n- SQL\n- JSON\n- YAML\n- Markdown\n- And many more...\n\n### Mermaid Diagrams\n\n```mermaid\ngraph TD\n    A[Start] --\u003e B{Decision}\n    B --\u003e|Yes| C[Success]\n    B --\u003e|No| D[Try Again]\n    D --\u003e B\n```\n\n### Embedded Images\n\nImages are automatically rendered in the terminal using the best available protocol:\n- Sixel graphics\n- iTerm2 inline images\n- Kitty graphics protocol\n\n### SVG Graphics\n\nEmbedded SVG graphics are automatically rendered as images in terminal output.\n\n## 🏗️ Architecture\n\nMMM is built as a standalone application that:\n1. Parses markdown using the `marked` library\n2. Renders to terminal with custom formatting and image protocols\n3. Exports to PDF using Puppeteer\n4. Exports to ODT with proper formatting\n5. Uses system `mermaid-cli` for diagram rendering\n\nThe application is compiled to a single executable that references the compiled JavaScript, making it portable and independent after installation.\n\n## 📁 Project Structure\n\n```\nmarkdown-mixed-media/\n├── src/\n│   ├── index-direct.tsx      # Main terminal renderer\n│   ├── index-simple.tsx      # Simple text renderer\n│   ├── settings-cli.ts       # Interactive settings manager\n│   ├── lib/\n│   │   ├── config.ts         # Configuration management\n│   │   ├── mermaid.ts        # Mermaid diagram rendering\n│   │   ├── image.ts          # Image protocol handling\n│   │   ├── svg.ts            # SVG rendering\n│   │   ├── pdf-renderer.ts   # PDF generation\n│   │   ├── odt-renderer.ts   # ODT generation\n│   │   ├── font-utils.ts     # Font detection and selection\n│   │   └── terminal-syntax-highlighter.ts  # Syntax highlighting\n├── scripts/\n│   ├── install.sh            # Installation script\n│   ├── build-simple.js       # Simple build script\n│   └── build-binary.js       # Binary builder\n├── package.json\n├── tsconfig.json\n└── README.md\n```\n\n## 🛠️ Development\n\n```bash\n# Run in development mode\nnpm run dev\n\n# Run simple text mode\nnpm run dev:simple\n\n# Build TypeScript\nnpm run build\n\n# Create executable\nnpm run build:simple\n\n# Install locally\n./scripts/install.sh\n\n# Run tests\nnpm test\n```\n\n## 🚦 Terminal Compatibility\n\n| Terminal | Image Support | Notes |\n|----------|--------------|-------|\n| WezTerm | ✅ | Full Sixel, iTerm2, Kitty support |\n| Kitty | ✅ | Native graphics protocol |\n| iTerm2 | ✅ | Native inline images |\n| Konsole | ✅ | Sixel support |\n| Windows Terminal | ✅* | Sixel in v1.22+ |\n| Alacritty | ❌ | No image support |\n| GNOME Terminal | ❌ | No image support |\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- [Marked](https://marked.js.org/) - Markdown parser\n- [Marked Terminal](https://github.com/mikaelbr/marked-terminal) - Terminal rendering\n- [Mermaid](https://mermaid-js.github.io/) - Diagram generation\n- [Chafa](https://hpjansson.org/chafa/) - Terminal graphics\n- [Puppeteer](https://pptr.dev/) - PDF generation\n- [Highlight.js](https://highlightjs.org/) - Syntax highlighting\n\n## 🐛 Known Issues\n\n- Mermaid diagrams require system-installed `mermaid-cli`\n- Large images may need resizing for optimal display\n- Some terminals may not support image protocols\n- PDF generation requires Chromium/Chrome\n\n---\n\nMade with ❤️ for the terminal","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronsb%2Fmarkdown-mixed-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronsb%2Fmarkdown-mixed-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronsb%2Fmarkdown-mixed-media/lists"}