From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30962 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: Adding own elements to pandoc AST Date: Wed, 13 Jul 2022 22:34:05 +0000 Message-ID: References: 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="40359"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBX4QXWLAMGQE3QKLRTI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jul 14 00:34:12 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f59.google.com ([209.85.167.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oBkvs-000AIo-2o for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 14 Jul 2022 00:34:12 +0200 Original-Received: by mail-lf1-f59.google.com with SMTP id p36-20020a05651213a400b004779d806c13sf5558227lfa.10 for ; Wed, 13 Jul 2022 15:34:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657751651; cv=pass; d=google.com; s=arc-20160816; b=iAIanToSNbBOXLpgnC/aBwsqw855GNHFs/KYTNyJMt61M9sYYsZGhkmLBIXhs2cRc6 ZiIbZwNcvVTW/ETahV5B1Ce5uk4GDQcKbGR6dCWF2uW8boVuRYLKp9WCLV2IvGNdcoGG F3PbNkpJ84VmF8y0Ng6O3KAYhNTDjMssxduAIfmS2RrhR6yvEqGX4Gv4TLyp1q5k9JuX 2+ESopCpG0K+eCVTgRioEwFwUN7W+tHLf9zQXcgCt/iwjRAoXcbytirheE1VfqHIHvMI KgaN6TbUw9tw1rNI12JuvW+LxFM8FCf5sK0PeM5d2Xy/QQ6zKKM44Y5AlOxGwmxcDHNd Jvnw== 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=9wMRMP0d7YvJlg50KI5jKXL8PS3AUcbaaR7TiffVKhY=; b=0mbPrr/7FfUUX+9BkJyeaDBSBKC+U8N/0aN3rUhqglag4zSUy6xp+3LtlilKpvvwVt Ig16NTTrXHlHyd3zZPip5UjBLiGmt7Apw+epO+LZoOoHoWAuaegGmojezeceh/9RI+rX /uQ0Qn8DMxTR0Az5J54xFE1EXSEiX12UvGulc/qTnCupCPgcEFQ07q+BqoYduCf6Pd2M 09bfjm2V5uF9Y5tQq3GAvNprzjf1/l6jduSbQ+DEWbF95wRzFPQns3vd1LwOvDvyLLhP O0YmBfekdEIygNPpxRB6HySt+KjAuRlHzo5uYKSROoheL6zb72QxJD3d42+sktajoQ89 DGag== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=BFZ1oS7B; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=9wMRMP0d7YvJlg50KI5jKXL8PS3AUcbaaR7TiffVKhY=; b=NgfQmg9MNYwHCLvDJKG9QHz7KFTM1o5C/OkejhjxLiWddQ/gYyZWA7NaAu2Ge9kmI9 Yzx69o/SGj8A8Ax5mg+vxCxh7w/c03QWIvlrP000W0yfflym+T7hkDPN/qfAMrILcjFA EKnSHOMfFDtY+82AabqODYZmV/JHyvPH+3r1eTZ2fXO5cIu6i7vAdeR14uqCUdawXt/R 6QgKr5m01lPW5J5NZNm2QE1XaLH7rGa8sTkbWP1cSz0m3wupNvwNGLUGnmqZFC90VZk8 FXn1+15+iAp2QARCecl6yxV38MSe1hyH7zGGZDuunji7spgVyo38ri9HTvq23cFJX+e3 q1LQ== 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:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=9wMRMP0d7YvJlg50KI5jKXL8PS3AUcbaaR7TiffVKhY=; b=SpXvxOSMZalJbuVfmBMYKahoD2b6cQBSBN3eTeLy7KVOZggQoGeudOxOKxHthYzfBt MfHdEb0KwdmPnHR1OhIogbrccpZ9FZr35cR8yRBSNKyKO6+ruGHYRKKSGRAFEULpm1sI +hzTYBq4ImsQKW3CH8woDU5G9uuzx3GLYs4gDxux5nxoj/7mGbrJf+ZdJWSQ8UQ0UrWA eTNx4JUHRZgBR0WD7dKojlg4piM/fb2NXb72SeIsgKPK7NHUHKH6+vxGLE8xmIrhiK6N 5/mt54H+vXXrSnzRFRQVFzK6BCt4vNjba8wyvtVFqito Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora9Wiu5rJaGr1CGbl3VA8NnTpHtGKkRRQOUkqCN3QQeTPk/shN4E ZES+vrCQyrVuQNEmuiutdLQ= X-Google-Smtp-Source: AGRyM1viez+MRDuWngB+3AKdfo0x7EUyIY+hspUdqe486gygbC/xQrDY+Ysz5IvHi+3DeIc8bixqRA== X-Received: by 2002:a2e:a591:0:b0:25d:7366:3344 with SMTP id m17-20020a2ea591000000b0025d73663344mr2975578ljp.242.1657751651435; Wed, 13 Jul 2022 15:34:11 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a2e:7e10:0:b0:25d:9138:6686 with SMTP id z16-20020a2e7e10000000b0025d91386686ls384044ljc.6.gmail; Wed, 13 Jul 2022 15:34:06 -0700 (PDT) X-Received: by 2002:a05:651c:a04:b0:25d:6c36:15b0 with SMTP id k4-20020a05651c0a0400b0025d6c3615b0mr2874208ljq.518.1657751646768; Wed, 13 Jul 2022 15:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657751646; cv=none; d=google.com; s=arc-20160816; b=x1pWn0OKOWFnXjsVPhnml8VZV8la87wehU3sAdR9+r6yRaJV+PGUXF1k41M+VpeQkD TOgerfcSHtVD78je6GexqimjtVdd5zEZfOLFWhrtDm1jZeN5XU5eDI5ppt30T5125rVo UrSQ7GetNvizXZbQJuyxtKRwhDNXyKEmCohrxl6slQOwvMcD8NI2pXU5QskpZ0+OMKo8 spTJL5pDu5Rngps/Sxd3SMQi/kks6Lv1bhJcrZhqzkkxbcXbLEZqRMZEFrrH9LO6TUT1 1/9oq5+JG2iGozR24v2cp5sBHRa0yHW6Ovb64a6fJHuShnJ4co9ecfa8VzXEREspzswP Gxtw== 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=lHZSPSPq8s9bsLnWQxmWvZa5VF+TeFrw12MFKHHpKQ8=; b=SIJzlZ7G/zwLZfX4jP54lxBIZXzCsNDxcImizCRgG8hqqhOZCZVNfSO2Lk7op7Pmb5 +Oqur3IMLV93TZIwHpYO1jyt8YD9wzt1uWMkPcRKsvtCuHIgPdEqEY6vmzbce4MkBFQr W6dQE4/s6WWh/aXuCP2K8eKDMtCB5nWm3q0O02s3zn6zlr2qUPcgHf1mtUf6WARsoskt dqUVtlxt9O2EY1g2qeTXBgo01ibdJXVBpxciJD9m1TJtdehGDv6CyAoej7oERgkkPj2j y045rJdB88ewP2Q9aZ5MHbj1TfuJRI/PlAlU22ITkvSDpAGhNiYtTQcCUUfk0g6EUZub vR/A== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=BFZ1oS7B; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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 mout02.posteo.de (mout02.posteo.de. [185.67.36.66]) by gmr-mx.google.com with ESMTPS id g7-20020a056512118700b00489d2421c05si1768lfr.4.2022.07.13.15.34.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 15:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) client-ip=185.67.36.66; Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2418724010C for ; Thu, 14 Jul 2022 00:34:06 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LjsqK5P6Lz6tm6 for ; Thu, 14 Jul 2022 00:34:05 +0200 (CEST) Content-Disposition: inline In-Reply-To: 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=BFZ1oS7B; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 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:30962 Archived-At: Is the content of the \gls macro always a one-word string (without spaces)?= If so, using the markup in your sample, you will end up with Str objects t= hat you can handle like this (in Lua, I don't speak Python but it should no= t be difficult to translate): ``` function Str(s) if string.match(s.text, '^gls:') then -- code to handle the string end return s end ``` Le Wednesday 13 July 2022 =C3=A0 11:05:33PM, A A a =C3=A9crit : > Dear all, >=20 > I have a use case where I would like to be able to add my own element to = the > pandoc AST such that I can use it in a panflute filter. This would be an = inline > element emulating LaTeX=E2=80=99s \gls{term} command from the glossaries.= sty package. >=20 > I envision the markdown to look something like this: >=20 > mentioning a gls:term from the glossary. >=20 > or something like this: >=20 > mentioning a gls(term) from the glossary >=20 > So the syntax would be very similar to LaTeX, but a bit more lightweight. >=20 > Is there a way to do this in pandoc? Inheriting from Block or Inline and > setting up custom syntax such that it can be processed by a Lua or Python > filter? >=20 > Thanks for your consideration. >=20 > Regards, >=20 > Amine >=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 [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [2]https://groups.google.com/d/m= sgid/ > pandoc-discuss/ > CAMwawgNgACJDXLyFAcx26iy4-71yOUD%2BHccx67%2BRgJB132D0_A%40mail.gmail.com. >=20 > References: >=20 > [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [2] https://groups.google.com/d/msgid/pandoc-discuss/CAMwawgNgACJDXLyFAcx= 26iy4-71yOUD%2BHccx67%2BRgJB132D0_A%40mail.gmail.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/Ys9IXXrcD4Nwmu6q%40localhost.