Titor8115/mandown
À propos
man-page inspired Markdown viewer
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Originalmandown - 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
- More text format configs
- supported blocks: heading, code, url, quote block,
- configurable
- indent
- color
- background
- bold, italic, underline, dim
- prefix (for quote block)
- Using
confinifiletype as config file (usinglibconfigfor processing)
See example config mdnrc for more details.
Sample

Library dependency
Mandown requires libncurses(w), libxml2 and libconfig as compile-time dependencies.
Make sure you have them installed before compiling.
Debian
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
brew install mandown
The installed binary mdn would be at /usr/local/bin/
Debian
Third Party Repo
Install at your own discretion. See Debian project philosophy regarding third-party repositories.
pkg.haus
Mandown is available from the pkg.haus APT archive for Debian stable, testing and unstable on amd64 and arm64. Set up the archive per the instructions on pkg.haus, then run:
$ sudo apt install mandown
The installed binary mdn would be at /usr/bin/
Local
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.
cd mandown
make uninstall
If you just want to compile and test it.
cd mandown
make
Feel free to create an issue.
Usage
Check out the new sample
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:
#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:
#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:
# static build
gcc -o myprog -I/usr/local/include myprog.c /usr/local/lib/mandown.a -lncurses -lxml2 -lconfig
# shared build
gcc -o myprog -I/usr/local/include myprog.c -L/usr/local/lib -lmandown -lncurses -lxml2 -lconfig
tests
Todo
- Line fold/wrap on white space
- Optimized resizing
- Makefile makeover
- Add more config options
- Table and contents rendering
Explorer des projets similaires
Chargement…