Giter Site home page Giter Site logo

mdless's Introduction

mdless

mdless is a utility that provides a formatted and highlighted view of Markdown files in Terminal.

I often use iTerm2 in visor mode, so qlmanage -p is annoying. I still wanted a way to view Markdown files quickly and without cruft.

![mdless screenshot](screenshots/mdless.png)

Features

  • Built in pager functionality with pipe capability, less replacement for Markdown files
  • Format tables
  • Colorize Markdown syntax for most elements
  • Normalize spacing and link formatting
  • Display footnotes after each paragraph
  • Inline image display (local, optionally remote) (with compatible tools like imgcat or chafa)
  • Syntax highlighting of code blocks when Pygments is installed
  • List headlines in document
    • Display single section of the document based on headlines
  • Configurable Markdown options
  • Customizable colors
  • Add iTerm marks for h1-3 navigation when pager is disabled
  • TaskPaper syntax detection and highlighting

Installation

Gem install

gem install mdless

If you run into errors, try gem install --user-install mdless, or sudo gem install mdless (in that order).

Homebrew

mdless is also available via Homebrew (directly).

brew install mdless

Dependencies

To render images, you need imgcat or chafa installed (brew install chafa).

For syntax highlighting, the pygmentize command must be available, part of the Pygments package (brew install pygments).

Usage

mdless [options] path or cat [path] | mdless

The pager used is determined by system configuration in this order of preference:

  • $PAGER
  • less
  • more
  • cat
  • pager

Options

-c, --[no-]color                 Colorize output (default on)
-d, --debug LEVEL                Level of debug messages to output (1-4, 4 to see all messages)
-h, --help                       Display this screen
-i, --images=TYPE                Include [local|remote (both)|none] images in output (requires chafa or imgcat, default none).
-I, --all-images                 Include local and remote images in output (requires imgcat or chafa)
-l, --list                       List headers in document and exit
-p, --[no-]pager                 Formatted output to pager (default on)
-P                               Disable pager (same as --no-pager)
-s, --section=NUMBER[,NUMBER]    Output only a headline-based section of the input (numeric from --list)
-t, --theme=THEME_NAME           Specify an alternate color theme to load
-@, --at_tags                    Highlight @tags and values in the document
-v, --version                    Display version number
-w, --width=COLUMNS              Column width to format for (default: terminal width)
    --[no-]autolink              Convert bare URLs and emails to <links>
    --[no-]inline_footnotes      Display footnotes immediately after the paragraph that references them
    --[no-]intra-emphasis        Parse emphasis inside of words (e.g. Mark_down_)
    --[no-]lax-spacing           Allow lax spacing
    --links=FORMAT               Link style ([inline, reference, paragraph], default inline,
            "paragraph" will position reference links after each paragraph)
    --[no-]linebreaks            Preserve line breaks
    --[no-]syntax                Syntax highlight code blocks
    --taskpaper=OPTION           Highlight TaskPaper format (true|false|auto)
    --update_config              Update the configuration file with new keys and current command line options
    --[no-]wiki-links            Highlight [[wiki links]]

Configuration

The first time mdless is run, a config file will be written to ~/.config/mdless/config.yml, based on the command line options used on the first run. Update that file to make any options permanent (config options will always be overridden by command line flags).

---
:at_tags: true
:autolink: true
:color: true
:inline_footnotes: true
:intra_emphasis: false
:lax_spacing: true
:links: :paragraph
:local_images: true
:pager: true
:preserve_linebreaks: false
:remote_images: false
:syntax_higlight: true
:taskpaper: :auto
:theme: default
:width: 120
:wiki_links: true
  • The :at_tags setting determines whether @tags will be highlighted. If this is enabled, colors will be pulled from the at_tags settings in the theme.
  • :autolink will determine whether bare urls are turned into <self-linking> urls.
  • :color will enable or disable all coloring.
  • :inline_footnotes will determine the placement of footnotes. If true, footnotes will be added directly after the element that refers to them.
  • :intra_emphasis will determine whether words containing underscores are rendered as italics or not.
  • :lax_spacing determines whether a blank line is required around HTML elements.
  • :links can be inline, reference, or paragraph. Paragraph puts reference links directly after the graf that refers to them.
  • :local_images determines whether local images are processed using chafa or imgcat (whichever is available). :remote_images does the same for images referenced with web urls. If :remote_images is true, then :local_images is automatically enabled.
  • :pager turns on or off pagination using less or closest available substitute.
  • :preserve_linebreaks determines whether hard breaks within paragraphs are preserved. When converting to HTML, most Markdown processors will cause consecutive lines to be merged together, which is the default behavior for mdless. Turning this option on will cause lines to remain hard wrapped.
  • :syntax_highlight will turn on/off syntax highlighting of code blocks (requires Pygments)
  • :taskpaper determines whether a file is rendered as a TaskPaper document. This can be set to :auto to have TaskPaper detected from extension or content.
  • :theme allows you to specify an alternate theme. See Customization below.
  • :width allows you to permanantly set a width for wrapping of lines. If the width specified is greater than the available columns of the display, the display columns will be used instead.
  • :wiki_links determines whether [[wiki links]] will be highlighted. If highlighted, colors are pulled from the link section of the theme.

