public inbox archive for pandoc-discuss@googlegroups.com
 help / color / mirror / Atom feed
* How to use both custom HTML class and custom Word style in Markdown?
@ 2022-08-18 18:44 Андрей Якубой
       [not found] ` <a55fb5e6-2605-44ef-b4e1-8e3125a82604n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Андрей Якубой @ 2022-08-18 18:44 UTC (permalink / raw)
  To: pandoc-discuss


[-- Attachment #1.1: Type: text/plain, Size: 1250 bytes --]

Hello!

I'm going to create a big document using Pandoc Markdown, then convert it 
to HTML and docx (I have a custom HTML template and Word reference file).

Both in HTML and Word I need a custom style (let's call it "SpecialStyle"). 
So I've defined CSS styles for class "SpecialStyle" in the HTML template 
and added custom style "SpecialStyle" in the docx reference file.

The problem is that in Markdown, HTML classes are marked with 
`.SpecialStyle`, while to apply a custom Word style, I should use 
`custom-style` attribute.

The question is: can I write an universal Markdown document that applies 
HTML class when converting to HTML and custom style when converting to 
Word? I think I can do something like this: `[my styled text]{.SpecialStyle 
custom-style=SpecialStyle}`. But maybe there is more elegant way?

Thanks!

Andrey

-- 
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/a55fb5e6-2605-44ef-b4e1-8e3125a82604n%40googlegroups.com.

[-- Attachment #1.2: Type: text/html, Size: 1671 bytes --]

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

* Re: How to use both custom HTML class and custom Word style in Markdown?
       [not found] ` <a55fb5e6-2605-44ef-b4e1-8e3125a82604n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
@ 2022-08-18 19:27   ` John MacFarlane
  0 siblings, 0 replies; 2+ messages in thread
From: John MacFarlane @ 2022-08-18 19:27 UTC (permalink / raw)
  To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw

You could use a Lua filter to add the custom-style attributes when the SpecialStyle class is present.

> On Aug 18, 2022, at 11:44 AM, Андрей Якубой <Andrewia2002-o+MxOtu4lMCHXe+LvDLADg@public.gmane.org> wrote:
> 
> Hello!
> 
> I'm going to create a big document using Pandoc Markdown, then convert it to HTML and docx (I have a custom HTML template and Word reference file).
> 
> Both in HTML and Word I need a custom style (let's call it "SpecialStyle"). So I've defined CSS styles for class "SpecialStyle" in the HTML template and added custom style "SpecialStyle" in the docx reference file.
> 
> The problem is that in Markdown, HTML classes are marked with `.SpecialStyle`, while to apply a custom Word style, I should use `custom-style` attribute.
> 
> The question is: can I write an universal Markdown document that applies HTML class when converting to HTML and custom style when converting to Word? I think I can do something like this: `[my styled text]{.SpecialStyle custom-style=SpecialStyle}`. But maybe there is more elegant way?
> 
> Thanks!
> 
> Andrey
> 
> -- 
> 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/a55fb5e6-2605-44ef-b4e1-8e3125a82604n%40googlegroups.com.

-- 
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/2B05265A-B3B7-471F-853C-3CFBEA2E2AAF%40gmail.com.


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

end of thread, other threads:[~2022-08-18 19:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 18:44 How to use both custom HTML class and custom Word style in Markdown? Андрей Якубой
     [not found] ` <a55fb5e6-2605-44ef-b4e1-8e3125a82604n-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
2022-08-18 19:27   ` John MacFarlane

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).