From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/14157 Path: news.gmane.org!not-for-mail From: mb21 Newsgroups: gmane.text.pandoc Subject: Re: map p+class and span+class to para and char style names in html to docx, odt, icml and vice versa Date: Thu, 31 Dec 2015 09:23:32 -0800 (PST) Message-ID: <984a8c71-60cd-4766-83d3-219d178ab923@googlegroups.com> References: <6f4a2ed7-3eb3-4f09-8fc2-07c823e62ff2@googlegroups.com> <337e7324-35e6-4774-ad4b-574e33cede54@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_346_832598839.1451582612178" X-Trace: ger.gmane.org 1451582621 11258 80.91.229.3 (31 Dec 2015 17:23:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Dec 2015 17:23:41 +0000 (UTC) To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDCMBBVJ5EFBBFOJSW2AKGQEWXSIV3Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Dec 31 18:23:36 2015 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-pf0-f188.google.com ([209.85.192.188]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aEgwp-0006lb-19 for gtp-pandoc-discuss@m.gmane.org; Thu, 31 Dec 2015 18:23:35 +0100 Original-Received: by mail-pf0-f188.google.com with SMTP id 65sf35064559pff.1 for ; Thu, 31 Dec 2015 09:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=Exoq3Yokz3eQ3XMGMVHMDngtANeG7hH2itW1mUzSIDo=; b=PFkxHXbSlH5UfykqCWA8RhSjGi+9lIygYH/L1RITolsQW9AzbdLAS8/py+c5T90Eef y8/1kih2LpukUCtRmgtQbslMHmrV43gq8O04J0jROSt41RKTfPBW/AP0iPrsxIKjR6c9 FDdcFtkcy0ZyZ7yeIA/HiRQo5opea54zQRihyruvmDyXQeTKW1Rd27xTzYKzWyfFS8LI eBFEe7P9HjPVK+RH8ODUvknL1ZjaHJuhdxIQvxTwkaRASbhYqsWAspcFUddXsxFnMy7r YXouVUGoK9rbToFRQSrxTBAZ05Q7wUZdlPOElanv1VHKdWWW+Lfwr9KYVBw9bHwSqEy2 BgYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:x-original-sender:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe; bh=Exoq3Yokz3eQ3XMGMVHMDngtANeG7hH2itW1mUzSIDo=; b=CsTPVRfAjH2uyBkCSGKHYdi+LTc5JYD/xN3zeiIr9qaTSeHvyjamsYQLrRn0muv6E3 gXuEGfBMcepoBZzg2iz+uH0/StjfxzierxUTt7gigfCPyFEtpKYlQel8SPiKKBBATTqO aVMTvhfXdHEcdWQo5Zdw7B+DBY29zz7GuBOHkwlnAk7L3tNGVCiMgNnQsOgQKy8TVk4s 2fTT2R5sVJhXVXxtw6hYyP5Q8S6dyRLlqdhr+UGBf9iLkWn/eiklqWgliGpONpzJDpst PlTx39nyG6Hw5+wBL0v2ounHjY1CWBed5a0eqNvHjxjzNvcwg8h8XFu9twaCXvPAf7Nb MIug== X-Received: by 10.50.118.7 with SMTP id ki7mr1100733igb.7.1451582614233; Thu, 31 Dec 2015 09:23:34 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 10.107.10.169 with SMTP id 41ls3752356iok.51.gmail; Thu, 31 Dec 2015 09:23:33 -0800 (PST) X-Received: by 10.50.12.34 with SMTP id v2mr197037igb.2.1451582613577; Thu, 31 Dec 2015 09:23:33 -0800 (PST) In-Reply-To: <337e7324-35e6-4774-ad4b-574e33cede54-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: mauro.bieg-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-Spam-Checked-In-Group: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.org gmane.text.pandoc:14157 Archived-At: ------=_Part_346_832598839.1451582612178 Content-Type: multipart/alternative; boundary="----=_Part_347_631204976.1451582612179" ------=_Part_347_631204976.1451582612179 Content-Type: text/plain; charset=UTF-8 So what you're proposing is to extend the functionality described in https://github.com/jgm/pandoc/issues/2542 to: - not only cover DOCX, but also ODT and ICML - and not only Inlines but also Blocks (i.e. not only "character styles" but also "paragraph styles") You're welcome to add your comments to that issue! You suggest using a Span for Inlines, so using a Div for Blocks would be consequent. Also, as you mentioned Para currently unfortunately doesn't support attributes in Pandoc's AST anyway. Btw, you can also always write your own filter (see http://pandoc.org/scripting.html) to modify Pandoc's AST and insert for example Raw ICML, like: [RawBlock (Format "icml") ""] On Tuesday, December 29, 2015 at 4:07:15 PM UTC+1, massifrg wrote: > > I try to reformulate and simplify the question. > Example: > > A word with a custom style. > > Convert it from markdown to HTML (pandoc -f markdown -t html) and you get: > >

