You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I always use MPE when writing markdonws in VSCode. Thank you for your great tools.
The problem is that when using Pipenv, the matplotlib option in code-chunk is ignored.
Pipenv is one of the most popular virtualenvs tools in Python.
We run Python code in the vertualenv like pipenv run python $input_file.
So the code-chunk format is python {cmd="pipenv" args=["run", "python", "-u", "$input_file"] matplotlib}.
However, the option matplotlib is ignored.
After reading this repository codes, I found that the matplotlib option is valid only when the cmd = "python".
The easiest solution is to change the conditions for detemining matplotlib preview as follows:
// before https://github.com/shd101wyy/crossnote/blob/402d89ee329d1c281e8b39905bef0a101c67a755/src/render-enhancers/fenced-code-chunks.ts#L244elseif(cmd.match(/python/)&&(normalizedAttributes["matplotlib"]||normalizedAttributes["mpl"])){outputFormat="markdown";}// afterelseif((cmd.match(/python/)||cmd.match(/pipenv/))&&(normalizedAttributes["matplotlib"]||normalizedAttributes["mpl"])){outputFormat="markdown";}
The change I proposed above is not ideal solution, because additional condition change will be required in order to support other virtualenv tools.
Another idea is to remove cmd.match(/python/) condition.
In typical cases, matplotlib option will be used by only Python users and I don't think the condition is neccesarry.
Additional context
Before v0.7, I modified the js local code directly and used it.
However in recent update JavaScript code is minified, which made me submit this issue lol
The text was updated successfully, but these errors were encountered:
Hello, I always use MPE when writing markdonws in VSCode. Thank you for your great tools.
The problem is that when using Pipenv, the matplotlib option in code-chunk is ignored.
Pipenv is one of the most popular virtualenvs tools in Python.
We run Python code in the vertualenv like
pipenv run python $input_file
.So the code-chunk format is
python {cmd="pipenv" args=["run", "python", "-u", "$input_file"] matplotlib}
.However, the option matplotlib is ignored.
After reading this repository codes, I found that the matplotlib option is valid only when the
cmd = "python"
.The easiest solution is to change the conditions for detemining matplotlib preview as follows:
The change I proposed above is not ideal solution, because additional condition change will be required in order to support other virtualenv tools.
Another idea is to remove
cmd.match(/python/)
condition.In typical cases, matplotlib option will be used by only Python users and I don't think the condition is neccesarry.
Additional context
Before v0.7, I modified the js local code directly and used it.
However in recent update JavaScript code is minified, which made me submit this issue lol
The text was updated successfully, but these errors were encountered: