From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32198 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: docx -> gfm with custom styles Date: Sat, 18 Feb 2023 08:19:37 +0000 Message-ID: References: <3909f520-e8db-4cf9-900d-6a5a858c1a18n@googlegroups.com> <52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29160"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBG4UYKPQMGQENECX75Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sat Feb 18 09:19:47 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ed1-f59.google.com ([209.85.208.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pTIRf-0007Pb-4g for gtp-pandoc-discuss@m.gmane-mx.org; Sat, 18 Feb 2023 09:19:47 +0100 Original-Received: by mail-ed1-f59.google.com with SMTP id i28-20020a0564020f1c00b004aab4319cedsf178497eda.2 for ; Sat, 18 Feb 2023 00:19:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676708386; cv=pass; d=google.com; s=arc-20160816; b=VXOYypF5Q3Q4UmcTWLZAHru6EJrqpZyEFeP65p4tNF8B6HIr4734chyeAA2luhyzS0 pPJ2aUK0JfsNK1pFS6kaOjM7NJ/sBx5i+EMDsILVyC9kTs847MkbaAzd4XZcAW83uexr 1qPFlR45s6L14QD2BS6XrOOBV3v2A6LVlo+XTriY3n5w0xpTl35ONrXClEhOo3H7HEmK xeDnp4k0j+r9oYQo24lHw1HOoEi/FJYZLq7ccg0iD0Dx6grIj7zfTwjDgBaDk9wEQvcb J758J3vkUyu9Rb2nbSyGH5RkhH1WV8FgvjQZLOVpDXLvnB5B8GJ5SudXSW3mAmlMKZei +/Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=d6MnX04RRN+hwB9bz9b88HEw+T1otpAtZKQOOURgWu8=; b=RX1ruHIXTmC8XFJzEadya3agL6wiRBPNJW/pAM2uD+wAKj4C0x/8+wVYmMZLLwaJ0w 0Fmsy80xnP6mIRnRw8yPFievyjH0mz5cKj9SMsOJtQQ7LNUq/cjfCFt9O0j0EAGqO3kk 6RdiRa5p4nYkkvL1JV7k9/+bqt05SwHmTj6ouV+FKZnphRhy2uo3lmHqipJTvf1ETWny Obz1uvEYYXFa3BkmsoDBubGFUft8JTgOy2jX8PpXnBW9J+AS2DynChCPLIsqqqGeYVAH EaW3qaXID89SFrNVUzmpslcYyCJP+MMQpbiJBwnYEziLRCNEWLiBmXnAT7eqtlxQCKre phhg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=X47vRo3R; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=d6MnX04RRN+hwB9bz9b88HEw+T1otpAtZKQOOURgWu8=; b=gIsknhw/YiMQfLhvEGi4BRRR7IBrHbZNU7JvlTDLZcS2uDCUlOk2pWRiLn+etT0tNg KpgbBN629xAsBUT6E3vgwoENrhfYHtonn/APsU+9NQPBt8DMtBqskalwXGB0uRlnT8gz rGHNHbWq0wWneBkDimEGSy7cOfZhBuWSiqW3lBeypRXxokTcf2sntwhLgv0PibS/Fbq1 62pK8Sf4e/2EdhmKyAgLYjhcVLNbMWJBaNGUUa92vbeMhiFjSYV++yYQysWawqAO4rd4 O5eFXycr1lm5Prreo+L6YDR8uPemKRhNv6rdGytRcaEls X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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-authentication-results:x-original-sender:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=d6MnX04RRN+hwB9bz9b88HEw+T1otpAtZKQOOURgWu8=; b=5XnQwmJPleL1jwG1LAegMYUsdg4QlmyKPNPnNM1JsL0Soy9gh3dPaJ6687XMt7K2MX slJAx1K640rqhc8iqGcoSblVoVXkFOgK+TuYC8Mo+JX0YK5zfFs6qcW2Y5uesbk6kMFf XUkho4U8rfxX2iLnqHY8ADkzsv9xRbtom7XmSJMBgezoevscCTtapEzSPBEVsVYSjY1Y q/jf0XDHFZrXFd5pE+74l03lCkaAIkoHvVM3v4d4IBT0kPv02spzhn0Upb2iQGSCHWuX Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AO0yUKXfNizbo/0E29yO5eTpTXsw7mDqy+SzK78C0DacPd3jrOCvdL1D kHJhHduFwXuk7NYTOp7M8FE= X-Google-Smtp-Source: AK7set+tzXgpXNh6QOHteClcMMhh2U6XUWZHj3TIbeDUilPGZ5+x33nztHmCDwgDg2HxGQp9VUhIZA== X-Received: by 2002:a17:907:76ad:b0:8b1:749f:b2c6 with SMTP id jw13-20020a17090776ad00b008b1749fb2c6mr3228845ejc.2.1676708386009; Sat, 18 Feb 2023 00:19:46 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6402:d5b:b0:4ac:b59b:6e28 with SMTP id ec27-20020a0564020d5b00b004acb59b6e28ls215040edb.2.-pod-prod-gmail; Sat, 18 Feb 2023 00:19:38 -0800 (PST) X-Received: by 2002:a05:6402:6d8:b0:4ad:8fc7:76db with SMTP id n24-20020a05640206d800b004ad8fc776dbmr5664740edy.36.1676708378507; Sat, 18 Feb 2023 00:19:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676708378; cv=none; d=google.com; s=arc-20160816; b=PKGF2QduEqFX5zk4SxlXmYpkcoSJa40520aYoiTfvTBDgmndnx+NyM1rxaDQ4YeTsO upj30leHMNwrJqK+TO0oxqmm7YLCNBSv3H3CImPVJ1NBVjEKnMXjBqi0Sc/l0OdjJjd9 +WdhEIFyMF/b46JO9FlJSsQCnUqxuHyqbfa2qnkncuDiISM2RNEUV6winCTrVHfsD2pg XYVbrn98qs8unMzXCXeheTln2nsqqCuKlGVtfuTX9ehMaVXz0/ll7rpvNHchVLbBf8JL U6yFzr3FvwoOMftPU54leh4DnhtBZrgrC+eKljt59wm6OGhDz3ZG60QnQX5KBs7gAzRM cnFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=witw938c10nli6pUXM07kcalJ7Qu5Ab9JqV4XB5Wf3s=; b=LJbGmb2dizLx/YfaTs8kmHKInPRsgyUugirQ28EE4i17PxZGDN0svhon/mkfMM7om6 lOt5XpZMDhEcYHvaKyBnvGZBBkuAGEZvr+JxBDWnxSs6fZla8tuaK/2mjJAzRwNoQidb r/s4z+i7DytBjcIy11Zb6GZ1MMQOcTVX100JOQJemNdmpgn+KoLPZdQUq0qAcV8GUAzr iw47DsAliCSORC4yHzTlXX1DjJdMih8gE30Y/kDpfa49yzXIORrJeJ9vBD7mq7IxiIh2 ImqDtFL/m6oBccd6c+nQlFV0bgI8wCBtVEBGzVX4TF5Dx01dgjeim2HpM1o+x7nAL3bd v+9Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=X47vRo3R; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout01.posteo.de (mout01.posteo.de. [185.67.36.65]) by gmr-mx.google.com with ESMTPS id d14-20020aa7ce0e000000b004acbe86bdb6si204415edv.4.2023.02.18.00.19.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 00:19:38 -0800 (PST) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) client-ip=185.67.36.65; Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 03F4D2403A8 for ; Sat, 18 Feb 2023 09:19:38 +0100 (CET) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PJhRs4JfMz6trd for ; Sat, 18 Feb 2023 09:19:37 +0100 (CET) Content-Disposition: inline In-Reply-To: <52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=X47vRo3R; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.65 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:32198 Archived-At: With your examples, I get: ## Scope
Test body
## Test nested Le Friday 17 February 2023 =C3=A0 07:00:47AM, Ben Menashe a =C3=A9crit : > Thank you so much...that worked - I was missing the [1].content. > But let's say I have another 'Example' custom style under it... w/o Lua f= ilter > it renders this structure: >=20 > ``` >
>=20 > Scope >=20 >
>=20 >
>=20 > Test body >=20 >
>=20 >
>=20 > Test nested >=20 >
> ``` >=20 > And with filter below it fails on line 8 w/ this error "Inline, list of > Inlines, or string expected, got Blocks"... any idea on how to troublesho= ot > such issues?: >=20 > ``` > return { > { > Div =3D function (div) > if (div.attributes['custom-style'] =3D=3D 'Internal Heading') then > return pandoc.Header(2, div.content[1].content) > end > if (div.attributes['custom-style'] =3D=3D 'Example') then > return pandoc.Header(2, div.content[1].content) > end >=20 > return div > end, > } > } > ``` > On Friday, February 17, 2023 at 1:10:11 AM UTC-7 Bastien DUMONT wrote: >=20 > In this case, it would be preferable to turn the div into a Header el= ement > and let Pandoc format it itself: >=20 > ``` > function Div(div) > if div.attributes['custom-style'] =3D=3D 'Internal Heading' then > return pandoc.Header(2, div.content[1].content) > end > end > ``` >=20 > Le Thursday 16 February 2023 =C3=A0 08:00:08PM, Ben Menashe a =C3=A9c= rit : > > Hi, > > We have a need to convert docx to gfm. > > Since docx has some user defined styles we use this "+styles" exten= sion: > > > > > > pandoc --to=3Dgfm -f docx+styles --output=3Drtb.md --extract-media= =3D. --wrap=3D > none > > 'rtb.docx' > > > > > > So now we have html div that wraps our content. =C2=A0Let's say I w= ant to > transform > > this: > > > >
> > > > Scope > > > >
> > > > Into: > > > > ## Scope > > > > How can it be done? I tried to setup a Lua filter but not having su= ccess > to > > have it output "##" along with the div content. > > > > > > -- > > 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, s= end an > email > > to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [2][1]https://groups.googl= e.com/ > d/msgid/ > > pandoc-discuss/3909f520-e8db-4cf9-900d-6a5a858c1a18n%[2] > 40googlegroups.com. > > > > References: > > > > [1] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [2] [3]https://groups.google.com/d/msgid/pandoc-discuss/ > 3909f520-e8db-4cf9-900d-6a5a858c1a18n%40googlegroups.com?utm_medium= =3Demail& > utm_source=3Dfooter >=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= email > to [4]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [5]https://groups.google.com/d/m= sgid/ > pandoc-discuss/52ada5c3-e26e-4c8c-8b3f-b55bb8ce8e1en%40googlegroups.com. >=20 > References: >=20 > [1] https://groups.google.com/d/msgid/ > [2] http://40googlegroups.com/ > [3] https://groups.google.com/d/msgid/pandoc-discuss/3909f520-e8db-4cf9-9= 00d-6a5a858c1a18n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter > [4] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [5] https://groups.google.com/d/msgid/pandoc-discuss/52ada5c3-e26e-4c8c-8= b3f-b55bb8ce8e1en%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter --=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/Y/CKGUKzXP0eIwSN%40localhost.