From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30662 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Pandoc 2.18 - Custom writer working example Date: Thu, 02 Jun 2022 10:43:00 +0200 Message-ID: <87bkvb5tay.fsf@zeitkraut.de> References: <8528d41a-d6dd-4ca7-b38a-13955a9d1eabn@googlegroups.com> <87fskn6345.fsf@zeitkraut.de> 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="33705"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRB2X24GKAMGQE33HP4DQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 02 11:05:51 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lf1-f63.google.com ([209.85.167.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nwgm7-0008d5-2N for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 02 Jun 2022 11:05:51 +0200 Original-Received: by mail-lf1-f63.google.com with SMTP id y12-20020a0565123f0c00b00477bab7c83asf2274719lfa.6 for ; Thu, 02 Jun 2022 02:05:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654160750; cv=pass; d=google.com; s=arc-20160816; b=YNgNHRjhb6NA97/TgTCVwXA4eirpzwP+25AVVe6/tUKOXZaeqQ2gOLCWkSPXrNRZaW ERKWKrbS2UmWV8a/zE2jqI2kjrV4T8vWYSK03jBAPgY1uHv0Yqs2hi7SQpmLV2YgdFtT 35QSZPpGAyknSxHcAkdotTcJ5n4o94Ak2h++jY71+2b5AbzK/oLHflSjVDFtqZHG588a C7dWrFkkgR7BpUwcvwWRMAqRHxr6RzLBFe7+v/wKpSssrRRFugvyztxgxEIXXZuyQaLO uWsNCnmxOkA7I13RBObr18q4STXIz5eVFz4iruGgiMOhhpgTfkbCp6qKX73T7P3Q/n+e 9pqg== 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:content-transfer-encoding :mime-version:message-id:in-reply-to:date:subject:to:from:references :sender:dkim-signature; bh=+yYcjbLmnG3wDRZtsDacy8kYx8rN68ux4v1NrFnit60=; b=l6F+64e46Aoq6lqhfAWkqFLXXu8TgIb2gDH3OvMJP1POMNTuL0iPc2QlbrbLuv8+LW a6qBt0voLjrjPLU0y/0/yIjPZ1anhT/fXZpOhang+EwELJvnrqB3PElZnDnCOD6mr/ln ch+w/uLj14GKl98XPWhdyfSsljm2ZMTCfs7PvYAGrbYnWlYST6VYKF2991wImjJkI+Dz H0B9J3vgjYaOEkg7n/c6ZdBgx+LrZp2ogdohxjvAPIiqcPcPwCNOl3Q9MKn4x7O+pZI1 ZVv14uJoEM8jTPh7hkEdp8ciie7agPauCqb+ahm0jvoI6+OTM7d5LuD9iwonPEAbhO4Q c1vQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::202 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:references:from:to:subject:date:in-reply-to:message-id :mime-version:content-transfer-encoding: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=+yYcjbLmnG3wDRZtsDacy8kYx8rN68ux4v1NrFnit60=; b=fVqiV17st9g/zkq1QD1eRAdCR62rFB/oghI6rkfrpia2KRz7CkxzRArP+KPQtrD7P6 //l3HKE53kdGvBvZic1rH3lvAt3oykMEGAwRs5vI1mo/1VBf9rNVhC2Am5WVKs0z5Na/ LGGt/kNa+LLLI4hmlzOokHxE0btcmFZM+9MoA+gfdWZy56I7f66M6CpmBwl0GL/psMPK 8hWG4HTxnX7TKQkgm7XXj3bSZwmgV+Ei2yZdTPzAS21iT6cSYRIpKagNzDG1Mv8WRZ0v tCnm8Efr+p37gcZASm6XK1VYIxLKKBMqSxMkFVZR56rGvlBCgVyCYCiTsCkhRbqkfycz sScA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:references:from:to:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding :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=+yYcjbLmnG3wDRZtsDacy8kYx8rN68ux4v1NrFnit60=; b=BYTdO9onJ0tU0yS/UfoarxbQgjCv4F/uTVvXC4ijDpojXG9h1cAGfjTwgjo4GHKXMU A1JUfLmaK07qIlXZAgCud8VF3PbEhMHoqCDGKxe2KNrQYG+SEknuQWqlBmv4tEGaSNqq a4w0gu/FYtQV0LjZR3FERglucloz/4tBiizb1oyRAVCGCy2qao7hxhQiFHMYfMi/NkKS t1RZK1/ayo2X+8TsANoF+01ZOusk5VDlW1gGb+58LbL0Gu/UVNn8r+xyGpSHqX+UmjQO D98PftYbGEcHnWaYFXkOkQmENLQUgOD8l/t6vSBw5PP6moH0nEMkYn/FEpmw8FJJs4Kv Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM533k2b5Lwm/0j0MYPZqX1vfXhHrKO7CzyE0iVfr5JhmHsZTAXuue X0wEDKyo84aIMSwqHUNhCgc= X-Google-Smtp-Source: ABdhPJw5uKspeb4WBsbJfRMYrntMwk3VTQH0EyoElnVIV6QVrma2eQ91DRzqsFOvGyP77cE1bhsTwg== X-Received: by 2002:a05:6512:c04:b0:478:f837:d813 with SMTP id z4-20020a0565120c0400b00478f837d813mr2935625lfu.17.1654160750557; Thu, 02 Jun 2022 02:05:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:10cb:b0:478:7256:822a with SMTP id k11-20020a05651210cb00b004787256822als379391lfg.3.gmail; Thu, 02 Jun 2022 02:05:45 -0700 (PDT) X-Received: by 2002:a05:6512:39d2:b0:478:5ad6:1989 with SMTP id k18-20020a05651239d200b004785ad61989mr2764695lfu.98.1654160745534; Thu, 02 Jun 2022 02:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654160745; cv=none; d=google.com; s=arc-20160816; b=rTQsNgVOdsKBZn4Wk9ex+WnS67+yHj4tmBJCkDq2KYR1br/kW5c8QRbSbiUGTeEvz9 ATp9SicLDDpVkBys9Vr45nA5s5XaWG1r8hfj+q4KMSQwE8Jt5A47MnXc9/So7q762+G7 sTF8D6KY+P+asPPYr2BqemM1Fcrwq2wPJIlUgWp1IjNw1kunFyrLIPyqqZAL7BuCYmDo /IzVYN8V3RFKnJ5I/WLPBc1hYLrW8vsc58mvKByFYlmIa7KFKJRfmC0blAYWvff5UdH3 tXrBGBN/oPSNorQZadwE1XFNfpN8fYo95HhDoijmxHlO1q5DIWQyJbENK3HBkd9MdB4L 5eFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:references; bh=JEgJeW2GSB/6TQnnqeM/4GcMUsYd81KvcxAeAVh/Dk8=; b=kI6co35ICcMYIx2KB5fUBPZfILmRJ/qeqbhuRt+ninrPaT0VdGKHa6v1B/vvMv7zBx /n2gbN0DaW28t3X44lucQSVrgkSkGA9gZ6NuHGFwSQ5mNv/HdJqQTkEu73WLIc7BloGC hSRAQn3epq+4nAiqzTcZkPfkDNwPSwcdAl/ty3ITdtA/iGtPRbjIOEGsV+l6NwW6dxA2 JzOnmMA6fSJ/s3cka3ZsyjZ9lOUbFd5hJHqdDcPV0wEjE/yVmy0WZ8JFlrIjlB5NuUo0 xui3FGNuDRmbLAq6FG2gTF3FMr6SUBV0ITaIcVNi6Ly95YS2TcWLcr6pUCknQdcFmI/B ln7g== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::202 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org. [2001:67c:2050:0:465::202]) by gmr-mx.google.com with ESMTPS id u23-20020a05651c131700b0024eee872899si201344lja.0.2022.06.02.02.05.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 02:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::202 as permitted sender) client-ip=2001:67c:2050:0:465::202; Original-Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4LDKqW2X6nz9spp for ; Thu, 2 Jun 2022 11:05:43 +0200 (CEST) In-reply-to: X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050:0:465::202 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@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:30662 Archived-At: Hi Felix, Felix SOEDJEDE writes: > 1/ Writer > Using --to=3Dsample.lua works when --standalone is not present and . > Otherwise I have this error: Could not find data file > templates/default.sample.lua Ah, right. With `--standalone` pandoc is looking for a template that matches the writer name. There isn't one of course. Just omit it. > Using --writer=3Dsample.lua does not work. > Error: "Unknown option --writer." Whoops, should have been `--write`. I'm cutting down on coffee, I guess it shows. =F0=9F=98=AC > 2/ Accessing variables in lua filter > I would like to have access to "variables" in lua filter. If you use `function Writer(doc, opts)`, then the variables are available via `opts.variables`. > I prefer not to use "function Writer" for now if possible. > Do you have any tips or working examples for that one? Do you mean an example of a classic custom writers? Pandoc has an example built-in, it's available via pandoc --print-default-data-file=3Dsample.lua Classic writers are generally a bit easier (IMHO). I'd recommend new- style writers if you either base the new writer on one that's already included in pandoc, or if you want to make use of the `pandoc.layout` module to get nicer looking output. Other than those cases, classic writers are frequently the better choice. Out of curiosity, what output format are planning to generate? Cheers, Albert --=20 Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 --=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/87bkvb5tay.fsf%40zeitkraut.de.