From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/29217 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: FIguring out pandoc AST and types Date: Thu, 09 Sep 2021 10:20:29 -0700 Message-ID: References: <4bd5ecbc-bd1d-442a-9558-6724174f77fcn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31363"; mail-complaints-to="usenet@ciao.gmane.io" To: Harsh Donga , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB24E5GEQMGQEYBNSZNQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Sep 09 19:20:47 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qt1-f183.google.com ([209.85.160.183]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mONjC-00080S-8k for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 09 Sep 2021 19:20:46 +0200 Original-Received: by mail-qt1-f183.google.com with SMTP id b24-20020ac86798000000b0029eaa8c35d6sf5901518qtp.1 for ; Thu, 09 Sep 2021 10:20:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631208044; cv=pass; d=google.com; s=arc-20160816; b=Dddq/rY5NDR6y24nw3cTzddpU+mBrLu97IsqO+YlqL4r/R1YnvNeKB1N8VzfmE/nXC sxIqCt31lXZAQlbf2eOnV8PvHvLeCEMVHGGXBKhGveLw12sz58gz5Nb3fK35S5kwTuLf MAQdA9rKWhW4+OBIU6uKT3qV8kJYT0Ip/N4wG4BnQCauDhr+u2MeLK0rRahKRGCB17cQ 4sRdyQSlqdc1nGhBAIKFfrEhcYx+kDON6GQGLV3OsSEfs6mVUVdeeVzjaEe4vt/qPB2L IS18ppuSzgDTIwwcHZ8CRBiFyeddYVrkSlB/W76R8HG3eqgwL4KbC28zaQkl+Otqspuz JDGQ== 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:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=7QbmpaAp6EAAqX5f5BrTsvw6yMzbUm7Y4zm/0YNyIh8=; b=DTJdw+V/OSq93H2TkPThIEa4/Yj4P72SMmspk5aUmXpQnfj/yn36X37rwCGqf49DtD SFYjCsyUvHxAaQyh/lY1qeQIF90jFnJrw/sg1120Yi3FctfRN4L0EBbxw+e0BZDxJwip KI1P4nN636dSafzAj60yKis9R7gIEFxQE7jSwRzVap7Qiifadgr1z9i7NSWV4SEVj/Wv XbyyrrlrNXzMRU4KhpzZfGy5e/y9auUAP05CrSGl7mNGiYR0z9rEtkt6YaBN85nc8hvd 8T96PkW/+OmbpNoFhvgj/0aeCwrgkwt21cJpvI53BoEdiwxaHQMudvDC/jJuXCE8ssE+ s5BQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=zQdRsh98; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52f as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version: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=7QbmpaAp6EAAqX5f5BrTsvw6yMzbUm7Y4zm/0YNyIh8=; b=SkuftuiSdMrB+KVDIaE7MqLq3eFwWxTLep6FeHWYqQxopSLQw68K+7yQXMTiXDg2Y9 nZZ70Gc5x7BcgHhJ4wbIF0Izi0Sf4iXUgH4HcRrpH77amkRLXJZSVM/CQtp07fzlieab GNAhiyTbaXyc79e5ZcsyG/3XuPqqlRxmrush1QeAYcmdk3dwgEaCEyor7wGWZw+q6RJc 9DceWX1Rda31yTd0PHnWwrpACxe+5EvpI5UvOXrwj0T9log/ePSaFlyrfxjzo8togcQx 7dG8lM8oAvbgHbMWTr7Vmd6MHIe2QMpOcUfvwuzwRSoYF1dTXL0OPAFs7JoXtJtzxS/c TLkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version: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=7QbmpaAp6EAAqX5f5BrTsvw6yMzbUm7Y4zm/0YNyIh8=; b=yXLc6ZBU7Gb3/g7IG7EEfd6wBdydQo2p5PToD+5o6o+j3n7JAySHVZ+JQ1TaQRiKLn Ql61r06AqXzRGJvHqBCEtx2Tyu7aldL/70KnvhyZ/ilqe5cbzoMfBuCK0p4vCGKrcViS eI9/CwhelMeq9roDkMF87yGBBGBkJAVJrupHDHsUVOI2Udu7+Sa8Vs/itqXif2h1Zbfj nyVMfbM0UUo4bCXyzFfjhF6iAwa+vepe/pAAE8nO8PbPOtAZGHSoSCMWrO68nGpiXdCq KJvq7gKyrfi+WWQpHK55dT+r+VaMrEGHBW4iC7g1lK2UVNAX7v9Lz+udx0CxLib7lUNd pLcw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM5304a9AdByzQzb/j8v4u0XqgPYq/lgt0Q81bVFntTEKr+W+DGI3E l+ECCyJo4eAPsUJ1ZYgf/AM= X-Google-Smtp-Source: ABdhPJzo/Tc3Bk0iog7PwSmeDtL8AungKZah/GJjJ8VbmSaRFte+JuTxO08cOVxNzDnjeLKN60Gd1g== X-Received: by 2002:a0c:d989:: with SMTP id y9mr3830580qvj.67.1631208044733; Thu, 09 Sep 2021 10:20:44 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a37:444c:: with SMTP id r73ls1584118qka.10.gmail; Thu, 09 Sep 2021 10:20:42 -0700 (PDT) X-Received: by 2002:a37:e06:: with SMTP id 6mr3829943qko.290.1631208042872; Thu, 09 Sep 2021 10:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631208042; cv=none; d=google.com; s=arc-20160816; b=YY4mQnrWcTC1FYpDypm7qv+00xCAgLvp9TaFPkXMUdeGzT9nCS+8U/8zYzsw03JZm0 OhAT2m191HA7hVaANaGShlZPlze8I4CSuNBZTmkXACdbf48ndc12/AN7yFHt9agOMbPt /r1vTGIircSLInyXHMgLm45lq5v9LhxChYmU1gdReIGAwHpp01bPMd7I+NkSfmYkos6M vq28flMR6aSyeZuvugy9BlVETtaEjcKxLno5fi6RF8dXD7L0OhtlpU+0b+SdK3A2Eiy9 KCzhPumnQYV8nKnVPPBzi/QWppL5cHjSu/2tpsZU6p3t9yYcXAF0B2/DxWyzL/kfYzd7 V+aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=PkLJN/aKhAI+Oy4KxbTxScsUnA/JCUvH+E5utihR8eI=; b=wboaDH0DYW+41JDL12nOlFp9UNq5i56/+x2Gy8m4LadeBLJRXjK0jEU+WR/46mdpH+ Q42alv7tYJ+FdtHz8fSlD2wUKh27JzxhVRegt8up3I626m3H/vZJeY94cfYbDW0ffsxi qfrgU230VgUFupVo7cK0kfg32hRI/4agkS1XvE6Qmonk2vD7LKsLCiah2CsVs2SaVfm7 rAvACSfB2IkAuYjrp+rZGGuZQQGnsb2gvDOgTeq/aGqv/8wwqlKUd+xy4OWYHrJs0Q+s dVLIhwIXZSZ1fIp3ZJafLDaZJgD6lCq1uMtDjB8eo0OWL/nrj2/ThS6U2gCwh7eoYGPO kD+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=zQdRsh98; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52f as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com. [2607:f8b0:4864:20::52f]) by gmr-mx.google.com with ESMTPS id b125si151160qkf.0.2021.09.09.10.20.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 10:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52f as permitted sender) client-ip=2607:f8b0:4864:20::52f; Original-Received: by mail-pg1-x52f.google.com with SMTP id f129so2476990pgc.1 for ; Thu, 09 Sep 2021 10:20:42 -0700 (PDT) X-Received: by 2002:a05:6a00:8d1:b0:416:4ed7:e4c3 with SMTP id s17-20020a056a0008d100b004164ed7e4c3mr4183013pfu.82.1631208041173; Thu, 09 Sep 2021 10:20:41 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id j4sm2837452pjc.46.2021.09.09.10.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 10:20:40 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id AD0D7A1A8; Thu, 9 Sep 2021 13:20:29 -0400 (EDT) In-Reply-To: <4bd5ecbc-bd1d-442a-9558-6724174f77fcn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=zQdRsh98; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52f as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@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:29217 Archived-At: Harsh Donga writes: > Okay, being new to Haskell some of the questions might seem vague and some > straightforward to you, I apologize in advance for that. > > 1. How can I create pandoc type variables, where exactly do I look if I > want to make a table object purely using Haskell then convert it to JSON > AST/other formats You want to look at https://hackage.haskell.org/package/pandoc-types-1.22/docs/Text-Pandoc-Builder.html > 2. How can I convert my own JSON (storing elements analogous to HTML) to > pandoc AST If it's a custom JSON format, then you'll need to parse it to a pandoc AST using a Haskell JSON parsing library (like aeson). Alternatively, you could convert your JSON format to the JSON serialization pandoc uses (which you can inspect using pandoc -t json). > 3. is there any way possible to make pandoc type variables using other > languages like JS, Python... As noted above, you can construct a JSON document that represents the pandoc AST; pandoc can then read this (pandoc -f json). To understand pandoc's JSON serialization, the best thing to use is pandoc itself. pandoc -t native will give you a look at the pandoc AST pandoc -f native -t json will show you how pandoc represents AST elements in JSON.