From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29248 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Harsh Donga Newsgroups: gmane.text.pandoc Subject: Re: FIguring out pandoc AST and types Date: Thu, 16 Sep 2021 04:52:13 -0700 (PDT) Message-ID: <68431aed-736c-425d-8745-14ffdc5468a9n@googlegroups.com> References: <4bd5ecbc-bd1d-442a-9558-6724174f77fcn@googlegroups.com> <3a59eb3c-352f-49f4-89f8-465aa7e86750n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1460_496760631.1631793133822" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="718"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBD75NRVM24GBB3W7RSFAMGQE6IQUCEA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 16 13:52:17 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oo1-f63.google.com ([209.85.161.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mQpw9-000AUt-3I for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 16 Sep 2021 13:52:17 +0200 Original-Received: by mail-oo1-f63.google.com with SMTP id w6-20020a4adec6000000b0028b7d13a4c8sf20868284oou.13 for ; Thu, 16 Sep 2021 04:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; 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=SAgEl8LhXhWF4Yp/tzWqhMqnn3bJxkmq9hg1WvTzu08=; b=HLXslBxW2v0YeTAO5+RHTzRui1CP7PzJQDnw/A0U6588Fn9slpCa4hU6dySTRtfyv1 PF4IlrN+0Yw+J0QKORP7+1ANMHx7KhctjaG4q/rapBX6zCh7ZvhAJIaG83IBOLaV4iz7 lT4qifrZdRfIlhexURnyMIXp/QNfzbsDUupLxwRH+j2TO8rAGHekhnlB9MakOK3V7bMS MShMtQPTkCNbsO2ZJj+PffadiRo1Wcv9cEzCufe8W5j28EBxH1YYJJ1mLKj7M6P5TS7A Y7XddN5GkcFXeMlkQ2kBbC0MROhJ+10NwtQnnyqleFalMnSDrxXeOGwHgTDoSZnXY0pA Vs1A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inclusivestem-org.20210112.gappssmtp.com; s=20210112; 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=SAgEl8LhXhWF4Yp/tzWqhMqnn3bJxkmq9hg1WvTzu08=; b=E4pkNhriAt/QCDIz89WUAr+eGwhcIR7FG3eBq7DC5/qyXXIMqmDFi79atXi7xoLrCs w5OC9wFc2u+H+nJlaB0xwv69HxW4zSEJJgNJOowS+7nflt2yC135NGLUPAPQhDHNhLRP fC3rsOrZkW5VyvS5ln5tjyalPUGDVwpB3lInKZVXS48KZ4GmRCCH5j4y2ZaIZDlA/BvS yvIYMGX7uKN1mz6yPArAEyCZjkcsghcYtAMTu9r2qbFKaRQNN2HEqhOMIjkClaGoPcSe qbyRazbYyUKkRhKw/oTEi9D0BrvV3vkYhloP+dgR6vSd89LUCjNtYSEoZVV6ySfeRWiX ePxA== 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: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=SAgEl8LhXhWF4Yp/tzWqhMqnn3bJxkmq9hg1WvTzu08=; b=4Ri2c9LdUgAwbtfYO1O5UxJg2Q7ms0QS4LT7Aih3CRXIEiSv3dsmLJYKk5vQEQIh3F KhV7A9MNI+ikwZ94vN8xS9DDHKeRceVV+0XFVlCIRRB6eCs9Uagcokr9LyYNnvUUM0pP /JcfShiJfX/GsdKJ14Lv4a4urqz580lKwwcC2ncXqNNxTFQfvnm5dw+JRPhySr/8dI94 KbYrexIekLWTR+PftVnbhyBn3Z63h4XdXtrCsjoUqoLXFmahoL4wbO03XXsd9rpBV0i0 lvyXI7vr2JzJXYW53Qx9+qEWGzDOvbvZXYsQeFaxRtohuPcl4kyxRSXIfQ4vLSfkQcZJ r0DQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530pzixJaOD8tnTTc6Vq4lEH05U1Tjhyw4A8p6HfMeC+BlDBmIRk rCmlyl/2+93ucNeC1IM3DkI= X-Google-Smtp-Source: ABdhPJzJ6YRUhpm+hVHRqcUU2Mjd6VeKyA0ovKSiBhtrBm/HjSgaa7hgEPE18OYSJZ9+Gi/gsfm/bA== X-Received: by 2002:a9d:12f:: with SMTP id 44mr4408932otu.342.1631793135736; Thu, 16 Sep 2021 04:52:15 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6830:2442:: with SMTP id x2ls1696475otr.3.gmail; Thu, 16 Sep 2021 04:52:14 -0700 (PDT) X-Received: by 2002:a9d:6192:: with SMTP id g18mr4256885otk.314.1631793134393; Thu, 16 Sep 2021 04:52:14 -0700 (PDT) In-Reply-To: X-Original-Sender: harsh-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@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:29248 Archived-At: ------=_Part_1460_496760631.1631793133822 Content-Type: multipart/alternative; boundary="----=_Part_1461_1435181729.1631793133822" ------=_Part_1461_1435181729.1631793133822 Content-Type: text/plain; charset="UTF-8" Thanks for continued support sir, I had few couple of doubts, What does Attr mean? And can you explain type Meta ?, it's going a bit over my head Thanks in advance! On Wednesday, 15 September 2021 at 05:09:35 UTC+5:30 John MacFarlane wrote: > Harsh Donga writes: > > > Thank you for your response, > > > > It is getting really hard for me to parse and build pandoc using pandoc > > types, as I am Haskell beginner. > > > > Please correct me if I am wrong, but the only way to see the JSON output > is > > by trying out pandoc? I mean for covering all the pandoc-types, I will > have > > to put everything in a document then parse using pandoc? > > And then figure out by looking at output how actually all types are > stored > > in JSON? > > There isn't complete documentation of the JSON format we use, > but it's all very regular and can be predicted from the AST given > a few examples. Pandoc can be used to give you those examples. > > Or, you can look at the ToJSON and FromJSON instance definitions > in the source code for Text.Pandoc.Definition and figure it out > from that. > > However, if what you want to do is to use Haskell to create a > pandoc AST, then you don't need to worry about JSON at all. JSON > is just a serialization format we use for communicating with > non-Haskell programs. For building a document, what you want is > Text.Pandoc.Builder, as I said. The documentation contains an > example to get you started. > -- 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/68431aed-736c-425d-8745-14ffdc5468a9n%40googlegroups.com. ------=_Part_1461_1435181729.1631793133822 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for continued support sir,

