From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26609 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: image that resizes automatically to screen size in epub Date: Wed, 28 Oct 2020 17:21:47 -0700 Message-ID: References: <220286f4-8dab-4a80-9ad6-4794e15f1961o@googlegroups.com> <04e6652d-6db6-4090-b2f1-db7acc33edd2n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27488"; mail-complaints-to="usenet@ciao.gmane.io" To: "cjns...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBKMW5D6AKGQEADGOKBA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Oct 29 01:22:07 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pg1-f184.google.com ([209.85.215.184]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kXvhf-00070x-7d for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 29 Oct 2020 01:22:07 +0100 Original-Received: by mail-pg1-f184.google.com with SMTP id t12sf752900pgv.0 for ; Wed, 28 Oct 2020 17:22:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1603930926; cv=pass; d=google.com; s=arc-20160816; b=q1kkppYJtPDvtQ5f+2DvmzNoDDQlMV8x9qMUX7UrjYJXsdMOn7NhcaQvwZcVpoBGZa AUseuDKcDhXyiaYaOekY4ctOBal3fi+p1ieSlUkut5udG9o5Lg2YdNmwAvuTE5CmOOi4 rAlhsq/422oWc3g/vXW+tetH6JglsdlxUcQQBx3wBOa/nDSVguJyo8UnbaiZYFLwuz71 u1lTGizN+eiKIZiIxZr2f13YfTCWg1di+N9tvnM4opVUs6ZSYXUWYBln8KvRdUKfCSOx ZmyNv04G9uIjUr5ieCt2SQqknnlCUFBkvTGVeDV4xgYnh+9+8EAnfPsZy2M7+lrM0E4M Vu6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding:reply-to :mime-version:message-id:date:references:in-reply-to:subject:to:from :sender:dkim-signature; bh=6kdaqATJY3E6+TGWmVDKILBmuF32jd+JWuigbejAYCM=; b=qu6KUxMZYzjQQoSraEwKtkpRPumBjNttxSQLW/utdJzQf2fYZ6S25vfux6DAjdeG3a TjbcbuewgrmMdst0WGwIV1iqzUcncmczGDTTY56EomrNV3oXdgHDLrs0H/yDlKiY4vE1 N+SHhUhjujPkrk/3bzZuKA7cqX/VBuFZDs8JO4wmscBBcpVxDmI4rZeLEO8E7qc0V7ro yJT+9O9R+3T+KuoBVo2gCrLmbfpux47f6INFh+fwiLawl5Acyug0Nja6odhHul5D09BB OTFV4mtxXDWRDRWyaGTXBwpm8gobqr7ZFW7dAaF8gfQWDgm70z5/ugVf68L/iigDAAPZ h6pQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=1z7eTKoM; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:content-transfer-encoding:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=6kdaqATJY3E6+TGWmVDKILBmuF32jd+JWuigbejAYCM=; b=UvIBAiqXy8VV0woQLXs3/wr1yo8HVtDmcZkn2PcwL68sdbatTdVQN4zMfaXqSWC4o5 S8QI3o4zc7n7KvVnxW593WcREyZDHIo5Nv/GLfNsrVp+AbsKlskEVHGMaivESqlyeRCq A/vAmx3RPZYaqy3UfoZ94AZhSZW3XfjjkBO4QBU5Qt9hNwICSj0HC8gyTtrHWJ9TZjik WOaqUFO5RvWkOADPT3ozzfvT1jeZDITbLyldMZ3o0HCKmjfWxGHTxSyYJHeg/PtHEjH6 cI3L72uOg8PSrydzkQ1gcEisPFiGS03MJtdSOd69Hm9Mhisw56hKazNDY1NSrEk9wN31 HvGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to :content-transfer-encoding:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=6kdaqATJY3E6+TGWmVDKILBmuF32jd+JWuigbejAYCM=; b=lf+TE/SgZrK/tdZYdfDTOUS4k4RG33V8hrFszClCHEGH9ZQAR7jIiDZDyk+HqU92CY lTxoO3PCGdR5z+Rod0pu+0eI77uA6BBifL/RIW8g5OykNb8/fk6A/YWJdwW6kggySYbX 4QmUTciw1iYbX3J05qxk1kTtCfavatRo3Mj5+018thjq9NdoIeXfi6kIK7sRS8trL4Rs a9ej1qAuDc/wyWF3FJiyqcaohuLqmoruXmDL5REDBW/zlbclh6M8qz7X8RSwKD3TaYqF EXbzF2qrsmZ6aYCNsLwFO7/M3t2+ZdBmFaepgSk2VAtl+D+0nj+CB5+LeOXTCcS7 Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533agRkcTHDI9H9KfkecYKH4siGoLWFdyeyTri0itv5RsSh54EHj SstkboF2iA1HgSO5JavpSho= X-Google-Smtp-Source: ABdhPJwHWSZCylGBoMzoocD4gQqzTuRS5W/gO4SLIYGqORDkiaCCQpKfi+IuLtxOMCydrv/Dp9cupQ== X-Received: by 2002:aa7:8588:0:b029:155:7861:4c47 with SMTP id w8-20020aa785880000b029015578614c47mr1528899pfn.14.1603930926096; Wed, 28 Oct 2020 17:22:06 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:3e45:: with SMTP id t5ls383206pjm.2.gmail; Wed, 28 Oct 2020 17:22:00 -0700 (PDT) X-Received: by 2002:a17:90a:8406:: with SMTP id j6mr1468964pjn.37.1603930920589; Wed, 28 Oct 2020 17:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603930920; cv=none; d=google.com; s=arc-20160816; b=CNx87Y2veuStZWu2nO+8Cjq+o1TA9a5rzWt8dM17X1oLAMJryVAAn4EarlDEvBXFVs K/C28wo2ewczvN/hmTbM9kk6JrqVwX29TMpMHuFHOUDdN1o25ZPCQZ7VbTkkRTrlqGBa u7GpXd3ZcB1+d55MjRvOAEzj5xAUlrbCqHf3sngBYI/KbNQ7Da4MvjsV58NG2wXg6heV sjstVPFJlbpGCfsJut3NKpMXvLAbOJKPRM7RpNdLCXyehk+lFF8Aw9Ap9ANAISf/FAMI trSO+Wm0T90LlwXQEWLsP1HaToFAVDXkr6Y7XW9MbpnG4CAUfOt+n4C7bbNyLgGvaotp +Dhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=B1y/YVoQq9YILRA7bNxjjfoP+c7K9C9Et4FoMAPsUSc=; b=eeZauHM3pxak1D5IpRH1Ln4pNAWFXllJsNlMjPaDkohh9cAIGHRaFa/Xix1f/w3QdO tD9SM6ZBIIKVK28EAjuFaIDEl9FkP4d7r6foc6VmtF/WC8hDSAumeeL86ZVCLNIerX8z RZR+fZxq4KuMEpR9+CAdAkFR877M07zIB0+4P7A/4xareCdcg6dL47fWf/Py5K3oZDuN hHHb8pv9TOIUjUXRMV6iquJM5zPrFg11cXQe0DNKf+jqE5J+72XJJv2HsLTd8zMN8o1z BPTXMpa7S2cozSSEyR46UNI7QNPq646kosKVYr78cJLFG84t2HLcxQBa74IYpd0X7zty BaDw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=1z7eTKoM; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com. [2607:f8b0:4864:20::532]) by gmr-mx.google.com with ESMTPS id z15si61740plo.4.2020.10.28.17.22.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Oct 2020 17:22:00 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) client-ip=2607:f8b0:4864:20::532; Original-Received: by mail-pg1-x532.google.com with SMTP id t14so908463pgg.1 for ; Wed, 28 Oct 2020 17:22:00 -0700 (PDT) X-Received: by 2002:a17:90a:1903:: with SMTP id 3mr1469555pjg.74.1603930920117; Wed, 28 Oct 2020 17:22:00 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id n19sm736877pfu.24.2020.10.28.17.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 17:21:59 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 00BEEA18A; Wed, 28 Oct 2020 20:21:47 -0400 (EDT) In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=1z7eTKoM; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::532 as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:26609 Archived-At: John MacFarlane writes: > "cjns...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" writes: > >> Here's the code: >> >>
>> > xmlns:xlink=3D"http://www.w3.org/1999/xlink" version=3D"1.1" width=3D"10= 0%"=20 >> height=3D"100%" viewBox=3D"0 0 900 1200" preserveAspectRatio=3D"none"> >> >> >>
>> >> The jpg image is invoked via "xlink:href=3D"=20 >> >> Unless I'm getting confused with the relative path the nightly version= =20 >> still does not pull the referenced file: it's nowhere to be found either= in=20 >> the EPUB/content.opf manifest nor does it get copied over to EPUB/media/= * >> >> On the other hand pandoc does understand the tag: in the=20 >> content.opf manifest of the resulting EPUB the description of the=20 >> ch001.xhtml that contains the above code includes the "properties=3Dsvg"= =20 >> attribute. >> =20 >> My guess is that pandoc does not understand the "xlink:ref=3D" syntax. > > That's right. It probably wouldn't hurt just to globally allow this as a > fallback if src isn't present. Hm. The raw HTML is passed through to the EPUB (at least in current master with the svg fix). The problem is that pandoc doesn't "see" the jpg and thus doesn't include it in the manifest or media. That's because the SVG lives in the AST as a raw HTML element, not an Image, and pandoc only fetches contents for Images. The change I referred to earlier causes svg elements in HTML to be parsed as images (with data: urls encoding the SVG content). But it only does that if `raw_html` is disabled in the reader. If `raw_html` is enabled, it just parses the SVG element as raw HTML. The problem is that your input source is Markdown, not HTML, and the only thing the Markdown reader does with HTML is return raw HTML blocks/inlines. (It does not try to parse this HTML and assign it a meaning.) You can work around this, actually! % pandoc -f html -t markdown ^D ![](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwM= C9zdmciIHhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEi= IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIHZpZXdib3g9IjAgMCA5MDAgMTIwMCIgcHJlc2V= ydmVhc3BlY3RyYXRpbz0ibm9uZSI+CjxpbWFnZSB3aWR0aD0iOTAwIiBoZWlnaHQ9IjEyMDAiIG= hyZWY9Ii4uL21lZGlhL3BsMDAxLmpwZyI+PC9pbWFnZT4KPC9zdmc+) Just include that Markdown image tag in your document instead of the HTML svg element, and everything should work properly (with the pandoc nightly). --=20 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 e= mail 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/m2zh45swys.fsf%40MacBook-Pro.hsd1.ca.comcast.net.