From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/21955 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Agust=C3=ADn_Mart=C3=ADn?= Newsgroups: gmane.text.pandoc Subject: Re: Setting custom variables in command line for Markdown -> DOCX conversion Date: Sat, 26 Jan 2019 14:44:11 -0800 (PST) Message-ID: References: <1066fd0c-ca5f-4650-bc64-17ca4aaec04c@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1179_1408486628.1548542651664" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="111755"; mail-complaints-to="usenet@blaine.gmane.org" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBDC7PRMFWYJBBPGFWPRAKGQEBH6UALA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Jan 26 23:44:16 2019 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane.org Original-Received: from mail-oi1-f188.google.com ([209.85.167.188]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gnWgQ-000Sv2-WD for gtp-pandoc-discuss@m.gmane.org; Sat, 26 Jan 2019 23:44:15 +0100 Original-Received: by mail-oi1-f188.google.com with SMTP id v184sf6759309oie.6 for ; Sat, 26 Jan 2019 14:44:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=SEklcruGKt2VIj+OZonR6sUl3ZJ4EBxezX0M/k9ZI0U=; b=plUFHi7izNSitnhy5H7/CfClA4K6hjSqsWkS2SY85GdFq7e60ZrqkacKNfNRXYqB/F OBmKvz0JWN/UKT/ORuSdaxlekmhauBoW4/Odm1Vn2Pt2DBv6nN3AHSm6Ws/uYQHJOlxd wCLd8mehzgSEDI7lA2+BM/Fp5RDfwi6MiC9lAxEDrJFlKWwWKIzaa0Z0KwMXM7htJ6mx 15mb7ZBbGRHRyNatjR9nt/wvS21Z6FBumsgxdQSb9tN499iKiEGiiT4aEC2oLuxCt3tl 21Tq0UwpnpzFE178rRE4R5/AEUy3gKK1HA4kvALfywIpkhiei5saXzPLFKv9MKxjVBof qwww== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=SEklcruGKt2VIj+OZonR6sUl3ZJ4EBxezX0M/k9ZI0U=; b=Bo732cUSlPodXbNDpoKxq98MYe604+aKLAmi98taye+w6epXZwPFMGYhBn5qpWQ9P3 rbM7ObHZoJLQblUqlvLEW+7rZ0Jx3uLV/ki1wtOmynLzAH1yVwyIFHyZXcN20u1HQdsP DRzNFr8D/XXSjwzV5dX8ro3q0I/ILT4MvAu+XMDGKx3yPpRsu+Wt58Uu6eQ6sPIufqL2 JkGEf+4E1Ww2z0xwWk7rM/nqi9DLXQggyDU8wfK41KWwE8ToOPu9sNipLG8OJPR4SU7Y tr7X5I8Zop/4exDbhM+jyf4jRDZj5QpnB8ZesiTev5oYxLVkYibhHA3IXjjlgeauHvW+ pSqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=SEklcruGKt2VIj+OZonR6sUl3ZJ4EBxezX0M/k9ZI0U=; b=kK5GRAl4iHh/gjnFvAwYnlvh1ElufToT44Ik82AXi8hW4b3TSVZoyboJoxQT7mlBto wgJfFtUTy8NGE5JyePDCadss3X7RIX/aUBZXw9OaRoExs/pAr7WR9Oj8tXMh9ma0YFDM eN+HfKPeKOMYfneKJWUTS6CAGX70eNvR9dXi/cWR77PA2/gcWTGbk5BViS5GAOAYG1D3 wB8j1Bua0GvT+XQM1Kr7LKDlQxd3KZoX6Xd3rkHQxvkrd+a+5zUURPHOnAQEDNwh7QzM Lp8WJN9+1lqLnpWXzJGwSyzx/9OcLJsXVMMI3cVJqETebOgaJUwnDshZa5rnr5ZQ8sqx dz+g== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJcUukdXVoGAksQ29ZMDz1d8lURmVP3Iuo/K1g6xypv4OPKMEdQ+cbqe Zok97zOIcjeV36X+2TYAFaM= X-Google-Smtp-Source: ALg8bN56XAPgbhHFyisfjhg/Flnb1MGDnw53NNXt/K2YtYqCNMoVXrENzX1sG1itwWZNKw4YdgkWVw== X-Received: by 2002:aca:d607:: with SMTP id n7mr62481oig.1.1548542653426; Sat, 26 Jan 2019 14:44:13 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:f3c5:: with SMTP id r188ls3037589oih.8.gmail; Sat, 26 Jan 2019 14:44:12 -0800 (PST) X-Received: by 2002:aca:5884:: with SMTP id m126mr63373oib.4.1548542652245; Sat, 26 Jan 2019 14:44:12 -0800 (PST) In-Reply-To: X-Original-Sender: agusmba-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.org gmane.text.pandoc:21955 Archived-At: ------=_Part_1179_1408486628.1548542651664 Content-Type: multipart/alternative; boundary="----=_Part_1180_1653806748.1548542651664" ------=_Part_1180_1653806748.1548542651664 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dmitriy. It's probably referring to pandoc metadata (-M command line option, or YAML= =20 block in your markdown). Support for this might come soon=20 (see https://github.com/jgm/pandoc/pull/5252 ) You'll be able to access these properties with the DocProperty field in=20 Word. You can use this for instance to prepare a common template=20 (--reference-doc) with text in header/footer that will use the value of one= =20 or more such metadata. On Friday, January 25, 2019 at 6:11:45 AM UTC+1, Dmitriy Vinokurov wrote: > > Thanks for answer. I've read comments from issue that you've referenced. > > > Implement basic support for converting pandoc properties into core and= =20 > custom docx properties > > I don't fully understand this thing. "Pandoc properties" - is it pandoc= =20 > variables, which are specified using -V command line option? "docx=20 > properties" - is it same as LibreOffice "fields"? > > friday, 25 january 2019 =D0=B3., 5:11:54 UTC+5 user John MacFarlane write= s: >> >> >> Variables in pandoc just affect template resolution,=20 >> and docx doesn't use templates.=20 >> >> Reference.docx is a different concept.=20 >> >> See however #5215, which might offer a path forward in=20 >> the future.=20 >> >> >> >> Dmitriy Vinokurov writes:=20 >> >> > Hi!=20 >> >=20 >> > I need to use custom variables for my DOCX file content created from= =20 >> > Markdown file.=20 >> >=20 >> > Tried to insert DOC_NAME variable in "--reference-doc" template file= =20 >> both=20 >> > using LibreOffice and MS Office in document header. Then I redefine=20 >> this=20 >> > variable according to pandoc man page and convert Markdown to DOCX=20 >> using=20 >> > this command line:=20 >> >=20 >> > $ pandoc -s -V DOC_NAME=3DDOCUMENT1 --columns 10=20 >> > --reference-doc=3Dtemplate.docx -s -f markdown -t docx main.md -o=20 >> main.docx=20 >> >=20 >> > But when I open main.docx I see variable values that was set in office= =20 >> > document editor in template.docx header, not what was set in command= =20 >> line.=20 >> > E.g. I set variable DOC_NAME=3Ddoc1 in office and see it in resulting= =20 >> file,=20 >> > not the "DOCUMENT1" value that was set in command line.=20 >> >=20 >> > Could anybody help me with setting custom variables?=20 >> >=20 >> > --=20 >> > You received this message because you are subscribed to the Google=20 >> Groups "pandoc-discuss" group.=20 >> > To unsubscribe from this group and stop receiving emails from it, send= =20 >> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> > To post to this group, send email to pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org=20 >> > To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/1066fd0c-ca5f-4650-bc64= -17ca4aaec04c%40googlegroups.com.=20 >> >> > For more options, visit https://groups.google.com/d/optout.=20 >> > --=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 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/e7932676-af8a-45b0-be92-4ee054e474bf%40googlegroups.com. For more options, visit https://groups.google.com/d/optout. ------=_Part_1180_1653806748.1548542651664 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dmitriy.

