From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33279 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: jcr Newsgroups: gmane.text.pandoc Subject: Re: Markdown/HTML: Convert CSS styles to ODT styles (enhancement) Date: Tue, 7 Nov 2023 08:21:56 -0800 (PST) Message-ID: <62ec21c7-f152-42b1-8b24-b78f8f56a2cen@googlegroups.com> References: <9b60d1f7-098c-4e8e-a801-764d0b754ef0n@googlegroups.com> <8f4c5470-82f5-44c8-8f17-3f807ccdbd11n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_23362_1051888863.1699374116862" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16077"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDQLFNXWVILBBJWIVGVAMGQE3MZ6V7Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 07 17:22:02 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f56.google.com ([209.85.161.56]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1r0Oq1-0003xJ-N8 for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 07 Nov 2023 17:22:01 +0100 Original-Received: by mail-oo1-f56.google.com with SMTP id 006d021491bc7-5879cc4dfd9sf4119376eaf.0 for ; Tue, 07 Nov 2023 08:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1699374120; x=1699978920; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=0kzuljTyQmzjbtTjSE3LLeaf62qnYOy32G9RRpK8eeY=; b=XLkj3HlrXz9nn1KrkWQg2sNK6ezrlDyzkuvTtR31viuTYsSVIQvB40QZZSMLJxVlQq f8yajU9XDXLkHa7Sy2oqV0+3myzn0olsPcAm+zmTVbglHYEFcRTlfD2BARQ+HlOGa21v CCqs6gDbeoRtNSpJ33heIDujzB81rSr3eWf9bKxzHHT7x4lwzkzXDcNHb5EEGdqfX+v5 22zktZyh1T3r9LUDBbrsSYCmUCZWMcOqNBClp+SYbOb5DLNm2qpYEviFOEIhg+IPcPlX LZH6aERWp4fgXYDH0S4HtElY/xY0aT1zox2YPDi0PGkjVc8VFFFSMCW6TJibmq2zWIVA 6P9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699374120; x=1699978920; darn=m.gmane-mx.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=0kzuljTyQmzjbtTjSE3LLeaf62qnYOy32G9RRpK8eeY=; b=mvKSd9gJP+YEsM9lGhzhi1vfzsI6b7id3jdahpn7/fnK9TlZCXlLxseYfttx/iRnf0 pMsNusLSx1Hzu5JUutEmS354o/aJaUn4Rnfia1dBBkVkDHSkQH/cQhuaFfrebaODaEGv IgEf5UeS3oeVOkGwy8hxjU5jhx9R+oqRQm1xHJkTNfMZsyqV+PkV7VDNI91qmmpEKg+m jiOlCKukhuMaHlSMSe0u3lfJumEvik3xD87Z7tuTWDRaZW2xFNKIIZHHMoJ92TiYgvgU FNF3XFRAZYx/OdXewVuWCgZpcH3+5ToJXkMZJMPtyg/fKQSTmG80PWUFZV5oJVUOrEPI sulQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699374120; x=1699978920; 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:references:in-reply-to :message-id:to:from:date:x-beenthere:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=0kzuljTyQmzjbtTjSE3LLeaf62qnYOy32G9RRpK8eeY=; b=kOK12oJn+EB3jebnIH2TMYYxuFZKx3kojn172LTj2YKo7eIVB3lKGm1LrJerepK9rn ooO59r9lzp1KwvVTRRJY3rWgDL5n0cJ5NNgriWaFI61SWMua7aSEx4mFtNrQUtSnxPHF 0c7ir6oRAi7zRhjSbi2l3Fmf+BLxwfh0kY5SPsAC7xBtaxWGp6MqfYQhkgLyJbGY83vl 7PnJ3RwAvX2cRFq3Xw5l6AQfH6MCb0YdsCDCIUDWIaLK5PaOUQeha91ayQX2sBS/kuKM xgucYBwINFi6vSQ2BM85NPQZaCLl5I6ojw3jVTUwOaRL9AxCCb Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YzVVc287apBpkB7ZHe44BIK7wv5t1QAa9Qv3l7HHD667Cl6QSHz oVxgDfHIF7CQeA70NNkTZ6o= X-Google-Smtp-Source: AGHT+IHPSERxt3LKxMHxbiIOHKjln9tjzMG82NbawlsUcoCleEDQE6YWRzyvxBkziW1PKHMycyM01A== X-Received: by 2002:a4a:a787:0:b0:57b:92f2:1f64 with SMTP id l7-20020a4aa787000000b0057b92f21f64mr27788039oom.8.1699374120644; Tue, 07 Nov 2023 08:22:00 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:d98a:0:b0:587:ac60:9826 with SMTP id k10-20020a4ad98a000000b00587ac609826ls277224oou.2.-pod-prod-03-us; Tue, 07 Nov 2023 08:21:57 -0800 (PST) X-Received: by 2002:a9d:4e94:0:b0:6ab:8d3:5209 with SMTP id v20-20020a9d4e94000000b006ab08d35209mr8947912otk.5.1699374117444; Tue, 07 Nov 2023 08:21:57 -0800 (PST) In-Reply-To: X-Original-Sender: ffi.appdev-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:33279 Archived-At: ------=_Part_23362_1051888863.1699374116862 Content-Type: multipart/alternative; boundary="----=_Part_23363_127377652.1699374116862" ------=_Part_23363_127377652.1699374116862 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I tried it with pandoc 3.1.9, and it worked for me, but make sure you're=20 defining a character style called "Rose" and not a paragraph style called= =20 "Rose." I forgot to mention that important detail. Character styles are=20 used for spans with `custom-style` attributes. Paragraph styles are used=20 for paragraphs in divs with `custom-style` attributes. On Tuesday, November 7, 2023 at 10:28:36=E2=80=AFAM UTC-5 Kelly Price wrote= : > Okay, so before I go completely crazy, following the DOCX route. > Using Pandoc 2.9.2.1 currently (it's in Ubuntu's repos). > custom-ref.docx file has the style definition for "Rose" and it's > going through to the text document. Using: > > pandoc --reference-doc=3Dcustom-ref.docx test.md -f > 'markdown_phpextra+bracketed_spans' -t docx -o test.docx > > test.md has: > > [Good evening, Drake.]{custom-style=3D"Rose"} > > When I run it, the style does not get applied to the bracketed text. Any= =20 > ideas? > > On Tue, Nov 7, 2023 at 9:30=E2=80=AFAM jcr wrote: > > > > If you're willing to use docx instead of ODT, you can take advantage of= =20 > pandoc's support for Custom Styles and avoid the XML wrangling. You simpl= y=20 > get a copy of the default reference doc with `pandoc -o=20 > custom-reference.docx --print-default- data-file reference.docx`, add a= =20 > Rose style to `custom-reference.docx`, and give a `custom-style=3DRose`= =20 > attribute in Markdown to colored text. > > > > On Monday, November 6, 2023 at 10:23:36=E2=80=AFAM UTC-5 Kelly =E2=80= =9CSTrRedWolf=E2=80=9D=20 > Price wrote: > >> > >> Hello all. Using Pandoc to help convert my fiction (written in=20 > Markdown) into ODT format so I can combine and publish... but in writing,= I=20 > found a specific use case. > >> > >> I need colored text. > >> > >> For instance, if I define a CSS stylesheet file to color said text, I= =20 > can use this Markdown: > >> > >> [Are the good guys really good if they use it for cover for=20 > evil?]{.rose} > >> > >> I can work around it a bit by exporting to HTML=20 > (markdown_phpextra+bracketed_spans) and opening that into LibreOffice, bu= t=20 > that opens a whole can of LibreOffice worms relating to web vs PDF/print= =20 > formatting. > >> > >> Is there a way for Pandoc to translate the CSS stylesheet into ODT=20 > styles, and apply said styles as wanted? > > > > -- > > You received this message because you are subscribed to a topic in the= =20 > Google Groups "pandoc-discuss" group. > > To unsubscribe from this topic, visit=20 > https://groups.google.com/d/topic/pandoc-discuss/xMuBWNkXPRI/unsubscribe. > > To unsubscribe from this group and all its topics, send an email to=20 > pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/pandoc-discuss/8f4c5470-82f5-44c8-8f17-= 3f807ccdbd11n%40googlegroups.com > . > > > > --=20 > Kelly "STrRedWolf" Price > http://redwolf.ws > --=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/62ec21c7-f152-42b1-8b24-b78f8f56a2cen%40googlegroups.com. ------=_Part_23363_127377652.1699374116862 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I tried it with pandoc 3.1.9, and it worked for me, but make sure you'= re defining a character style called "Rose" and not a paragraph style calle= d "Rose." I forgot to mention that important detail. Character styles are u= sed for spans with `custom-style` attributes. Paragraph styles are used for= paragraphs in divs with `custom-style` attributes.

<= div class=3D"gmail_quote">
On Tuesday= , November 7, 2023 at 10:28:36=E2=80=AFAM UTC-5 Kelly Price wrote:
Okay, so before I go = completely crazy, following the DOCX route.
Using Pandoc 2.9.2.1 currently (it's in Ubuntu's repos).
custom-ref.docx file has the style definition for "Rose" and = it's
going through to the text document. Using:

pandoc --reference-doc=3Dcustom-ref.docx test.md -f
'markdown_phpextra+bracketed_spans' -t docx -o test.docx

test.md has:

[Good evening, Drake.]{custom-style=3D"Rose"}

When I run it, the style does not get applied to the bracketed text. A= ny ideas?

On Tue, Nov 7, 2023 at 9:30=E2=80=AFAM jcr <ffi.a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> If you're willing to use docx instead of ODT, you can take adv= antage of pandoc's support for Custom Styles and avoid the XML wranglin= g. You simply get a copy of the default reference doc with `pandoc -o custo= m-reference.docx --print-default- data-file reference.docx`, add a Rose sty= le to `custom-reference.docx`, and give a `custom-style=3DRose` attribute i= n Markdown to colored text.
>
> On Monday, November 6, 2023 at 10:23:36=E2=80=AFAM UTC-5 Kelly =E2= =80=9CSTrRedWolf=E2=80=9D Price wrote:
>>
>> Hello all. Using Pandoc to help convert my fiction (written i= n Markdown) into ODT format so I can combine and publish... but in writing,= I found a specific use case.
>>
>> I need colored text.
>>
>> For instance, if I define a CSS stylesheet file to color said = text, I can use this Markdown:
>>
>> [Are the good guys really good if they use it for cover for ev= il?]{.rose}
>>
>> I can work around it a bit by exporting to HTML (markdown_phpe= xtra+bracketed_spans) and opening that into LibreOffice, but that opens a w= hole can of LibreOffice worms relating to web vs PDF/print formatting.
>>
>> Is there a way for Pandoc to translate the CSS stylesheet into= ODT styles, and apply said styles as wanted?
>
> --
> You received this message because you are subscribed to a topic in= the Google Groups "pandoc-discuss" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/pandoc-discuss/xMuBWNkX= PRI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email t= o pandoc-discus...@googlegroups.= com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/8f4c5470-8= 2f5-44c8-8f17-3f807ccdbd11n%40googlegroups.com.



--=20
Kelly "STrRedWolf" Price
http://redwolf.ws

--
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/62ec21c7-f152-42b1-8b24-b78f8f56a2cen%40googlegroups.= com.
------=_Part_23363_127377652.1699374116862-- ------=_Part_23362_1051888863.1699374116862--