terminal_markdown_viewer icon indicating copy to clipboard operation
terminal_markdown_viewer copied to clipboard

Code blocks not printing properly

Open reynoldscem opened this issue 6 years ago • 15 comments

For some reason code blocks have stopped working for me and I can't for the life of me figure out why. Instead of a code block I now see a single opening chevron on it's own line (<).

Using mdv 1.7.4 with python 3.7 on ubuntu 16.04.5.

reynoldscem avatar Nov 06 '18 11:11 reynoldscem

I tested multiple versions back - and the bug seems to be present in all of them. Maybe it's due a python change (pure speculation).

jsco2t avatar Nov 12 '18 20:11 jsco2t

Funnily enough I installed from the repos head and the bug went away... I am not sure what is causing it to manifest at all. I guess I, and/or someone else should do some digging.

reynoldscem avatar Nov 12 '18 23:11 reynoldscem

      Funnily enough I installed from the repos head and the bug went away... I am not sure what is causing it to manifest at all. I guess I, and/or someone else should do some digging.

I can confirm the same for me.

jsco2t avatar Nov 16 '18 03:11 jsco2t

It appears it was fixed in 80f333ba51dc2f1dfa854e203d3374a112aecbd3. According to the tags I could see from git show-ref --tags there hasn't been a release since release v1.6.3 e600ba67b9ca69b68f5146d3eb42c60c8d9b231b.

The history page on pypi disagrees and claims there have been releases up to September 19th of this year (version 1.7.4), but these are not tagged. Anyhow, as 80f333ba51dc2f1dfa854e203d3374a112aecbd3 is from October 30th it is not part of the current pypi release.

I guess the answer to resolve this then is to just push a new version.

reynoldscem avatar Nov 16 '18 12:11 reynoldscem

I installed this from pip on Archlinux. Got the latest version, but I have the same problems. instead of code blocks, I see a <.

g00nix avatar Nov 17 '18 14:11 g00nix

@gun1x Install it from git.

reynoldscem avatar Nov 23 '18 11:11 reynoldscem

Can I do anything to help get a new package pushed? I'd love to use this for a project by my leads are saying that we've got to try something else because of this issue. Because of "reasons" I can't install it from git.

ds17f avatar Jan 08 '19 19:01 ds17f

@reynoldscem How do I install it from git? I tried downloading master and copying over the contents of C:\cygwin64\lib\python3.6\site-packages\mdv and now I don't see anything for code blocks at all.. just blank lines.

robertmarkbram avatar Mar 13 '19 08:03 robertmarkbram

I solved this by running mdv with docker. Just add this to your .bashrc or .zshrc:

function mdv() {
  docker run --rm -v $PWD:/sandbox -w /sandbox -it rawkode/mdv:latest $@
}

This works very well since the dependencies are in the container, and will also work on every distribution.

g00nix avatar Mar 13 '19 10:03 g00nix

I installed docker and am using it with Cygwin. I created my mdvDocker script as below. Had to add winpty (https://github.com/zeit/hyper/issues/2888)

#!/bin/bash
winpty docker run --rm -v $PWD:/sandbox -w /sandbox -it rawkode/mdv:latest $@

No matter what file path I give it, docker cannot find it..

$ mdvDocker.sh README.md
Traceback (most recent call last):
  File "/usr/local/bin/mdv", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python2.7/site-packages/mdv/markdownviewer.py", line 1351, in run
    print(str(run_args(args)))
  File "/usr/local/lib/python2.7/site-packages/mdv/markdownviewer.py", line 1309, in run_args
    tab_length    = args.get('-b', 4))
  File "/usr/local/lib/python2.7/site-packages/mdv/markdownviewer.py", line 997, in main
    with open(filename) as f:
IOError: [Errno 2] No such file or directory: 'README.md'

robertmarkbram avatar Mar 13 '19 12:03 robertmarkbram

Any way we get a release for that one? It is a deal breaker to me.

thiblahute avatar Apr 06 '19 14:04 thiblahute

I would really love to see this working again too. Running on macOS, with the --head version from homebrew, and I'm also facing this issue

peacememories avatar Jun 06 '19 13:06 peacememories

This is still an issue. This is a very useful tool so it'd be great to see this updated on pypi.org

FredHappyface avatar Jan 20 '20 14:01 FredHappyface

pip installing from the repo worked for me too. I agree that it would be great to get this on pypi.

WaylonWalker avatar Mar 06 '20 15:03 WaylonWalker

Confirming that building from the repo fixes the issue.

jhallard avatar Jun 07 '20 09:06 jhallard

pushed to pypi. sry.

axgkl avatar Oct 02 '23 21:10 axgkl