It's probably referring= to pandoc metadata (-M command line option, or YAML block in your markdown= ).
Support for this might come soon (see=C2=A0https://github.com/= jgm/pandoc/pull/5252 )

You'll be able to acces= s these properties with the DocProperty field in Word. You can use this for= instance to prepare a common template (--reference-doc) with text in heade= r/footer that will use the value of one or more such metadata.

On Fr= iday, January 25, 2019 at 6:11:45 AM UTC+1, Dmitriy Vinokurov wrote:
Thanks for answ= er. I've read comments from issue that you've referenced.

> Implement basic support for converting pandoc properties in= to core and custom docx properties

I don't fully und= erstand this thing. "Pandoc properties" - is it pandoc variables,= which are specified using -V command line option? "docx properties&qu= ot; - is it same as LibreOffice "fields"?

friday, 25 janua= ry 2019 =D0=B3., 5:11:54 UTC+5 user John MacFarlane writes:

Variables in pandoc just affect template resolution,
and docx doesn't use templates.

Reference.docx is a different concept.

See however #5215, which might offer a path forward in
the future.



Dmitriy Vinokurov <gim...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writ= es:

> Hi!
>
> I need to use custom variables for my DOCX file content created fr= om=20
> Markdown file.
>
> Tried to insert DOC_NAME variable in "--reference-doc" t= emplate file both=20
> using LibreOffice and MS Office in document header. Then I redefin= e this=20
> variable according to pandoc man page and convert Markdown to DOCX= using=20
> this command line:
>
> $ pandoc -s -V DOC_NAME=3DDOCUMENT1 --columns 10=20
> --reference-doc=3Dtemplate.docx -s -f markdown -t docx main.md -o = main.docx
>
> But when I open main.docx I see variable values that was set in of= fice=20
> document editor in template.docx header, not what was set in comma= nd line.=20
> E.g. I set variable DOC_NAME=3Ddoc1 in office and see it in result= ing file,=20
> not the "DOCUMENT1" value that was set in command line.
>
> Could anybody help me with setting custom variables?
>
> --=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 email to pandoc-discus...@googlegroups.com= .
> To post to this group, send email to pandoc-..= .@googlegroups.com.
> To view this discussion on the web visit https://groups.= google.com/d/msgid/pandoc-discuss/1066fd0c-ca5f-4650-bc64-17ca4aa= ec04c%40googlegroups.com.
> For more options, visit https://groups.go= ogle.com/d/optout.

--
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/e7932676-af8a-45b0-be92-4ee054e474bf%40googlegroups.co= m.
For more options, visit http= s://groups.google.com/d/optout.
------=_Part_1180_1653806748.1548542651664-- ------=_Part_1179_1408486628.1548542651664--