Customization

On first run a default theme file will be placed in ~/.config/mdless/mdless.theme. You can edit this file to modify the colors mdless uses when highlighting your files. You can copy this file and create multiple theme options which can be specified with the -t NAME option. For example, create ~/.config/mdless/brett.theme and then call mdless -t brett filename.md.

Colors are limited to basic ANSI codes, with support for bold, underline, italics (if available for the terminal/font), dark and bright, and foreground and background colors.

Customizeable settings are stored in YAML format. A chunk of the settings file looks like this:

h1:
  color: b intense_black on_white
  pad: d black on_white
  pad_char: "="

Font and color settings are set using a string of color names and modifiers. A typical string looks like b red on_white, which would give you a bold red font on a white background. In the YAML settings file there's no need for quotes, just put the string following the colon for the setting.

You can also use 3 or 6-digit hex codes in place of color names. These can be prefixed with bg or on_ to affect background colors, e.g. bgFF0ACC. The codes are case-insensitive and can be combined with emphasis modifiers like b or u.

Some extra (non-color) settings are available for certain keys, e.g. pad_char to define the right padding character used on level 1 and 2 headlines. Note that you can change the Pygments theme used for syntax highlighting with the code_block.pygments_theme setting. For a list of available styles (assuming you have Pygments installed), use pygmentize -L styles.

The display of characters around emphasis and code spans can be configured. By default, the surrounding character for bold is **, italic is _, and code span is a backtick. You can leave these keys empty to not display characters at all. For triple-emphasized text, the text will be surrounded by italic and bold characters, in that order.

emphasis:
  bold: b
  bold_character: "**"
  italic: u i
  italic_character: ""
  bold-italic: b u i
code_span:
  marker: b white
  color: b white on_intense_black
  character: ""

Note: the ANSI escape codes are reset every time the color changes, so, for example, if you have a key that defines underlines for the url in a link, the underline will automatically be removed when it gets to a bracket. This also means that if you define a background color, you'll need to define it again on all the keys that it should affect.

Base colors:

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white

Emphasis:

  • b (bold)
  • d (dark)
  • i (italic)
  • u (underline)
  • r (reverse, negative)

To modify the emphasis, use 'b' (bold), 'i' (italic), 'u' (underline), e.g. u yellow for underlined yellow. These can be combined, e.g. b u red.

Use 'r' to reverse foreground and background colors. r white on_black would display as black on_white. 'r' alone will reverse the current color set for a line.

To set a background color, use on_[color] with one of the 8 colors. This can be used with foreground colors in the same setting, e.g. white on_black.

Use 'd' (dark) to indicate the darker version of a foreground color. On macOS (and possibly other systems) you can use the brighter version of a color by prefixing with "intense", e.g. intense_red or on_intense_black.

Integrations

Ranger

Ranger is a file manager that allows for quick navigation in the file hierarchy. A preview can be displayed for various file types. See docs at https://github.com/ranger/ranger/wiki.

mdless can be used in Ranger to preview Markdown and Taskpaper.

Ranger is installed with brew install ranger.

With ranger --copy-config=scope the configuration file for previews scope.sh is created in the directory ~/.config/ranger.

The configuration file is already preconfigured. The following can be inserted above html to use mdless.

## Markdown
md|taskpaper)
mdless --taskpaper=auto -@ "${FILE_PATH}" && exit 5
;;

Thanks to Ralf Hülsmann for contributing!

Gather

Gather is a tool for converting web pages to Markdown. You can use it with mdless to create a Lynx-style web browser:

$ gather https://brettterpstra.com/projects/gather-cli/ | mdless

fzf

fzf is a tool for selecting files and other menu options with typeahead fuzzy matching. You can set up mdless as a previewer when selecting Markdown or TaskPaper files.

$ ls *.md | fzf --preview 'mdless {}'

Fish

You can replace the cat command in Fish by creating the following functions in ~/.config/fish/functions

get_ext.fish

function get_ext -d 'Get the file extension from the argument'
    set -l splits (string split "." $argv)
    echo $splits[-1]
end

cat.fish

function cat -d "Use bat instead of cat unless it's a Markdown file, then use mdless"
    set -l exts md markdown txt taskpaper

    if not test -f $argv[-1]
        echo "File not found: $argv[-1]"
        return 0
    end

    if contains (get_ext $argv[-1]) $exts
        mdless $argv
    else
        command bat --style plain --theme OneHalfDark $argv
    end
end

Note that if you do this, and you need uncolored output to pipe somewhere, you'll need to use command cat FILE to revert to the built-in cat. Otherwise your text will be full of the escape codes that mdless uses to colorize the output.

Similar Projects

There are a few great options for Markdown viewing in the Terminal. If mdless doesn't do it for you, check out:

mdless's People

Contributors

