public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* customize to handle image not exists
@ 2023-03-30  4:12 jiewuza
  2023-03-30 16:03 ` John MacFarlane
  0 siblings, 1 reply; 5+ messages in thread
From: jiewuza @ 2023-03-30  4:12 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

I use pandoc to convert html to pdf with my personal latex documentclass, in which images not exists would be replaced with boxes.

For
```
<img src="not-exists.jpg">
```
if I convert it to latex first, and then to pdf, everything works as expected.

But if I convert it to pdf directly, pandoc reports a warning: could not fetch resource, replacing image with description.

I hope it does what the "html->latex->pdf" process did, without checking the resource. Is this customizable?

-- 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: customize to handle image not exists
  2023-03-30  4:12 customize to handle image not exists jiewuza
@ 2023-03-30 16:03 ` John MacFarlane
  2023-03-31  2:51   ` jiewuza
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2023-03-30 16:03 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

No, it isn't customizable.

> On Mar 29, 2023, at 9:12 PM, jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> wrote:
> 
> I use pandoc to convert html to pdf with my personal latex documentclass, in which images not exists would be replaced with boxes.
> 
> For
> ```
> <img src="not-exists.jpg">
> ```
> if I convert it to latex first, and then to pdf, everything works as expected.
> 
> But if I convert it to pdf directly, pandoc reports a warning: could not fetch resource, replacing image with description.
> 
> I hope it does what the "html->latex->pdf" process did, without checking the resource. Is this customizable?
> 
> -- 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/u0328r%2415ia%241%40ciao.gmane.io.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: customize to handle image not exists
  2023-03-30 16:03 ` John MacFarlane
@ 2023-03-31  2:51   ` jiewuza
  2023-03-31  5:37     ` John MacFarlane
  0 siblings, 1 reply; 5+ messages in thread
From: jiewuza @ 2023-03-31  2:51 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1530 bytes --]

Well, I am still confused about the difference between the two processes. 

In the process "html->latex->pdf",  I use pandoc to convert html to latex first, and call latex engine to produce pdf manually. While in the process "html->pdf", pandoc
does everything by itself. 

I passed the same cli parameters to pandoc during the two processes. The final pdfs are all the same except for the non-existing images. So I guess in "html->pdf" it also generates latex temporary file first before producing pdf, right?
If the answer is yes, it seems an inconsistent behavior of pandoc treating resources, which could surprise users.
IMHO, a warning is enough, but do not modify the content by replacing image with description.

BTW, I did not see the description in the pdf for the non-existing image. Is it a bug?


-- 


John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 写入消息新闻:
> No, it isn't customizable.
> 
>> On Mar 29, 2023, at 9:12 PM, jiewuza <jiewuza-9Onoh4P/yGk-XMD5yJDbdMSQIYZ4X/+iSw@public.gmane.orgrg> wrote:

----Android NewsGroup Reader----
http://www.piaohong.tk/newsgroup

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/u05hs8%24n7c%241%40ciao.gmane.io.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: customize to handle image not exists
  2023-03-31  2:51   ` jiewuza
@ 2023-03-31  5:37     ` John MacFarlane
  2023-04-01  6:47       ` jiewuza
  0 siblings, 1 reply; 5+ messages in thread
From: John MacFarlane @ 2023-03-31  5:37 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw



> On Mar 30, 2023, at 7:51 PM, jiewuza <jiewuza-9Onoh4P/yGk@public.gmane.org> wrote:
> 
> Well, I am still confused about the difference between the two processes. 
> 
> In the process "html->latex->pdf",  I use pandoc to convert html to latex first, and call latex engine to produce pdf manually. While in the process "html->pdf", pandoc
> does everything by itself. 
> 
> I passed the same cli parameters to pandoc during the two processes. The final pdfs are all the same except for the non-existing images. So I guess in "html->pdf" it also generates latex temporary file first before producing pdf, right?

Yes.

> If the answer is yes, it seems an inconsistent behavior of pandoc treating resources, which could surprise users.
> IMHO, a warning is enough, but do not modify the content by replacing image with description.

Well, then the latex process would raise an error, without special custom handling (as you seem to have). I think current behavior is better.

> 
> BTW, I did not see the description in the pdf for the non-existing image. Is it a bug?

Maybe there was no alt text in the input?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: customize to handle image not exists
  2023-03-31  5:37     ` John MacFarlane
@ 2023-04-01  6:47       ` jiewuza
  0 siblings, 0 replies; 5+ messages in thread
From: jiewuza @ 2023-04-01  6:47 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

[-- Attachment #1: Type: text/plain, Size: 1239 bytes --]

You are right. I removed "alt" in my filter.

But replacing images with description quietly could result in an unwanted document if people neglect the warning and do not check the documeng carefully.
So IMHO an error without generating the document is better, as people definitely would notice the warning and error what are missing. And an option to enable this raplacing behavior would be even better, since people know and agree what may happen when they set it.

-- 


John MacFarlane <fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 写入消息新闻:
> 
> 
>> On Mar 30, 2023, at 7:51 PM, jiewuza <jiewuza-9Onoh4P/yGk-XMD5yJDbdMSQIYZ4X/+iSw@public.gmane.orgrg> wrote:
>> 
>> Well, I am still confused about the difference between the two processes. 

----Android NewsGroup Reader----
http://www.piaohong.tk/newsgroup

-- 
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/u08k1a%24du1%241%40ciao.gmane.io.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-04-01  6:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30  4:12 customize to handle image not exists jiewuza
2023-03-30 16:03 ` John MacFarlane
2023-03-31  2:51   ` jiewuza
2023-03-31  5:37     ` John MacFarlane
2023-04-01  6:47       ` jiewuza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).