From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30687 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Custom readers and writer paths Date: Mon, 06 Jun 2022 09:58:10 -0700 Message-ID: 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="9780"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBJXE7CKAMGQEXDYR55Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Jun 06 18:58:17 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oi1-f185.google.com ([209.85.167.185]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nyG3V-0002GI-KA for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 06 Jun 2022 18:58:17 +0200 Original-Received: by mail-oi1-f185.google.com with SMTP id w3-20020acadf03000000b0032b02f1a1a0sf8756229oig.1 for ; Mon, 06 Jun 2022 09:58:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654534696; cv=pass; d=google.com; s=arc-20160816; b=y47Au2j5u6CAQOY/8Z8iBud02Q2bAi8i7YL37SD3FXNonmjd6kaDrGt7zoeKCFlXdt vGWMGYxqIdiSIwxQAiVIRDUkcSjV9ek9dyveh8WBqSXO8J9GlOWlswRN4YYMaGua1VLV OBvWAIJTGW44DdW2tz9i7LpmSf652R5o21EOWzkhjUAcIqgf6oyI4f2rLZQHcelo6him NcaONu3PCAckCPOLZPO4eDDT2uUc16BCiXeFNR6a9VE4sHlK7t7MSE/PmUceFYSNuFOo MrlByBq25ZOuagcj83rW28bPqlo+Y09/1klrvjxZIBVki0h/wWOrxfT31uT4HrhgFfHx Jm5g== 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:subject:to:from:sender:dkim-signature; bh=fcNrf3Ltq+x4ctmcTaUIiNycY96eaJ/xer6Qto+yHTw=; b=x7xCJoRdP3Ai0PEpIneef09K75ZKRRsX4xVPWF5zWXcKW9OJV8nSaW7E+0vYUjSLdk gLYjSCwLwARAWNKEXLkURUuq7ImkHGsEzp0gIqUHPFvr1xn01f7j6/mRh0GOdmaQaFNY XGy+inVQ4F1ZGWCqCbTf7n0hOtmD3dHjKBR3vCOKIDsbHPCcC0nZiY83QjOPSFlfcAjK 8eecJ9942qbIYO4lnxsyEpdn/rxoU1OnoEUlKpgQKEEhx1wOu7MZdOkqZyZWkkO4mZdB WIBWaEIhD4fcW2UQVcG/bQiDliYxSZmUDjIuplWX1uigAySMng/ZgnHolMDbwEmJj363 zcgg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=Cs6wFZPs; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject: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=fcNrf3Ltq+x4ctmcTaUIiNycY96eaJ/xer6Qto+yHTw=; b=OvIm7mgqDQUjc5TBjvJ0KLOdqGDmZCBCIP0zsJBKPn/MPZB1LeXpZW0xggfncX8v37 82jdd9xWS31gRMYOQ0lo/LruWJAZYrruy+siYc5chV9A8vJM6U97UDyJ0SG3EzVrc/1+ UZzM98kxMsHBWa/mEjFOpQ+c6t7Gjyu7hZvlex3EjO1cqI6KH0/hewasSVHZyKH9NjjN y7rkiWT2EU6CA+F83qe2Bnz1LXSt8LXAGfRpXEOybOxSsdijBUnvCsYqeGqbdiHFow0W rOljhD8ufclb+hLH4bQ7rOhVxtBqluuE05ZbO7RHPkHVeASIt3e0dtOZyZlT8gln+hLZ OM6Q== 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: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=fcNrf3Ltq+x4ctmcTaUIiNycY96eaJ/xer6Qto+yHTw=; b=ePpgFCP3eLp0CmMKCs4KN8v22W2zkoHtjFLjZ+7Fd3ahe90Rq8MzZust2ZdMQ8Ojsc 2GwLCYU4bHoYZ7ETaVYpxbUjSEa+e6p2TlynoEBhOtXefVa7Oj/cP1hnmSDSu7or+gr3 jhLjMBBn9725O7mJk58hlL1eOCTAWS2BsdpqvaWW++Rhto7UzVufiyNMv+g/Thex8Cr5 ZRiIVU+ZTH7qcNrK8UIOEgLBkCHCqg4AunijSf736j9WmRcsFDf8eR941DU/MOmldNnL S0wE8dDW6wjzrIgskb8ctRxPsMId9YT+YWvl0u3W4An58qVbd1FTWBhW6J468lVc6xJb fibg== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531m/dSGwnBG1ODgY1pCsRgj8KP1AuxTIT4hmjAD3DrkcSJbag/M 89Bn9TI1zmlM6qA5L/b+AOA= X-Google-Smtp-Source: ABdhPJyk8I8CJIrPE0ahWcVFNkaIITgYQXjyu3u3RRiJdCpVGYHMEShoM0DYZ7f2hjBFHDDjy0dTvw== X-Received: by 2002:a05:6870:c38c:b0:f1:ce0b:4dd3 with SMTP id g12-20020a056870c38c00b000f1ce0b4dd3mr31141894oao.12.1654534696650; Mon, 06 Jun 2022 09:58:16 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:23d2:b0:326:98c2:25a8 with SMTP id bq18-20020a05680823d200b0032698c225a8ls4309305oib.11.gmail; Mon, 06 Jun 2022 09:58:14 -0700 (PDT) X-Received: by 2002:aca:32d7:0:b0:32b:4437:baf0 with SMTP id y206-20020aca32d7000000b0032b4437baf0mr14836466oiy.204.1654534694410; Mon, 06 Jun 2022 09:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654534694; cv=none; d=google.com; s=arc-20160816; b=tiNJctv3Yg0Ok6C9A8WkAC7O6CHQmsiJlDbzvm1r4JGo/oAySGD/M31pRMe6OZiTTI vDDDm/3Tb8ztF1X1LRqOBK2NK53eQiNw64GbX+3Ku0F6kRaZrCaUX+4lxbWdqBKG9ooE F8LtbNLy3DxG8l6jn9bkZmI9lB6AWyexf/bXq0zybgSZkJ8jPwUxV1hUjfEFYwdULUP4 AgpqaurWoii8592hoSGNyue33AScrJxmRjs6dtMr1MA5nnvev5wIxBhyaAhHUhdUK6Ce egWvVGzHDT+J4Dpnxu4Nt9fTFAE8alQzdff8jVuzVYNq6Vwzo064OK4Fk3ZZ02nPJx7K I/DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:subject:to:from:dkim-signature; bh=Vr+TgaDZtlqfdW5TtAQRr6cLIhmPEbSIipfo3X7hIMo=; b=jRHlzIUN+746+IA/KMKMZZdl0X/iw09o0lqeHTpX3OVtHuaJDBgrT9Akz8I4UGSpSO iJGXfY8E14T8s3VaEt+h+sK08OPOSqqkIfA1sl8PQYh1uq6Dx4cvNmQ7kTweNLGR8n6s OxPuXDRtmtU4yZJHa2UnUtLAJWhj/wQIdzCmoFyUj11Sou02CiUhCjcF4BrFASBcQDtE kLIDYMytaxkt8Wo1y0sox3PCssu5gC2974o5cB6ahUE2dX5Wq95Ae7DNT2Qhdif3AAXh eGk0JYvIZAXNCNFgEHRgkBHU3C6/cg0HQ9fGEGHEN/g/p2NiFd90NwxcWi7xCdRhXVV9 EWDA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=Cs6wFZPs; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu Original-Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com. [2607:f8b0:4864:20::52d]) by gmr-mx.google.com with ESMTPS id r3-20020acada03000000b0032e4236c0afsi389304oig.3.2022.06.06.09.58.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jun 2022 09:58:14 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) client-ip=2607:f8b0:4864:20::52d; Original-Received: by mail-pg1-x52d.google.com with SMTP id y187so13394642pgd.3 for ; Mon, 06 Jun 2022 09:58:14 -0700 (PDT) X-Received: by 2002:a63:188:0:b0:3fd:f14a:b130 with SMTP id 130-20020a630188000000b003fdf14ab130mr931245pgb.461.1654534693280; Mon, 06 Jun 2022 09:58:13 -0700 (PDT) Original-Received: from hermes.johnmacfarlane.net ([45.32.92.108]) by smtp.gmail.com with ESMTPSA id v17-20020a634811000000b003c265b7d4f6sm10776306pga.44.2022.06.06.09.58.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 09:58:12 -0700 (PDT) Original-Received: by hermes.johnmacfarlane.net (sSMTP sendmail emulation); Mon, 06 Jun 2022 09:58:10 -0700 X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=Cs6wFZPs; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::52d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu 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:30687 Archived-At: I believe that currently one must specify the path to a custom Lua reader or writer: you can't put it in your data directory, as you can with a Lua filter, and it won't be found in your executable PATH. (Is that correct, Albert?) My question is whether we should change that. I think it could be quite convenient to allow custom readers and writers to be distributed as Lua rocks. You could then do `luarocks install cool-pandoc-writer` and it would put `cool-writer.lua` in the `bin` directory of your luarocks installation. Pandoc could then be trained to look in the executable path for a custom writer if it is not found locally. Alternatively, we could search a custom-writers and custom-readers subdirectory of the user data directory (as we do with filters). It is a little cumbersome to have to copy the default writer/reader somewhere and pass its path to pandoc. This may be good from a security point of view, however, as it makes it less likely that people will blindly use custom readers/writers from third parties, not realizing that a custom reader/writer could in principle do just about anything on your file system. A related question: would it be possible for pandoc to set up the Lua environment in which custom readers/writers are run so that it is "sandboxed," limiting I/O operations to (e.g.) a local directory, or perhaps logging I/O operations as pandoc warnings? Thoughts welcome. John