I had few couple of do= ubts,

What does Att= r mean?

And can you explain type Meta?, it's going a bit over my head
=
Thanks in advance!

On Wednesday, 15 September 202= 1 at 05:09:35 UTC+5:30 John MacFarlane wrote:
Harsh Donga <ha...-7+aFW328pE6p1wGUEcWPqti2O/JbrIOy@public.gmane.org> writes:

> Thank you for your response,
>
> It is getting really hard for me to parse and build pandoc using p= andoc=20
> types, as I am Haskell beginner.
>
> Please correct me if I am wrong, but the only way to see the JSON = output is=20
> by trying out pandoc? I mean for covering all the pandoc-types, I = will have=20
> to put everything in a document then parse using pandoc?
> And then figure out by looking at output how actually all types ar= e stored=20
> in JSON?

There isn't complete documentation of the JSON format we use,
but it's all very regular and can be predicted from the AST given
a few examples. Pandoc can be used to give you those examples.

Or, you can look at the ToJSON and FromJSON instance definitions
in the source code for Text.Pandoc.Definition and figure it out
from that.

However, if what you want to do is to use Haskell to create a
pandoc AST, then you don't need to worry about JSON at all. JSON
is just a serialization format we use for communicating with
non-Haskell programs. For building a document, what you want is
Text.Pandoc.Builder, as I said. The documentation contains an
example to get you started.

--
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/68431aed-736c-425d-8745-14ffdc5468a9n%40googlegroups.= com.
------=_Part_1461_1435181729.1631793133822-- ------=_Part_1460_496760631.1631793133822--