https://github.com/Titor8115/mandown
man-page inspired Markdown viewer
https://github.com/Titor8115/mandown
c cli command-line console linux man man-page markdown ncurses ncurses-ui terminal tui
Last synced: 6 months ago
JSON representation
man-page inspired Markdown viewer
- Host: GitHub
- URL: https://github.com/Titor8115/mandown
- Owner: Titor8115
- License: gpl-3.0
- Created: 2020-04-08T23:39:04.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T18:37:47.000Z (6 months ago)
- Last Synced: 2025-04-01T19:38:27.446Z (6 months ago)
- Topics: c, cli, command-line, console, linux, man, man-page, markdown, ncurses, ncurses-ui, terminal, tui
- Language: C
- Size: 511 KB
- Stars: 249
- Watchers: 6
- Forks: 13
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mandown - mdn
A man-page inspired Markdown pager written in C.
**Name change:** executable's name changed to `mdn`
## What is it
Need to lookup things from README? Or from manual page? Or perhaps just want to install something cool...
## Update
- User Customization
- Added control schemes: mdn, vim, less(default since mdn isn't complete)
- Config file location: `~/.config/mdn/mdnrc`## Sample

## Library dependency
Mandown requires `libncurses(w)`, `libxml2` and `libconfig` as compile-time dependencies.
Make sure you have them installed before compiling.
### Debian
```shell
$ apt-get install libncursesw5-dev
$ apt-get install libxml2-dev
$ apt-get install libconfig-dev
```## Installation
Current version is still being developed for some HTML tags. However, it should work on most Markdown documents.
### Homebrew
```shell
$ brew install mandown
```The installed binary `mdn` would be at `/usr/local/bin/`
### Local
```shell
$ git clone https://github.com/Titor8115/mandown.git
$ cd mandown
$ make install
```To remove the binary, you can run the commands below, or remove manually.
```shell
$ cd mandown
$ make uninstall
```If you just want to compile and test it.
```shell
$ cd mandown
$ make
```Feel free to create an issue.
## Usage
Check out the new sample
```shell
$ mdn sample.md
```Mouse scrolling is supported! (if your terminal emulator allows)
Move Up: Up, k
Move Down: Down, j
Page Up: Space, PgUp, b
Page Down: Bksp, PgDn, f
Show href in hyperlink: Tab + Enter, or double click mouse 1
Exit: q
To read detailed usage, run `mdn -h`
## Embedding
Mandown can also be embedded in your own applications. To render a Markdown document in a C string:
```c
#include "mandown.h"char *str ="# Heading\n\nThis is some **BOLD** *italic* ***EMPHASIZED*** text.";
render_str(str, "md", "Test Title", NULL);
```To render a Markdown document file:
```c
#include "mandown.h"FILE *fp = fopen("README.md", "r");
render_file(fp, "md", "Test file", NULL);
```Static and shared libraries are available. Make sure you have installed the dependencies listed in **Library dependency** below, then assuming you installed Mandown under `/usr/local`:
```shell
# static build
gcc -o myprog -I/usr/local/include myprog.c /usr/local/lib/mandown.a -lncurses -lxml2 -lconfig
``````shell
# shared build
gcc -o myprog -I/usr/local/include myprog.c -L/usr/local/lib -lmandown -lncurses -lxml2 -lconfig
```
tests## Todo
- [x] Line fold/wrap on white space
- [x] Optimized resizing
- [x] Makefile makeover
- [ ] Add more config options
- [ ] Table and contents rendering