Embed remote images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Embed remote images

asotobu
Hello,

I am with Asciidoctor 0.1.4 and I have found something that I think that would be amazing to implement too (maybe it is already implemented but I am missing something). I have got the next document:

= My title
foo <foo@gmail.com>
:data-uri:
:allow-uri-read:

I think this is Firefox logo image:http://upload.wikimedia.org/wikipedia/commons/f/ff/Mozilla_Firefox_logo_2013.png[Firefox, 25, 25]


but image is not embeded, but only referenced. I think it would be good to implement the same strategy as in include macro so Asciidoctor could download the image from URI and embed inside document.


WDYT?
Reply | Threaded
Open this post in threaded view
|

Re: Embed remote images

LightGuardjp
If this isn't doable yet I'm pretty sure we've at least talked about this sort of thing. One would need to go back through the archives to find out for sure though. I do agree this can be a useful feature (with the correct security settings of course).


On Thu, Sep 12, 2013 at 6:29 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

I am with Asciidoctor 0.1.4 and I have found something that I think that would be amazing to implement too (maybe it is already implemented but I am missing something). I have got the next document:

= My title
foo <[hidden email]>
:data-uri:
:allow-uri-read:

I think this is Firefox logo image:http://upload.wikimedia.org/wikipedia/commons/f/ff/Mozilla_Firefox_logo_2013.png[Firefox, 25, 25]


but image is not embeded, but only referenced. I think it would be good to implement the same strategy as in include macro so Asciidoctor could download the image from URI and embed inside document.


WDYT?



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-remote-images-tp575.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Embed remote images

davidgamba
Has any of you implemented this? I mean, a good workflow to download the remote images?

I have a bunch of logos I need to embed into the documentation I am building and I don't want to add them to git.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Embed remote images

abelsromero
I fear not.

So far you can pass the `data-uri` param (embeddAssets if using the maven plugin) to embed CSS and images, but only those in a local folder, URI resources are linked :/

I think a good approach could be a simple extension that downloads all images to a temp folder, once files are rendered, the folder can be deleted. It would also allow you to throw any exception/warning in case a resource is not found and abort the process, providing some validation if you'r using some CI.
Reply | Threaded
Open this post in threaded view
|

Re: Embed remote images

asotobu
Yes for now the best way is by an extension in fact you need to create a inline macro processor extension and a postprocessor to delete the images. 

2014-10-24 8:26 GMT+02:00 abelsromero [via Asciidoctor :: Discussion] <[hidden email]>:
I fear not.

So far you can pass the `data-uri` param (embeddAssets if using the maven plugin) to embed CSS and images, but only those in a local folder, URI resources are linked :/

I think a good approach could be a simple extension that downloads all images to a temp folder, once files are rendered, the folder can be deleted. It would also allow you to throw any exception/warning in case a resource is not found and abort the process, providing some validation if you'r using some CI.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-remote-images-tp575p2370.html
To unsubscribe from Embed remote images, click here.
NAML



--
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+
Reply | Threaded
Open this post in threaded view
|

Re: Embed remote images

mojavelinux
Administrator
I have good news! This feature made it into Asciidoctor 1.5.0. Here are the details:


Give it a try and let me know if you have any trouble making it work. There's a small chance the information in the issue report is out of date, so follow through to the commit to discover any additional details if you have trouble.

Cheers,

-Dan

On Fri, Oct 24, 2014 at 12:30 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Yes for now the best way is by an extension in fact you need to create a inline macro processor extension and a postprocessor to delete the images. 

2014-10-24 8:26 GMT+02:00 abelsromero [via Asciidoctor :: Discussion] <[hidden email]>:
I fear not.

So far you can pass the `data-uri` param (embeddAssets if using the maven plugin) to embed CSS and images, but only those in a local folder, URI resources are linked :/

I think a good approach could be a simple extension that downloads all images to a temp folder, once files are rendered, the folder can be deleted. It would also allow you to throw any exception/warning in case a resource is not found and abort the process, providing some validation if you'r using some CI.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-remote-images-tp575p2370.html
To unsubscribe from Embed remote images, click here.
NAML



--
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Embed-remote-images-tp575p2371.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--