adrian-gierakowski avatar cumminsc9 avatar dependabot[bot] avatar eliten00b avatar joast avatar rfdonnelly avatar ttscoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mdless's Issues

mdless prints a list of pagers after quitting

After I hit q to exit out of mdless , I see a list of pagers. Do I need to configure something to make this go away?

$ mdless CHANGELOG.md
/usr/bin/less
/usr/bin/less
/bin/more
/bin/cat
/usr/bin/pager
$

Here's my version:

$ mdless --version
mdless 0.0.9

Headlines with parentheses, question marks not parsed as headlines

Headlines that contain certain characters (which look like they could be regex metacharacters) do not get parsed as headlines. I haven't done an exhaustive search, but I've noticed that parentheses and question marks are among the characters that cause this.

I'm using version 1.0.9 freshly installed with gem install on macOS Mojave (10.14), with the built-in Ruby 2.3.7something.

Given this input, I expect all three headlines to be parsed correctly:

mdless <(echo "# A header (with parentheses)

Words.

## a subheader - with a question mark?

Words, words.

## a subheader with no funny stuff

Words, words, words.")

…but only the third headline "a subheader with no funny stuff" actually is. The output looks like this:

test_with_funny_chars_thumb

If you remove the offending characters (parentheses and question marks in this example), you get the expected output:

test_no_funny_chars_thumb

I'm no whiz at the git bisecting, but I'm pretty sure this behavior didn't exist a year or so ago, when I was using mdless to run terminal-based "slideshows" for a workshop.

Light color scheme

Currently the colored output is very hard to read on a light background.
It would be nice to have support for at least two color schemes.
Perhaps store pererences in a config file (~/.mdlessrc)?

headers broken after newline and EOF

Given two commands, the first ending in newline and the second with more text; only the the second will print a header.

$ echo '#h1
' | ./mdless -P ; echo '#h1
hello' | ./mdless -P

gives (extra blank lines removed):

#h1 

h1 ======================================================================================================================
hello

I do not know if this intentional but in my mind markdown tags stand alone without context. And Github seems to agree with me (see very last line showing same idea).

In any case when this line https://github.com/ttscoff/mdless/blob/develop/lib/mdless/converter.rb#L190:

headers = input.scan(/^((?!#!)(\#{1,6})\s*([^#]+?)(?: #+)?\s*|(\S.+)\n([=-]+))$/i)

is changed to:

headers = input.scan(/^((?!#!)(\#{1,6})\s*([^#]+?)(?: #+)?[ \t]*|(\S.+)\n([=-]+))$/i)

(last \s changed to [ ^t]) fixes my test case.

Although I dont know if that causes any other repercussions.

Github rendering of # test\nEOF:

test

Emphasis not recognized when preceded by punctuation

Fails to recognize emphasis when preceded by punctuation such as an opening quotation mark or parenthesis. Other implementations such as GitHub recognize this properly.

Test cases: Some of these work in mdless 0.0.10, some don't

*blah**“blah”*
*blah “blah”*
*“blah” blah*
(*“blah”*)
(*“blah”* blah)
(blah *“blah”*)
(“*blah*”)
(“*blah*” blah)
(blah “*blah*”)
"*blah*"
*"blah"*
*blah "blah"*
*"blah" blah*
(*"blah"*)
(*"blah"* blah)
(blah *"blah"*)
("*blah*")
("*blah*" blah)
(blah "*blah*")
“**blah****“blah”**
**blah “blah”**
**“blah” blah**
(**“blah”**)
(**“blah”** blah)
(blah **“blah”**)
(“**blah**”)
(“**blah**” blah)
(blah “**blah**”)
"**blah**"
**"blah"**
**blah "blah"**
**"blah" blah**
(**"blah"**)
(**"blah"** blah)
(blah **"blah"**)
("**blah**")
("**blah**" blah)
(blah "**blah**")
“_blah__“blah”_
_blah “blah”_
_“blah” blah_
(_“blah”_)
(_“blah”_ blah)
(blah _“blah”_)
(“_blah_”)
(“_blah_” blah)
(blah “_blah_”)
"_blah_"
_"blah"_
_blah "blah"_
_"blah" blah_
(_"blah"_)
(_"blah"_ blah)
(blah _"blah"_)
("_blah_")
("_blah_" blah)
(blah "_blah_")
“__blah____“blah”__
__blah “blah”__
__“blah” blah__
(__“blah”__)
(__“blah”__ blah)
(blah __“blah”__)
(“__blah__”)
(“__blah__” blah)
(blah “__blah__”)
"__blah__"
__"blah"__
__blah "blah"__
__"blah" blah__
(__"blah"__)
(__"blah"__ blah)
(blah __"blah"__)
("__blah__")
("__blah__" blah)
(blah "__blah__")

Issue when resizing terminal window smaller after initial load

I seem to have an issue if I resize the terminal window smaller than it was on initial load. Using iTerm2 3.0.2. Possibly related to #3?

/Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:417:in `*': negative argument (ArgumentError)
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:417:in `block (2 levels) in convert_markdown'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:413:in `map'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:413:in `block in convert_markdown'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:393:in `gsub!'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:393:in `convert_markdown'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:117:in `block in initialize'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:105:in `each'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:105:in `initialize'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/bin/mdless:17:in `new'
    from /Users/domster83/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mdless-0.0.9/bin/mdless:17:in `<top (required)>'
    from /Users/domster83/.rbenv/versions/2.3.1/bin/mdless:22:in `load'
    from /Users/domster83/.rbenv/versions/2.3.1/bin/mdless:22:in `<main>'

Remove dependency on git

If git is not installed on a system but you try to run mdless, you get the following error:

$ mdless README.md 
Traceback (most recent call last):
	10: from /usr/local/bin/mdless:23:in `<main>'
	 9: from /usr/local/bin/mdless:23:in `load'
	 8: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/bin/mdless:17:in `<top (required)>'
	 7: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/bin/mdless:17:in `new'
	 6: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:121:in `initialize'
	 5: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:737:in `printout'
	 4: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:692:in `page'
	 3: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:692:in `fork'
	 2: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:700:in `block in page'
	 1: from /var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:745:in `which_pager'
/var/lib/gems/2.5.0/gems/mdless-0.0.10/lib/mdless/converter.rb:745:in ``': No such file or directory - git (Errno::ENOENT)

I suspect this is because you're checking the git config for a pager, but ideally the program would skip this step if it can't find git, rather than crashing. The reason this matters is when you're in a minimal environment, e.g. a VPS or a docker container, where you need to quickly view a markdown file but you don't want to have to install git.

mdless adds blank lines before and after content

Hello,

Thanks for a great tool! Very useful.

Why are there blank lines inserted in mdless output before and after the main content?

For example:

[root@localhost source]# cat /tmp/example.md
# header

text
[root@localhost source]# mdless /tmp/example.md

header ============================================================================================================================================================================================================

text




[root@localhost source]#

Put another way:

[root@localhost source]# wc -l /tmp/example.md
3 /tmp/example.md
[root@localhost source]# mdless /tmp/example.md | wc -l
8
[root@localhost source]#

The extra blank lines at the bottom are causing content to scroll off my screen.

support for opening file in editor using ```v``` key

Not sure if a bug or a non implemented feature.

When using less you can open the file in the default text editor by pressing the v button. and on exit of the text editing it returns to less.

It would be great to add this to mdless for quick editing of files.

Currently I am getting the error message Cannot edit standard input (press RETURN)
image

When pressing the v key.

hiliteCode undefined method split

just installed and tried mdless
and got

/Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:324:in `hiliteCode': undefined method `split' for nil:NilClass (NoMethodError)
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:457:in `block in convert_markdown'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:437:in `gsub!'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:437:in `convert_markdown'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:118:in `block in initialize'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:106:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/lib/mdless/converter.rb:106:in `initialize'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/bin/mdless:17:in `new'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-0.0.12/bin/mdless:17:in `<top (required)>'
	from /usr/local/bin/mdless:22:in `load'
	from /usr/local/bin/mdless:22:in `<main>'

any clue how to fix it?

Images in text using chafa

Not a bug, more a feature request or an idea. There is the excellent image rendering program called 'chafa' that converts images to text representations. It works pretty well for me in the default settings. This could be used if installed to render images more terminal independent (albeit at worse quality) than the iterm option does.

Indenting of heading list does not account for length of index

# a
## b
## c
## d
## e
# f
## g
## h
## i
## j
## k
## l

Running mdless -lP headings.md gives.


1: a
2: ..- b
3: ..- c
4: ..- d
5: ..- e
6: f
7: ..- g
8: ..- h
9: ..- i
10: ..- j
11: ..- k
12: ..- l

note how j, k, and l are all shifted over an extra space. With the ..s hidden when on a colour terminal, it can appear at first glance that there is an additional level in the heirarchy.

Invalid option -i

/Library/Ruby/Gems/2.0.0/gems/mdless-0.0.8/lib/mdless/converter.rb:97:in `initialize': invalid option: -i (OptionParser::InvalidOption)
from /Library/Ruby/Gems/2.0.0/gems/mdless-0.0.8/bin/mdless:17:in `new'
from /Library/Ruby/Gems/2.0.0/gems/mdless-0.0.8/bin/mdless:17:in `<top (required)>'
from /usr/local/bin/mdless:23:in `load'
from /usr/local/bin/mdless:23:in `<main>'

mdless -v gives mdless 0.0.8 by Brett Terpstra

Using iterm2 Build 2.9.20160102

[EXPIRED] Windows binary

Dear Brett,
Could you be so kind to generate .exe for the rest of us who are mere Windows users w/o Ruby?

Different emphasis delimiters

Currently, emphasis is started and ended with either '*' or '_', but the same character should be needed.

Input:
*foo_bar*

Expected result:
<em>foo_bar</em>

Actual result:
<em>foo</em>bar*

From v0.28 of the CommonMark Spec:

  1. Emphasis begins with a delimiter that can open emphasis and ends with a delimiter that can close emphasis, and that uses the same character (_ or *) as the opening delimiter.

Table not getting printed

Current Behavior

$ mdless << 'EOT'

   - Use git stash when you want to record the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
   - Calling `git stash` without any arguments is equivalent to `git stash push`.
   - The modifications stashed away by this command can be listed with `git stash list`, inspected with `git stash show`, and restored (potentially on top of a different commit) with `git stash pop`
   - The latest stash you created is stored in `refs/stash`; older stashes are found in the reflog of this reference and can be named using the usual reflog syntax (e.g. `stash@{0}` is the most recently created stash, `stash@{1}` is the one before it, `stash@{2.hours.ago}` is also possible). Stashes may also be referenced by specifying just the stash index (e.g. the integer `n` is equivalent to `stash@{n}`).
 
   Table: Command
 
   Command                 |  Purpose
   ------------------------|--------------------
   -s or --save            | stash all including untracked and ignored files
   ------------------------|--------------------
   -l or --list            | list all stashes
   ------------------------|--------------------
   -r or --restore         | restore stash "${2:-0}" (Default the last stash, i.e. 0)
   ------------------------|--------------------
 
EOT



    - Use git stash when you want to record the current state of the working directory and the index, but want to
go back to a clean working directory. The command saves your local modifications away and reverts the working
directory to match the HEAD commit.
    - Calling `git stash` without any arguments is equivalent to `git stash push`.
    - The modifications stashed away by this command can be listed with `git stash list`, inspected with `git
stash show`, and restored (potentially on top of a different commit) with `git stash pop`
    - The latest stash you created is stored in `refs/stash`; older stashes are found in the reflog of this
reference and can be named using the usual reflog syntax (e.g. `stash@{0}` is the most recently created stash,
`stash@{1}` is the one before it, `stash@{2.hours.ago}` is also possible). Stashes may also be referenced by
specifying just the stash index (e.g. the integer `n` is equivalent to `stash@{n}`).

    Table: Command

Expected behavior

Table should have got printed

Fenced code blocks render as empty

When viewing a file with mdless, code blocks render without any text in them:

$ cat foo.md
```python
def foo(bar):
    print("yay!")
```

$ mdless foo.md
--[ python ]-------------------------------
-------------------------------------------

macOS version: 10.14
Ruby version: 2.5.1
iTerm2 version: 3.3.6
What didn't work: Everything seems in order except the fenced code blocks for me, with/without pygments installed.
What I tried: Installing pygments, trying a few files with different programming languages represented, removing ~/.config/mdless/mdless.theme
Am I using a custom theme: nope

$ cat ~/.config/mdless/mdless.theme
--- default

$

Greater than & space in front of code block content & line break symbol at the end of line

OS: Fedora 32

When reading files with code blocks I can't copy the content because of the extra greater than & space in front of code block content & line break symbol at the end. Is there a way to disable this? if not, please add this feature.

--[ code ]----------------------------------------------------------------------------------------------------------------------------
> some commad¬                                                                                                     
> some other commad¬                                                                                                     
--------------------------------------------------------------------------------------------------------------------------------------

Problem with converting on Pop!_OS 20.04 LTS

System: Pop!_OS 20.04 LTS
I try to test "mmdless" and during installation saw:

Successfully installed mdless-1.0.14
invalid options: -ri
(invalid options are ignored)
Parsing documentation for mdless-1.0.14
Installing ri documentation for mdless-1.0.14
Done installing documentation for mdless after 0 seconds
1 gem installed

(before I had to install ruby)

But than:

$ mdless Vim.md 

^CTraceback (most recent call last):
	8: from /usr/local/bin/mdless:23:in `<main>'
	7: from /usr/local/bin/mdless:23:in `load'
	6: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/bin/mdless:17:in `<top (required)>'
	5: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/bin/mdless:17:in `new'
	4: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/lib/mdless/converter.rb:121:in `initialize'
	3: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/lib/mdless/converter.rb:121:in `each'
	2: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/lib/mdless/converter.rb:134:in `block in initialize'
	1: from /var/lib/gems/2.7.0/gems/mdless-1.0.14/lib/mdless/converter.rb:578:in `convert_markdown'
/var/lib/gems/2.7.0/gems/mdless-1.0.14/lib/mdless/converter.rb:578:in `gsub!': Interrupt

What do i wrong ?

macOS 10.15.3 - failing with "syntax error, unexpected $end, expecting ')'"

Fresh install on macOS 10.15.3. Any attempt to run, including mdless -h fails with:

`%mdless -h

/opt/local/lib/ruby/gems/1.8/gems/mdless-1.0.10/lib/mdless/converter.rb:254: warning: don't put space before argument parentheses
/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': /opt/local/lib/ruby/gems/1.8/gems/mdless-1.0.10/lib/mdless/converter.rb:254: unknown type of %string (SyntaxError) ...h ('%3d: %s' % [idx + 1, c(%i[x black])+"."*level+c(%i[x yel... ^ /opt/local/lib/ruby/gems/1.8/gems/mdless-1.0.10/lib/mdless/converter.rb:254: syntax error, unexpected $end, expecting ')' ...h ('%3d: %s' % [idx + 1, c(%i[x black])+"."*level+c(%i[x yel... ^ from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in require'
from /opt/local/lib/ruby/gems/1.8/gems/mdless-1.0.10/lib/mdless.rb:11
from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in require'
from /opt/local/lib/ruby/gems/1.8/gems/mdless-1.0.10/bin/mdless:3
from /opt/local/bin/mdless:19:in load' from /opt/local/bin/mdless:19

No license specified

Hi, would you please consider adding an open source LICENSE file to this project? I am interested in using it, but I am restricted from doing so without an explicit license specified by the project. Thank you!

Rendering issue

This is a super neat tool! Just what I needed!

I have a weird rendering issue though, and would appreciate any pointers to fix it. Code text appears outlined which makes it very difficult to read.

I am using Hyper 3 on macOS Mojave with zsh and Menlo as the font.

Screen Shot 2019-11-12 at 10 23 10 AM

Thanks!

Can't change colour of text under headers

Consider the following markdown:

Before heading - this text looks fine on a white background.

# Heading 1

Here is some text - looks too pale on a white background

## Heading 2

Here is some more text - also looks too pale on a white background

Here is how it displays in Terminator on Ubuntu 18.04:

mdless

I would like to make the text under the headings darker, but cannot figure out which setting I need to change to do this. What HTML element do they correspond to?

Thanks.

Enumeration doesn't work

The numbers in an enumerated environment are not set correctly:

  1. Item1
  2. Item2
  3. Item3

should give

  1. Item1
  2. Item2
  3. Item3

but mdless shows

  1. Item1
  2. Item2
  3. Item3

tab separated output is ignored

Hello ttscoff,

I know of markdown tables, but is it wanted that tab separated output with ´less´ is converted to a single whitespace with ´mdless´?

Cheers
Gerrit

Standard Theme Presets

It will be great to have standard theme presents for popular colour schemes like Solarized Dark, Solarized Light.

It will be good to have this as a part of the repositories so that it will be easier for users to switch to standard themes.

Setext-style headers unsupported

Setext-style headers are not displayed like ATX-style ones. They also seem to break parsing or output… in my case the last paragraph is sent to stdout, not to the pager.

nagative aurument in converter.rb:417

jinyuj-m01:cloudml-dist-mnist-example jinyuj$ mdless /Users/jinyuj/Workspace/tensorflow/cloudml-dist-mnist-example/README.md
/Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:417:in *': negative argument (ArgumentError) from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:417:in block (2 levels) in convert_markdown'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:413:in map' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:413:in block in convert_markdown'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:393:in gsub!' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:393:in convert_markdown'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:117:in block in initialize' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:105:in each'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/lib/mdless/converter.rb:105:in initialize' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/bin/mdless:17:in new'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/gems/mdless-0.0.9/bin/mdless:17:in <top (required)>' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/bin/mdless:23:in load'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/bin/mdless:23:in <main>' from /Users/jinyuj/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval'
from /Users/jinyuj/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `

'

So, the problem is that in line 417, the code use a nagative number * a string, commonly, "ha"*3 means we will get "hahaha" as the result. But if the number is a nagetive number, there will be an error of it. The problem is that in line 417, the (@cols - orig_length) get an nagetive number when I am using this. please help to figure this out : )
README.md.txt

New release

Hi! I'm about to use this tool (thanks!) but I noticed there haven't been releases since Jan 2018, whereas there seem to be a few juicy PRs. Would you mind cutting another release? 🙂

`mdless` not properly showing code blocks

Hi!

I've just installed mdless and I've noticed there seem to be some issues with the way that code blocks are shown. I have Pygments installed, and (apparently; not very familiar with it) working:

test$ pygmentize -V
Pygments version 2.0.2, (c) 2006-2014 by Georg Brandl.

I've created a test file but due to GitHub's funky Issues app not allowing attachments, I've posted it as a gist (https://gist.github.com/jjarava/9596855f9f1ff9720167).

For reference, this is how the example file looks when viewing it on Marked - notations 1, 2 and 3 work fine

mdless-example-marked-2015-09-07_17-46-08

The same file viewed with mdless within iTerm 3 beta shows several issues:

mdless-example-mdless-iterm3-beta-2015-09-07_18-10-46

Running the same file through pygmentize via cat mdless-sample-test.md | pygmentize shows that the syntax highlighting is working (or at least the script would recognize quite a few of the snippets):

mdless-example-raw-pygmentize-2015-09-07_18-13-45

Any hints or workarounds more than welcome; personally I'm quite partial to the triple backtick notation in my .md files and I've got more than a few code samples scattered in my files...

Regards

Escaped characters not displaying correctly

0.0.10
According to https://dillinger.io/ the following:
\[ \] \*
should show in the following way:
[ ] *
Instead it remains:
\[ \] \*

Example Markdown where error was originally detected:

# Documento para el proyecto1
## Analizador Lexicoo
### Lenguaje C-

Un documento con:
o Las expresiones regulares para detectar todos los tokens.

o El DFA implementado que realiza la detección de tokens.

### Descripcion Tecnica
La implementacion se hizo por estados con una hash table que tiene el estado y el token como llave regresando el sig estado

### Deteccion de errores
Para parsear simplemente se purgara el caracter que ocasiono el error y se imprimira los caracteres que se esperaban en vez de este

### Lexico de C--

Nota: la notacion [abcde..] es equvalente a (a|b|c|d|e).
Se ha escrito de esta forma para facilitar la lectura

Palabras reservadas: else if int return void while
simbolos especiales: + - * / < <= > >= == != = ; , ( ) [ ] { } /* */

ID= letra letra*
NUM= digito digito*
letra = [a-zA-z]
digito = [0-9]

espacios en blanco = n|r|t|s|
comentarios comienzan con G* terminan con *g y no hay andacion

Regex para detectar ID
[0123456789]\[0123456789\]\*
Regex para detectar id
[abcdefghijklomnñopqrstuvwxyz]\[abcdefghijklomnñopqrstuvwxyz\]

Crash on github-compatible markdown

Trying to run mdless on github-compatible markdown, for example the yii2 README crashes almpost instantly:

$ mdless tmp/README.md 
Yii 2 Advanced Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for
developing complex Web applications with multiple tiers.
/usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:421:in `*': negative argument (ArgumentError)
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:421:in `block (2 levels) in convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:417:in `map'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:417:in `block in convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:397:in `gsub!'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:397:in `convert_markdown'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:120:in `block in initialize'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:108:in `each'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/lib/mdless/converter.rb:108:in `initialize'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/bin/mdless:17:in `new'
    from /usr/local/lib64/ruby/gems/1.9.1/gems/mdless-0.0.8/bin/mdless:17:in `<top (required)>'
    from /usr/local/bin/mdless:23:in `load'
    from /usr/local/bin/mdless:23:in `<main>'

EDIT: revelant env is:

COLUMNS=92
LANG=en_US.utf8
LESS='-R -M --shift 5'
LESSOPEN='|lesspipe %s'
LINES=31
PAGER=/usr/bin/less
SHELL=/bin/bash
TERM=rxvt-unicode-256color

Ubuntu 18.04: cannot compile binary

Previous git sources allowed me to generate mdless binary.
Now I only get errors:
Please give me a hint how to compile mdless binary!


leder@leder-ryzen-home:~/Git/mdless$ bundle update
The gemspec at /home/leder/Git/mdless/mdless/mdless.gemspec is not valid. Please fix this gemspec.
The validation error was 'metadata['homepage_uri'] has invalid link: "TODO: Put your gem's website or public
repo URL here."'
leder@leder-ryzen-home:~/Git/mdless$ gem build mdless.gemspec 
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    ["bin/mdless"] are not files
leder@leder-ryzen-home:~/Git/mdless$ gem install mdless
Done installing documentation for  after 0 seconds
leder@leder-ryzen-home:~/Git/mdless$ 

Stalls when trying to display doing files

mdless stalls when attempting to render doing markdown files.

also tried with cat.
script freezes, then upon Ctrl + C I get this message:

  ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/lib/mdless/converter.rb:338:in `sub!': Interrupt
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/lib/mdless/converter.rb:338:in `convert_markdown'
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/lib/mdless/converter.rb:118:in `block in initialize'
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `each'
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/lib/mdless/converter.rb:106:in `initialize'
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/bin/mdless:17:in `new'
  from ~/.rvm/gems/ruby-2.3.1/gems/mdless-0.0.10/bin/mdless:17:in `<top (required)>'
  from ~/.rvm/gems/ruby-2.3.1/bin/mdless:23:in `load'
  from ~/.rvm/gems/ruby-2.3.1/bin/mdless:23:in `<main>'
  from ~/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
  from ~/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

* while trying to render my doing file as an Übersicht widget

mdless 1.0.3 won't load any files: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mdless/hash (LoadError)

I've just updated to the latest version of mdless, v1.0.3, and now I can't load any file, or even call it without any params.

I've updated with:

$ sudo gem update mdless
Updating installed gems
Updating mdless
Fetching: mdless-1.0.3.gem (100%)
Successfully installed mdless-1.0.3
invalid options: -ri
(invalid options are ignored)
Parsing documentation for mdless-1.0.3
Installing ri documentation for mdless-1.0.3
Installing darkfish documentation for mdless-1.0.3
Done installing documentation for mdless after 0 seconds
Parsing documentation for mdless-1.0.3
Done installing documentation for mdless after 0 seconds
Gems updated: mdless

And then trying to invoke mdless for anything (mdless <filename>, or mdless --help or even just mdless) gives the same error:

mdless
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- mdless/hash (LoadError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-1.0.3/lib/mdless.rb:9:in `<top (required)>'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:39:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/mdless-1.0.3/bin/mdless:3:in `<top (required)>'
	from /usr/local/bin/mdless:22:in `load'
	from /usr/local/bin/mdless:22:in `<main>'

¯\_(ツ)_/¯

'bundle exec rake' on a fresh clone gives a backtrace (cannot load 'test-unit')

I'm using the built-in Ruby 2.3.x on macOS 10.14 (Mojave), with only the bundler and mdless gems installed in my user directory.

I just want to run the tests for mdless without installing any gems in my user or system lib directories. What I tried:

git clone https://github.com/ttscoff/mdless.git
bundle install --path vendor/bundle
bundle exec rake

…expecting the test target to run.

What I got instead was a backtrace: `require': cannot load such file -- test/unit
$ bundle exec rake
/Users/myuser/devel/util/mdless/test/test_helper.rb:1:in `require': cannot load such file -- test/unit (LoadError)
	from /Users/myuser/devel/util/mdless/test/test_helper.rb:1:in `'
	from /Users/myuser/devel/util/mdless/test/default_test.rb:1:in `require'
	from /Users/myuser/devel/util/mdless/test/default_test.rb:1:in `'
	from /Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:15:in `require'
	from /Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:15:in `block in '
	from /Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:4:in `select'
	from /Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb:4:in `'
rake aborted!
Command failed with status (1): [ruby -I"lib:test" -I"/Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib" "/Users/myuser/devel/util/mdless/vendor/bundle/ruby/2.3.0/gems/rake-0.9.6/lib/rake/rake_test_loader.rb" "test/default_test.rb" ]
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/exe/bundle:46:in `block in '
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
/Users/myuser/.gem/ruby/2.3.0/gems/bundler-2.1.4/exe/bundle:34:in `'
/Users/myuser/.gem/ruby/2.3.0/bin/bundle:22:in `load'
/Users/myuser/.gem/ruby/2.3.0/bin/bundle:22:in `'
Tasks: TOP => default => test
(See full trace by running task with --trace)

I very obviously have the test-unit gem (3.1.5) available as a part of the OS-default Ruby installation:

$ gem which test-unit
/Library/Ruby/Gems/2.3.0/gems/test-unit-3.1.5/lib/test-unit.rb

It's possible I just don't understand Ruby, bundler, or gems, because I don't know why bundle exec wouldn't just use that one.

Unrecognized character \x1B;

Just installed (with gem install). I tried a couple of files, but I get:

$ cat notes/README.md 
# linux_notes #

Repository of helpful linux notes and cheatsheets, mainly for a terminal environment.
$ mdless --debug 4 notes/README.md 
I, [2019-09-04T12:32:50.061264 #28983]  INFO -- : Processing "notes/README.md"
Unrecognized character \x1B; marked by <-- HERE after <-- HERE near column 1 at - line 3.
cat notes

`mdless` v1.0.2 rendering of headers issues when there's no "H1" header

Hi,

Just testing the new version of mdless (v1.0.2), I've found it has some issues for showing header levels when the files does not a "H1" (single #) line.

If the file has level 2 (##) or level 3 (###) headers, they are shown like normal lines, but with one "hash" less on the line.

So, this text:

Sample text
## Level 2
some text
### Level 3
some more text

is shown like this:

image

I've created another example file that is attached (as a zip) to the issue.

sample-mdless-missing-header.md.zip

Thanks!

Escape codes visible in code block

Hello,

Just started using mdless. Really excited to adopt this tool, I plan to use this to teach a class, my materials are in Markdown format and I can use mdless to render them for the students live.

Small problem -- I am seeing escape codes in the code block:

image

This is with mdless 1.0.15.

pygments has my code language:

[root@ip-172-31-16-17 source]# pygmentize -L | grep cfengine
* cfengine3, cf3:
[root@ip-172-31-16-17 source]#

I am on Windows 10, and the above screenshot is in Windows Terminal. I have the same issue in the Windows console (what I get when I run bash.exe):

image

Is it me? Or is it something in mdless?

Here is my source file (just take out the backslashes), to reproduce:

The promise type is always followed by a single colon.


\```cfengine3
files:

    "/etc/nologin"

        create  => "true",
        comment => "Prevent non-root users from logging in";
\```

If I run mdless with --no-color, the escape codes disappear -- but I want the color. :)

Run on windows

Hello,

dou you provide a windows executable?
This would be very nice to have, since not all windows users have ruby installed.

Kind regards
Andi

mdless not showing code blocks at all

In mdless this :

Vérifier que les sous-modules Git ont bien été clonés :

```
git submodule update --init
```

Would show as

image

I'm using iTerm2 build 3.2.5 with mdless 0.0.12

mdless (1.0.5) exiting with no output on OSX 10.15 (previously worked)

I was using mdless for a few weeks and it's suddenly started exiting with no output. Tried the -d flag but the only output is:

~ > mdless -d test.md
Error: Log level out of range (1-4)

Any idea what might be going on? Would love to track down the error and get back to using it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.