![]() ![]() Regarding the strange theme ids: Those numbers are the calculated total luminocity of the 5 theme colors. bashrc will give you a consistent color scheme. # Environ Vars ` $MDV_THEME ` and ` $MDV_CODE_THEME ` are understood, e.g. Setting both to all will probably spin your beach ball. So to see all code hilite variations with a given theme: ![]() If file is not given we use a short sample file. mdv -t all : All available md styles on the given file. # Themes # Theme Rollers mdv -T all : All available code styles on the given file. Like: mdv -M './mydocs : py,md::open " _fp _"' which calls the openĬommand with argument the path to the changed file. _fp_ # Will be replaced with filepath _raw_ # Will be replaced with the base64 encoded raw content of the file _pretty_ # Will be replaced with the base64 encoded prettyfied output If you append to ` -M ` a ` '::' ` we run the command on any change detected (sync, in foreground). markdown files are checked but you can change like ` -M 'mydir:py,c,md,' ` where the last empty substrings makes mdv also monitor any file w/o extension (like 'README'). We check only text file changes, monitoring their size.īy default. If FROM is not found we display the whole file. all: Show markdown docstrings AND code (default if you say, e.g. Mark inline markdown with a ' _' following the docstring beginnings. Set -C for source code highlighting of source code files. Resulting in output from the top (if your terminal height can be derived correctly through the stty cmd). If the substring is not found we set it to the *first * character of the file. f 'Some Head:10' -> displays 10 lines after 'Some Head' Sorry then for no P圓 support, accepting PRs if they don't screw Py2.įROM may contain max lines to display, seperated by colon. If you pipe into mdv we use 80 cols.Ĭall the main function with markdown string at hand to get aįormatted one back. We use stty tool to derive terminal size. u STYL : Link Style (it=inline table=default, h=hide, i=inline) -x : Do not try guess code lexer (guessing is a bit slow) # Notes: 3 or 1- or 1-5 -t THEME : Key within the color ansi_table.json. ![]() h : Show help -i : Show theme infos with output -l : Light background (not yet supported) -m : Monitor file for changes and redisplay FROM given substring -n NRS : Header numbering (default: off. different than 4 -c COLS : Fix columns to this (default: your terminal width) -f FROM : Display FROM given substring of the file. X Lexer : Default lexer name (default: python). # Usage: mdv MDFILE # Options: MDFILE : Path to markdown file -A : Strip all ansi (no colors then) -C MODE : Sourcecode highlighting mode -H : Print html version -L : Backwards compatible shortcut for '-u i' -M DIR : Monitor directory for markdown file changes -T C_THEME: Theme for code highlight. For playing around, especially with theming or when with Python, this one might be a valid alternative to look at. for your customers) I recommend nd still, due to the early state of mdv. Summary: For production ready robust markdown viewing (e.g. vimcat (Also heavy and hard to use inline in other programs).(Heavy and hard to use from within other programs. pandoc -> html -> elinks, lynx or pandoc -> groff -> man.But have a look at them, they do some things better than mdv in this early version (I try to learn from them). too old to hack other peoples' js (struggling enough with my own). Also I personally wanted table handling and admonition support throughout and prob. msee, ansidown, ansimd and also nd which is great) but they require nodejs & npm, which I don't have on my servers. There are quite a few from the js community (e.g.The ones I know of (and which made me write mdv -) ): Check inotify based tools if you want sth better. Note: Poor man's implementation, polling. which passes filepath, raw and prettyfied content to the other command.which can run arbitrary commands on file changes. ![]() Little directory change monitor (cames handy when working on multiple files, to get the current one always displayed).wide table handling avoiding "interleaving" Those can be combined for code vs regular markdown output. Tons of theme combinations: mdv ships with > 200 luminocity sorted themes, converted from html themes tables to ansi.Mdv is a proof of concept hack: While for simple structures it does its job quite well, for complex markdown you want to use other tools.Įspecially for inlined html it simply fails. (the '_' after the docstring telling mdv that markdown follows) setup.py install - """ from setuptools import setup, find_packages import mdv setup( py #!/usr/bin/env python2.7 # coding: utf-8 """_ # Mdv installation # Usage. ~ / terminal_markdown_viewer $ cat setup. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |