{"id":13658152,"url":"https://github.com/kneufeld/consolemd","last_synced_at":"2025-07-06T19:34:21.265Z","repository":{"id":60721992,"uuid":"87027101","full_name":"kneufeld/consolemd","owner":"kneufeld","description":"render markdown to the console (not just highlight it)","archived":false,"fork":false,"pushed_at":"2019-07-08T13:27:03.000Z","size":70,"stargazers_count":98,"open_issues_count":2,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-10T11:39:21.508Z","etag":null,"topics":["console-application","markdown","markdown-viewer","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/kneufeld.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-03T00:59:05.000Z","updated_at":"2024-02-01T12:36:53.000Z","dependencies_parsed_at":"2022-10-03T20:31:24.937Z","dependency_job_id":null,"html_url":"https://github.com/kneufeld/consolemd","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kneufeld%2Fconsolemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kneufeld%2Fconsolemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kneufeld%2Fconsolemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kneufeld%2Fconsolemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kneufeld","download_url":"https://codeload.github.com/kneufeld/consolemd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228304112,"owners_count":17898919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["console-application","markdown","markdown-viewer","python"],"created_at":"2024-08-02T05:00:56.841Z","updated_at":"2024-12-05T13:09:07.616Z","avatar_url":"https://github.com/kneufeld.png","language":"Python","readme":"# ConsoleMD\n\nConsoleMD renders markdown to the console.\n\n## Python 3\n\nDue to the inexorable tides, ConsoleMD is now Python3 only. If things happen\nto work in Python2 then super great, but that is no longer a requirement.\n\n## Installation\n\nIt's highly recommended to install ConsoleMD inside a Python3 virtual environment.\n\n```bash\n# activate your python venv\npip install consolemd\n\n# you probably want to make consolemd more accessible so...\ncd ~/bin\nln -s ~/path/to/venv/bin/consolemd consolemd\n```\n\n## Development\n\nIf you'd like to hack on ConsoleMD and/or run some mediocre tests, then\nplease do the following:\n\n```bash\ngit clone https://github.com/kneufeld/consolemd.git\ncd consolemd\n\n# make a python3 virtual environment and activate it\n\npip install -e .[test]\npython setup.py test    # this will install some extra deps and run tests\n```\n\n## Usage\n\nYou can treat `consolemd` pretty much like you would `less` or `pygmentize`.\n\n```bash\nconsolemd --help\nconsolemd README.md\ncat README.md | consolemd\n```\n\nYou can change the colors `consolemd` uses via `-s` or the environment\nvariable `CONSOLEMD_STYLE=name`.\n\nIf your terminal doesn't support true color (16 million colors) then\nrun `consolemd` with `--no-true-color` or set environment variable\n`CONSOLEMD_TRUECOL=0`.\n\nIf you like really long lines that wrap at terminal edge then\nuse `--no-soft-wrap` or set `CONSOLEMD_WRAP=0`.\n\nTo specify a max line width, then add `-w N` to the command line or\nexport variable `CONSOLEMD_WIDTH` or `MANWIDTH`. Note that this feature\nis pretty hacky and lines with internal formatting will likely end up\nlonger than the desired width.\n\nA current at-time-of-writing list of pygment styles is the following:\n\n```text\nabap algol algol_nu arduino autumn borland bw colorful default emacs\nfriendly fruity igor lovelace manni monokai murphy native pastie perldoc\nrainbow_dash rrt sas stata tango trac vim vs xcode\n```\n\n`consolemd` uses `native` by default but `monokai` is also very nice.\n\n## Your terminal\n\niTerm2 under OSX is great and nicely supports true color. Urxvt under\nLinux only pretends to be true color and doesn't do it very well.\n\nIf you have strange color issues then running with `--no-true-color`\nshould be the first thing you try. If that fixes your problem then\nmake sure to add `CONSOLEMD_TRUECOL=0` to your `.bashrc`.\n\nSee this [gist](https://gist.github.com/XVilka/8346728) for more info.\n\n## Italics, OSX, and you\n\nFor some reason Apple has disabled _italics_ in the their `terminfo` files\nso you have to do a little patching to enable them. This is irrespective\nof which terminal program you use but may depend on what `$TERM` is set\nto.\n\nAnyhow, based on this excellent [post](http://www.eddieantonio.ca/blog/2015/04/16/iterm-italics/)\nhere's the `tl;dr` on enabling _italics_ in OSX.\n\n```bash\ninfocmp xterm-256color \u003e /tmp/xterm-256color.terminfo\nprintf '\\tsitm=\\\\E[3m, ritm=\\\\E[23m,\\n' \u003e\u003e /tmp/xterm-256color.terminfo\ntic /tmp/xterm-256color.terminfo\n```\n\nNote, the `printf` line above may not work quite right so edit\n`/tmp/xterm-256color.terminfo` and manually append `sitm=\\E[3m, ritm=\\E[23m,`\nto the end of the file.\n\nRegardless, restart your terminal program of choice and italics should\nwork. Test with:\n\n```bash\necho `tput sitm`italics`tput ritm`\n```\n\n## Why not just use pygments?\n\nBecause pygments highlights the markdown but doesn't strip out\nthe control characters. Also, ConsoleMD uses CommonMark to parse\nthe markdown instead of the lousy one in pygments _(I'm allowed to\nsay that since I'm the guy that wrote it)_.\n\nAlso, ConsoleMD uses some parts of pygments internally, and uses\npygments to highlight code blocks.\n\n## CommonMark\n\nOver the last few years there's been work on standardizing\nmarkdown with an official spec, that work happens at\n[CommonMark.org](http://commonmark.org/).\n\nThe python implementation of the specification that I used is\ncalled [CommonMark-py](https://github.com/rtfd/CommonMark-py).\n\nGithub has recently (March 2017) converted all internal markdown\nto use a CommonMark parser, an interesting article can be found\n[here](https://githubengineering.com/a-formal-spec-for-github-markdown/).\n\n## Bugs?\n\nProbably. There are lots of corner cases and it's not always clear what\nthe proper output should even be. For instance, an executive decision\nwas made to show url links as a list at the end of the document.\n\nUnfortunately `commonmark-py` isn't very easy to use as a library so if\nany node types got missed then chaos may ensue. Please open a bug (or even\nbetter a pull request) so that `consolemd` can get patched up.\n\nUnicode is always fun: ȧƈƈḗƞŧḗḓ ŧḗẋŧ ƒǿř ŧḗşŧīƞɠ\n\n## Contributing\n\nIf you help out in any way make sure you add your name to `CONTRIBUTORS.md`.\n\n## Example\n\n![](http://i.imgur.com/9zoSZdb.png)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkneufeld%2Fconsolemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkneufeld%2Fconsolemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkneufeld%2Fconsolemd/lists"}