Comments (6)
As a not-ideal workaround, I added
use_directory_urls: false
to the configuration, which fixed it.
from mkdocs-jupyter.
The solution is what afled commented.
Another option is to have the images in another dir inside the docs
one, for example I usually do img/post-slug/img.png
and I include those in the notebook with
![alt](/img/post-slug/img.png)
from mkdocs-jupyter.
Hi, I'm trying to use the method suggested by @danielfrg above but the image still does not render. I created a separate folder in docs called imglib and put all my figures there. The docs folder also contains my Jupyter notebook at the following directory: case_studies/evaluating_perception/simple_script.ipynb . This case studies folder in docs is actually a symbolic link to the case studies folder that is located in the same directory as docs. I'm trying to render simple_script.ipynb that tries to print an image from the imglib folder but the figure does not render in my browser. Specifically, this is the error I get when I run make docs-serve:
INFO - [21:53:55] Serving on http://127.0.0.1:8000/gear/
WARNING - [21:53:58] "GET /gear/javascripts/mathjax.js HTTP/1.1" code 404
WARNING - [21:53:58] "GET /imglib/simple_case_study_fig2.png HTTP/1.1" code 404
WARNING - [21:53:58] "GET /imglib/simple_case_study_fig2.png HTTP/1.1" code 404
from mkdocs-jupyter.
Hi!
I'm having the same problem that @abadithela, any suggestions?
from mkdocs-jupyter.
@giturra I rendered in the Jupyter notebook using matplotlib. It's not the greatest but it works:
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
fig, ax = plt.subplots()
img = mpimg.imread('imglib/autonomy-stack.png')
imgplot = ax.imshow(img)
ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)
plt.show()
A better alternative is to use Python commands:
from IPython.display import Image
Image("imglib/autonomy-stack.png")
from mkdocs-jupyter.
The issue with using use_directory_urls: false
is that it added ".html" to the end of web pages. If that is not acceptable, then the question is still opened.
If you set use_directory_urls: true
and your notebooks are not in docs folder, you have an new issue where the directory of the images is different between local development and the generated site/ folder for the site.
from mkdocs-jupyter.
Related Issues (20)
- hide output of certain cells inside the notebook HOT 1
- xarray DataArray and Dataset HTML representation HOT 4
- Deprecation warning (soon breaking) HOT 1
- release 0.24.3 sources on Pypi HOT 1
- Unit-test fails on files on Pypi HOT 7
- Add options to hide cell based on tag and hide prompt
- Download assets when downloading notebook? HOT 2
- Insert jupyter notebooks inside snippets
- Bold text in notebook but not on website HOT 1
- 'mermaid js' is undefined error for version 0.24.3+ HOT 2
- Add Support for Jinja2 Overrides
- widgets are not displayed
- Prevent execution of specific cell HOT 1
- Comments in code cells break nav structure HOT 1
- `execute_include` as well as `execute_ignore`
- feat: add pyodide
- Navigation panel always uses h1 title
- Install and Adjust Locales
- Multi-core convert? HOT 1
- must specify renderer for showing Plotly graphs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mkdocs-jupyter.