Skip to content

Embed image with url in notebook #18

Description

@cast42

When the notebook to be published containts a url to the internet, the convertion of the notebook to a post gives an error.

I tried three options:

  1. Embed using markup
![Example Bullet Chart](https://jscharting.com/blog/bullet-charts/images/bullet_components.png)
  1. Embed using Image
from IPython.display import Image
Image('https://jscharting.com/blog/bullet-charts/images/bullet_components.png')
  1. Embed as HTML
<img src="https://jscharting.com/blog/bullet-charts/images/bullet_components.png" alt="Bullet chart" style="width: 200px;"/>

In case 3, this is the error in (https://github.com/cast42/cast42.github.io/runs/415599290?check_suite_focus=true):

converting: _notebooks/2020_01_29_bullet_chart_altair.ipynb
[Errno 2] No such file or directory: '/home/runner/work/cast42.github.io/cast42.github.io/_notebooks/https:/jscharting.com/blog/bullet-charts/images/bullet_components.png'
converting: _notebooks/2020-01-28-Altair.ipynb
Traceback (most recent call last):
  File "_action_files/nb2post.py", line 23, in <module>
    export2html.notebook2html(fname='_notebooks/*.ipynb', dest='_posts/')
  File "/home/runner/work/cast42.github.io/cast42.github.io/nbdev/nbdev/export2html.py", line 410, in notebook2html
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
  File "/home/runner/work/cast42.github.io/cast42.github.io/nbdev/nbdev/export2html.py", line 410, in <listcomp>
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
AttributeError: 'str' object has no attribute 'name'
##[error]Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions