tillahoffmann / obsidian-jupyter

MIT License
439 stars 23 forks source link

Path of Jupyter output is incorrectly defined. #45

Closed fellowish closed 2 years ago

fellowish commented 2 years ago

When using code snippets, output functions as normal unless the output is a media file. If the output is a media file, then the path to the media file is incorrectly defined and is not displayed.

Issue

Console output

Incorrect video path

The path shown above is incorrect and doesn't display the media file.

Correct video path

The path shown above is correct and displays the media file.

Console output

created new client for doc test-document using interpreter C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python310\python.exe
plugin:obsidian-jupyter:3115 INFO:obsidian-jupyter:started server for document test-document

plugin:obsidian-jupyter:3115 INFO:obsidian-jupyter:received request: {"id":"d22f8052-c8ac-4869-9503-ef5c57e66192","body":{"command":"execute","source":"1 + 1"}}

plugin:obsidian-jupyter:3115 C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python310\lib\site-packages\zmq\_future.py:679: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
  self._get_loop()

plugin:obsidian-jupyter:3115 INFO:traitlets:Executing notebook with kernel: 

plugin:obsidian-jupyter:3115 INFO:obsidian-jupyter:sent response: {"id": "d22f8052-c8ac-4869-9503-ef5c57e66192", "body": "<div class=\"cell border-box-sizing code_cell rendered\">\n<div class=\"input\">\n<div class=\"prompt input_prompt\">In&nbsp;[1]:</div>\n<div class=\"inner_cell\">\n    <div class=\"input_area\">\n<div class=\" highlight hl-ipython3\"><pre><span></span><span class=\"mi\">1</span> <span class=\"o\">+</span> <span class=\"mi\">1</span>\n</pre></div>\n\n    </div>\n</div>\n</div>\n\n<div class=\"output_wrapper\">\n<div class=\"output\">\n\n\n<div class=\"output_area\">\n\n    <div class=\"prompt output_prompt\">Out[1]:</div>\n\n\n\n\n<div class=\"output_text output_subarea output_execute_result\">\n<pre>2</pre>\n</div>\n\n</div>\n\n</div>\n</div>\n\n</div>\n\n\n"}

plugin:obsidian-jupyter:3104 received response {id: "d22f8052-c8ac-4869-9503-ef5c57e66192", body: "<div class=\"cell border-box-sizing code_cell rende…>2</pre>\n</div>\n\n</div>\n\n</div>\n</div>\n\n</div>\n\n\n"}
plugin:obsidian-jupyter:3308 Received response <div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[1]:</div>
<div class="inner_cell">
    <div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="mi">1</span> <span class="o">+</span> <span class="mi">1</span>
</pre></div>

    </div>
</div>
</div>

<div class="output_wrapper">
<div class="output">

<div class="output_area">

    <div class="prompt output_prompt">Out[1]:</div>

<div class="output_text output_subarea output_execute_result">
<pre>2</pre>
</div>

</div>

</div>
</div>

</div>
tillahoffmann commented 2 years ago

I'm afraid that's not something that can be fixed in this extension. The media file is written to a local directory on your computer, but Obsidian may not be able to locate the file depending on how it looks up resources. If manim could provide absolute paths, that might work. But rewriting urls specific to a particular python package is outside the scope of this project.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.