A word with a custom style.

> > Convert it from markdown to ICML (pandoc -f markdown -t icml) and you get: > > > > A > > > word > > > with a custom style. >
>
> > The styled word is put in a CharacterStyleRange of its own, but there's no > trace of the class attribute. > Is there a way to get this: > > > > A > > > word > > > with a custom style. >
>
> > This way, when you import the ICML in InDesign, in a document with myStyle > previously defined as a character style, you get the right formatting. > The same could be thought for DOCX and ODT, with reference documents that > contain the styles you need. > I have used the class attribute to map the style, but another attribute > could be used: it's only conventional. > I think this "style mapping" should be disabled by default, but enabled by > a command line option. > -- 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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/984a8c71-60cd-4766-83d3-219d178ab923%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_347_631204976.1451582612179 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So what you're proposing is to extend the functio= nality described in=C2=A0https://github.com/jgm/pandoc/issues/2542=C2=A0to: - not only cover DOCX, but also ODT and ICML



Btw, you c= an also always write your own filter (see http://pandoc.org/scripting.html)= to modify Pandoc's AST and insert for example Raw ICML, like: [RawBloc= k (Format "icml") "<ParagraphStyleRange ... </Paragrap= hStyleRange>"]


On Tuesday, December 29, 2015 at 4:07:15 = PM UTC+1, massifrg wrote:
I try to reformulate and simplify the question.
Example:
=
A <= span class=3D"my= Style">word</span> with a custom style.

Convert it from markdow= n to HTML (pandoc -f markdown -t html) and you get:

<p>A <span class=3D"myStyle"><= /span>word<= /span> with a custom style.</p>

Convert it from markdown to ICML (pandoc -f markd= own -t icml) and you get:

<ParagraphStyle= Range A= ppliedParagraphStyle=3D"ParagraphStyle/Paragraph">
=C2=A0
<CharacterStyleRange AppliedCharacterStyle=3D"$ID/No= rmalCharacterStyle">
=C2=A0 =C2=A0
&l= t;Content>A </Content>
=C2=A0 </CharacterStyleRange>
=C2=A0
<CharacterS= tyleRange AppliedCharacterStyle=3D"$ID/NormalCharacterStyle">
=C2=A0 =C2=A0=
<Content>word</Content>
=C2=A0
</Cha= racterStyleRange>
=C2=A0
<CharacterStyleRange AppliedCharacterStyle=3D"$ID/No= rmalCharacterStyle">
=C2=A0 =C2=A0
&l= t;Content> with a custom style.= </Content>
=C2=A0
</CharacterStyleRange>= <Br = />
</ParagraphStyleRange>
=

The styled word is put in a CharacterStyleRange of i= ts own, but there's no trace of the class attribute.
Is there a way = to get this:

<ParagraphStyleRange<= span style=3D"color:#000"> AppliedParagra= phStyle=3D"ParagraphStyle/Paragraph">
=C2=A0
<CharacterStyleRange AppliedCharacterStyle=3D"$ID/NormalCharacter= Style">
=C2=A0 =C2=A0
<Content>= A </= Content>
=C2=A0
</CharacterStyleRange>
=C2=A0
<CharacterStyleRange AppliedCha= racterStyle=3D"$ID/mySty= le">
=C2=A0 =C2=A0
<Content= >word</Content>
=C2=A0
</CharacterStyleRange>
=C2=A0
<CharacterStyleRang= e Appli= edCharacterStyle=3D"$ID/NormalCharacterStyle">
=C2=A0 =C2=A0
= <Content> with a custom style.</Content>
=C2=A0
</CharacterStyleRange><Br />
</ParagraphStyleRange>

This way, when you import the ICML in InDesign, in a document= with myStyle previously defined as a character style, you get the right fo= rmatting.
The same could be thought for DOCX and ODT, with reference doc= uments that contain the styles you need.
I have used the class attribute= to map the style, but another attribute could be used: it's only conve= ntional.
I think this "style mapping" should be disabled by de= fault, but enabled by a command line option.

--
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 post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/= msgid/pandoc-discuss/984a8c71-60cd-4766-83d3-219d178ab923%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_347_631204976.1451582612179-- ------=_Part_346_832598839.1451582612178--