ttscoff/mdless

Does not work on Termux

dmotte opened this issue ยท 10 comments

Hi! Thanks for creating this software! I tried to run it in Termux app on Android but it doesn't work... See the attached screenshot.

What i did:

pkg install ruby # successful
gem install mdless # successful
mdless --help

Screenshot_20210318-193513.png

Your OS lacks the tput command, which is what mdless uses for calculating column width of the terminal. It won't run without that.

Thank you!!! ๐Ÿ˜„ so the complete procedure to install mdless on Termux is the following:

apt update
apt install ruby ncurses-utils
gem install mdless

I suggest to add it to the README file of this repo ๐Ÿ˜‰

not fixed still have mdless error on termux!

burzltag E, [2023-08-09T07:53:21.239025 #19220] ERROR -- : No such file or directory - (Errno::ENOENT) /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:972:in exec'
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:972:in block in page' /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:961:in fork'
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:961:in page' /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:1011:in printout'
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/lib/mdless/converter.rb:158:in initialize' /data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/bin/mdless:18:in new'
/data/data/com.termux/files/usr/lib/ruby/gems/3.2.0/gems/mdless-1.0.33/bin/mdless:18:in <top (required)>' /data/data/com.termux/files/usr/bin/mdless:25:in load'
/data/data/com.termux/files/usr/bin/mdless:25:in <main>

please reopen

dmotte commented

@leder11011 FYI if it can be useful to you, as of today I'm using this solution to view markdown files with syntax highlighting in Termux:

nano -\$v README.md

Or you can also use:

vim -R README.md

Of course it's not exactly the same thing, but actually I find myself pretty comfortable with those.

If you want to view a markdown file from a URL instead:

nano -\$v <(curl -sSL https://raw.githubusercontent.com/dmotte/desktainer/main/README.md)

Of course it's just an example

thank you @dmotte !
I am even unable to open markdown file this way:

mdless test.md

what I actually need is piping the markdown output of my program:

ls -l | mdless

For both I get the error.

Do you have an idea for that, too?

dmotte commented

what I actually need is piping the markdown output of my program

@leder11011 Yep, sure. In your ls -l case, the command becomes:

nano -\$v <(ls -l)

Tested and works in Termux.

Please keep in mind that my solution is only a workaround and it's not actually using mdless. If you really want to use mdless, refer to @ttscoff 's answer for the real solution. Thanks @ttscoff for that! :)