axiros / terminal_markdown_viewer

Styled Terminal Markdown Viewer
Other
1.81k stars 106 forks source link

Code blocks not printing properly #66

Closed reynoldscem closed 1 year ago

reynoldscem commented 5 years ago

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.

jsco2t commented 5 years ago

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).

reynoldscem commented 5 years ago

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.

jsco2t commented 5 years ago
      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.

reynoldscem commented 5 years ago

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.

g00nix commented 5 years ago

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

reynoldscem commented 5 years ago

@gun1x Install it from git.

ds17f commented 5 years ago

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.

robertmarkbram commented 5 years ago

@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.

g00nix commented 5 years ago

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.

robertmarkbram commented 5 years ago

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'
thiblahute commented 5 years ago

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

peacememories commented 5 years ago

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

FredHappyface commented 4 years ago

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

WaylonWalker commented 4 years ago

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

jhallard commented 4 years ago

Confirming that building from the repo fixes the issue.

axgkl commented 1 year ago

pushed to pypi. sry.