MDCat
MDCat is like cat
, but it pretty-prints Markdown text.
Wanna support Remilia? Buy me a coffee on Ko-Fi, or support me through Liberapay.
How do I get set up?
You will need Fossil installed to clone this repo and the dependency. You will also need Crystal (since it's written in Crystal) and Shards v0.17.1 or later (usually this comes with Crystal). If you have an earlier version of Shards, you will need to to build the latest version manually.
$ fossil clone https://chiselapp.com/user/MistressRemilia/repository/mdcat/
$ cd mdcat
$ shards build --release -p
You can then use ./bin/mdcat --help
to see usage information.
Configuration File
An optional configuration file can be located in one of these three locations (in order of precedence):
$XDG_CONFIG_HOME/mdcat/mdcat.ini
$HOME/.config/mdcat/mdcat.ini
/etc/mdcat.ini
The configuration file uses a plain INI format. Unknown keys are ignored. Here is a sample configuration file with all the valid keys, as well as the defaults:
[colors]
blockQuote = BrightBlack
thematicBreak = BrightBlack
codeBlockColor = BrightGreen
htmlColor = BrightBlack
linkColor = Cyan
inlineCodeColor = Yellow
h1 = Green
h2 = Magenta
h3 = Cyan
h4 = Red
h5 = Blue
h6 = Default
Current Limitations
These are some known limitations for MDCat:
- Markdown variations, like GitHub Flavored Markdown, are not supported.
- HTML Blocks are not supported (inline HTML is, however).
- No generation of a Table of Contents.
Development
Style info
I use a somewhat non-standard style for my code.
- Keep lines 118 characters or shorter. Obviously sometimes you can't, but please try.
- Please use pascalCase for variable and method names. Use CamelCase for type names. Use UPPER_SNAKE_CASE for constants.
- ALWAYS put parentheses around method parameters, except for these methods:
puts
,pp
,p
,raise
,sleep
,spawn
,loop
, andexit
. - Always the full
do |foo|...end
syntax with blocks, except when it's all on one line, then always use { and }. - The type name for exceptions end with Error. For example, an exception when
running and external program might be called
ExternalProgramError
.
How do I contribute?
- Go to https://chiselapp.com/user/MistressRemilia/repository/mdcat/ and clone the Fossil repository.
- Create a new branch for your feature.
- Push locally to the new branch.
- Create a bundle with Fossil that contains your changes.
- Get in contact with me.
Contributors
- Remilia Scarlet - creator and maintainer
- Homepage: https://remilia.sdf.org/
- Mastodon: @MistressRemilia@social.sdf.org
- Email: zremiliaz@postzeoz.jpz My real address does not contain Z's
Links and Licenses
mdcat is under the GNU Affero General Public License version 3.