From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32498 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Oskar Wood Hansen Newsgroups: gmane.text.pandoc Subject: Image styling md -> docx Date: Thu, 27 Apr 2023 06:29:12 -0700 (PDT) Message-ID: <8b721e7e-adfd-4a87-b4fa-fe1a2822b9c9n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1646_1970863276.1682602152495" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37954"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDT7BPPWQQNBBKPRVGRAMGQE5LYCAYQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Apr 27 15:29:18 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f61.google.com ([209.85.160.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ps1gS-0009jT-LZ for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 27 Apr 2023 15:29:16 +0200 Original-Received: by mail-oa1-f61.google.com with SMTP id 586e51a60fabf-18665b3eb80sf5753749fac.0 for ; Thu, 27 Apr 2023 06:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1682602155; x=1685194155; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=YfRAkl6bsBOGJIE6g4+x5w/3mF+A0QK9CHmtxihdwI8=; b=EpIIxUeb2LkByePk5mbnOTYRVzuT3ykiHWa3ZQqfaMWB0xAW3AmZ9HKPt5Ghxf6EM8 GL0EE4qnhqkTGTRMY9+m0yXyvTfr77UolGEvXq+2sW5sv1Y13wBKY/2xNbydJJCDG03D XDFSzrh7hV6bht76KQLNKNz+Se14RdUvzCn5R4TNs47oykuzzsabGGf1U0kTTi1b4XAM tHEKc7ZDGqZif6E6OmxFDzIbs00P3D2uY9XpKNdcXfooJG7NgwjrU2GgH4vx9L1m1tJ5 sOVWDgAjJWa9jb7I2ArNQoM0u5nyAEgwqcuhX8B/V9xLk6ARRqCD9i/1RNUnRAMu9rNH h9iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682602155; x=1685194155; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:message-id:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=YfRAkl6bsBOGJIE6g4+x5w/3mF+A0QK9CHmtxihdwI8=; b=plHD9DYA5olUla/HfB3Y6jmhM3DmQeaM3R936AV0jsmFIemYtDDdnJTbDtFppXaZJ2 yH8kBuRPic/cCQqJFOzvoLR2Akyzf56chZ8dvXW5VS2xM/7QTbaGQVqUzKY0AfeIxPah x1pMjckbZ9GgUg63QSRKXoqsv2yKo9DSzMLOE9Z3oinSvWRxjcto6ktHjlBcDC925lmt a/kq3ggiS9TGYHXA/T6NvQXEuOLtlZXvUs6Ne8YKi5asy4+ykdNYmyAaYu7BHg81RitE o/xBhphGY7TQv29JEwjYRsmm9h+nWSoI5KgD4n/NzmvR0dzo62v3oogbbGHRErvTdvVL 6aYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682602155; x=1685194155; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-sender:mime-version:subject:message-id:to:from:date :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=YfRAkl6bsBOGJIE6g4+x5w/3mF+A0QK9CHmtxihdwI8=; b=dkLG0+hH+JDozfzdNACfKvCVGLsvVtLGroIGRUR5DnwuU8xckrctYdcwGYxJ10PlQz jzsHbKA65DQa6aSULVTFBjgIyRzdxKRvzDV/1N+XogoVPNFiyM8u1CiMQ2i7d7xSGiVX nCawgDM//D54XerhKdGxH9hlrW+LfQ2MnLbPSMZPJ/pi7SHp/3+Mr9ZaET9K/o2xmPoN /dCtkOQnKUFcCtqqVWyk5k9OQH6yjYvuFAIv9ysSxDIShXTFKZWBGVQnq82szeuPzudA kEuniCqPlrhR0elbVtZnneisI6X5i8DBRsztTK/TpU/HecTk4XjWVxTogUxO1Ue8tkEp Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AC+VfDyjqFduVjzBs30h1/7SjMgGoSScw4REiY33oP540dytZidxMaQj HYnw0nvvazNwj6WmVmeCoaU= X-Google-Smtp-Source: ACHHUZ66T36zKV2f/3AP0Ib2iOGVpW3Lcf+J9U5WhPiPIOcLXvLk89ezxqv86bF+IM5DaP6h4KGbaQ== X-Received: by 2002:a05:6870:d78e:b0:18e:710e:1b23 with SMTP id bd14-20020a056870d78e00b0018e710e1b23mr434294oab.9.1682602155558; Thu, 27 Apr 2023 06:29:15 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:8e0c:b0:18e:7c56:c70f with SMTP id lw12-20020a0568708e0c00b0018e7c56c70fls477791oab.5.-pod-prod-gmail; Thu, 27 Apr 2023 06:29:13 -0700 (PDT) X-Received: by 2002:a05:6871:4495:b0:18e:79a1:69bc with SMTP id ne21-20020a056871449500b0018e79a169bcmr790005oab.9.1682602153045; Thu, 27 Apr 2023 06:29:13 -0700 (PDT) X-Original-Sender: osk.wood-Re5JQEeQqe8AvxtiuMwx3w@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:32498 Archived-At: ------=_Part_1646_1970863276.1682602152495 Content-Type: multipart/alternative; boundary="----=_Part_1647_739896047.1682602152495" ------=_Part_1647_739896047.1682602152495 Content-Type: text/plain; charset="UTF-8" When i convert from markdown to docx I would like to use a luafilter to add styling to my images. I have a css snippet that does the styling I want within obsidian, but this doesnt affect pandoc conversion to docx. I also have another luafiler that emables to center-align the images i want (I haven't written it my self). Ideally I'd like to have another luafilter, that enables me to toggle the custom styling (add borders) to my images. The working luafilter to align: function Image (img) align = 'left' for k, v in pairs(img.classes) do if v == 'center' then align = 'center' elseif v == 'right' then align = 'right' end end ret_img = { pandoc.RawInline('openxml', string.format('', align)), img } return ret_img end which allows me to add ![text that isnt transferred to docx anyway](imgpath.png){.center}. The CCS to add border styling is simple: img { border: 1px solid #d8d5d4; padding: 5px; border-radius: 5px; } I would also like to be able to invoke that with for instance .border. I've been searching for a full day, trying different things out - so I hope my possible rookie question is acceptable. also once again praise to talber and jgm and co! -- 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/8b721e7e-adfd-4a87-b4fa-fe1a2822b9c9n%40googlegroups.com. ------=_Part_1647_739896047.1682602152495 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
When i convert from markdown to docx I would like to use a luafilter t= o add styling to my images. I have a css snippet that does the styling I wa= nt within obsidian, but this doesnt affect pandoc conversion to docx. I als= o have another luafiler that emables to center-align the images i want (I h= aven't written it my self). Ideally I'd like to have another luafilter, tha= t enables me to toggle the custom styling (add borders) to my images.
=

The working luafilter to align:

function Image (img)

=C2=A0 align =3D 'left'<= /span>
=C2=A0 for k, v in pairs(img.classes) do
= =C2=A0 =C2=A0 if v =3D=3D 'center' then
=C2=A0 =C2=A0 =C2=A0 a= lign =3D 'center'
=C2=A0 =C2=A0 elseif v =3D=3D 'right' then
=C2=A0 =C2=A0 =C2=A0 align =3D 'right'
=C2=A0 =C2=A0 =C2=A0 <= span style=3D"color: rgb(0, 0, 255);">end
=C2=A0
=C2=A0 ret_img =3D {
=C2=A0 =C2=A0 =C2=A0pandoc.RawInline('openxml', st= ring.format('<w:pPr>&= lt;w:jc w:val=3D"%s"/></w:pPr>', align)),
= =C2=A0 =C2=A0 =C2=A0img
=C2=A0 }

=C2= =A0 return ret_img
end


which allows me to add ![text that isnt transferred to docx any= way](imgpath.png){.center}.

The CCS to add border styling is sim= ple:
img {
=C2=A0 border: 1px solid #d8d5d4;
=C2=A0 padding:= 5px;
=C2=A0 border-radius: 5px;
}

I would also like t= o be able to invoke that with for instance .border.

I've been se= arching for a full day, trying different things out - so I hope my possible= rookie question is acceptable.

also once= again praise to talber and jgm and co!

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/8b721e7e-adfd-4a87-b4fa-fe1a2822b9c9n%40googlegroups.= com.
------=_Part_1647_739896047.1682602152495-- ------=_Part_1646_1970863276.1682602152495--