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('<w:pPr><w:jc w:val="%s"/></w:pPr>', 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-/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.