From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30225 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Newsgroups: gmane.text.pandoc Subject: Lua filter to change the order of a markdown file. Date: Tue, 15 Feb 2022 03:42:45 -0800 (PST) Message-ID: <4316bc46-9d6b-46b5-8eb7-39b5cb77975en@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_380_1588961383.1644925365016" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10732"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCXKXC6X6AJRBNVDV2IAMGQESVMUD4Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Feb 15 12:42:50 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f61.google.com ([209.85.210.61]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nJwEL-0002ct-Cu for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 15 Feb 2022 12:42:49 +0100 Original-Received: by mail-ot1-f61.google.com with SMTP id d6-20020a05683018e600b005a520280d3dsf12055405otf.20 for ; Tue, 15 Feb 2022 03:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=R9Uj2MkiFwzwA4d1HEvfUQgRbF3E/cu8AnM40PRgwO8=; b=iagzplujvfYzGl7LYviGnMZ/W5lu4gpiifBpzVOGh/oXdpgnm1vKG3M0UiBD13V79y yP1Y34wxd1HZqRb9JOI5NiLTZc83GsQJDyi7+7PA/MLkXiSL4Mj2psWDDMeVTxJH/P+3 1fKgkmToCUNhTG/sYGu2iEH86Sh4M6epprDNf/Ai2i+srMKmsK/tBrFBCeCR7+7ArwPC xiwyX/VuDxn4XlFCkgUnTr9271d6DF79qu6RRObv/ebWW8E4pSLEX3kB2VPUKukknQ+m nPI3sLEyXIlRYlVWhJT+L5GZ4k1WNYH7FmBgZtAB/OpwJHKH/y3w+454iyncGaP/9EMq v5dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:message-id:subject:mime-version:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=R9Uj2MkiFwzwA4d1HEvfUQgRbF3E/cu8AnM40PRgwO8=; b=m1WxneXdQqyjhYT/D7i1JDc4lFkRXr6+SWCARk8+AqTxAwafNVxh9F27FHGxTBJZvc FZCGJ/94x0dkR4sLafEHqoip4VZOtBtVNIzz6d+HiSuUP++GNzVdgktuM1ORjAS6e4pd HRMTir0nrZonrajPvRR2cap6XEdmESp7durqs7RWKLksaZss2x664Gicokcnkj2NKAH/ Z90kSXLLb2NyGJtLyKhxjadrA/YladuBgogjbf7Vlo1TweCtMAiSRhhgBfxgT+q/2DNV jBA9yXB98wPV2QE6KY1g38yUK7CUV0SnvyL0huOdsEygHh5IJPRY5lGEUJaxv9sa/K2t hMrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id: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=R9Uj2MkiFwzwA4d1HEvfUQgRbF3E/cu8AnM40PRgwO8=; b=EbrqI7rTDjZCFR1Kgg4PLSVttdQ/3lLpR1WO8hV1lV2K3ZCiwtILxBrIpjlQCfA/au B8gM/wFVQDpph6/Yd5zivRgAFhJZHmOlJJYiA6uZfUitSDhqnae98S0wbQFyKViv3EdV 5xrnB64ySagvdW4lqhTAfykqD73WYs4dBaNjp5KVaGAXDntHgfojRgosnDr48spm2yb2 1zj2ETzlTiOLMNQrwONGVyKBkJxh5kbdHDd7/qxt7trFu48CuMwCwnYlNWaGmoVToygV N9wMLKrHrKWIRjDTyeKkfhNtAGmbBurYXkjRCi0d3DOOfCBhLzhrtRRtlip6tScdmX3o xpTw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530WZb0nwiiWu+vW912cTbKnibuggp18SNhELw4iqJQ8WvfDKRbZ OJ2Ad+yzysK7nSX4JGPPA7w= X-Google-Smtp-Source: ABdhPJxOA7X5qM8FN6PbKE3VNCH/67prhrXZNa6BdlmRgEsZQx5Hx1VfP4CLN7dOfTJNb82XUiRypQ== X-Received: by 2002:a4a:3950:: with SMTP id x16mr213315oog.47.1644925368220; Tue, 15 Feb 2022 03:42:48 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6871:a8:: with SMTP id u40ls676936oaa.6.gmail; Tue, 15 Feb 2022 03:42:45 -0800 (PST) X-Received: by 2002:a05:6870:8883:b0:d3:6ffa:cf20 with SMTP id m3-20020a056870888300b000d36ffacf20mr62184oam.104.1644925365691; Tue, 15 Feb 2022 03:42:45 -0800 (PST) X-Original-Sender: johanneswit-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:30225 Archived-At: ------=_Part_380_1588961383.1644925365016 Content-Type: multipart/alternative; boundary="----=_Part_381_131962119.1644925365016" ------=_Part_381_131962119.1644925365016 Content-Type: text/plain; charset="UTF-8" Hi all, First of all, I am quite new to both Pandoc and Lua. So if there are any tips you have for getting to know them, they are very welcome. I am running into a problem while trying to write a Lua filter that would change the order of an existing markdown file. This file contains various sections (different translations of the same text), divided by headings which are followed by paragraphs. *Example*: # Heading 1 ## Heading 2, source text Lorem ipsum... ## Heading 2, translation 1 Lorem ipsum... ## Heading 2, translation 2 Lorem ipsum... I want to be able to change the order of the paragraphs *with* their headings. So displaying first the translations and then the source text for example. But when I look at the AST, the headers and para(graph)s are seperate blocks, so reordering the headers does not copy the corresponding paragraphs. Can anyone help me out? Kind regards, John -- 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/4316bc46-9d6b-46b5-8eb7-39b5cb77975en%40googlegroups.com. ------=_Part_381_131962119.1644925365016 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi all,

First of all, I am quite new to both Pandoc and Lua. So if t= here are any tips you have for getting to know them, they are very welcome.=

I am running into a problem while trying to write a Lua filter= that would change the order of an existing markdown file. This file contai= ns various sections (different translations of the same text), divided by h= eadings which are followed by paragraphs.

E= xample:
# Heading 1=
## Heading 2, s= ource text
Lorem= ipsum...

## Heading 2, tra= nslation 1
Lorem= ipsum...

## Heading 2, tra= nslation 2
Lorem= ipsum...

I want to be able to change the = order of the paragraphs with their headings. So displaying first the= translations and then the source text for example. But when I look at the = AST, the headers and para(graph)s are seperate blocks, so reordering the he= aders does not copy the corresponding paragraphs.

Can anyone help m= e out?

Kind regards,
John

--
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/4316bc46-9d6b-46b5-8eb7-39b5cb77975en%40googlegroups.= com.
------=_Part_381_131962119.1644925365016-- ------=_Part_380_1588961383.1644925365016--