From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/26307 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Custom lua writers and standalone documents Date: Sun, 04 Oct 2020 08:12:34 -0700 Message-ID: References: <66e3e0f4-a77c-4ff6-b71e-68182d95ac2an@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="18429"; mail-complaints-to="usenet@ciao.gmane.io" To: William Lupton , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBB4GM475QKGQEBILGU2Y-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Sun Oct 04 17:12:52 2020 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 1kP5gx-0004hA-TP for gtp-pandoc-discuss@m.gmane-mx.org; Sun, 04 Oct 2020 17:12:51 +0200 Original-Received: by mail-qt1-f183.google.com with SMTP id b18sf4751895qto.4 for ; Sun, 04 Oct 2020 08:12:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1601824371; cv=pass; d=google.com; s=arc-20160816; b=Zjmv9mDoTdBVixSmepjp+J+E1QP29G4BpZPi+bie1FVt/sn02WwQSrTMO40SRVz8wa wAEHx2hl6amUp/pdrqjn+wDv3zQ4IpTC7vGGh85HKGcsP8zg7mWXQlemn8tx77vh6hcZ 8S589pjj72x3wLa9zVw8pXQDRheeJ/AfzlBOeTw2SS/aOeFhl4R3+cY1dYbFNqUfyB1V kxGy5B1CCkafREEKnFRCNpn96sJJBM52m+XH0nnGhqJtaZ5sZRissoqehDDZ9EdXlR/R uycrue7Rl0AQfCTIXifN3Gw9vADu25P3r6HaKTAPZ5XIaAdAsQ0IQ5kkQVh2tmFCp9lZ Snkw== 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=mmcJ5aqAZNH71TAu2QfPTxaxQ2J1j7Eawbo2JkD64Ag=; b=DeKauM9LfsqahHFsSK1BIYYxyd4KiFpL4FmresRzleoquHPp+1NZlLyQkmdM/xa7BY hQU7bYpaSznShtMDkecaNP14JXk7kJeRmeJJuaeYvJQ9CXE+turRTq7CyCeEb8iu141s CYayadhyrmONu2lauhUfkB4qsbSQmyqF/N1AoOORFe0voiST17M1xBMH/54LtljL7ELO HsNZKTQiqhOJO99dZqhor1W3j7V8U5aabsXtEJjU0OgbbtfdnIDYuOxifYv1JjR9m5EP D7h0CTheNyr4e/Zin+tYBY0Rf1sL0+TpJylziB43xnfFHuVBjFOVpjFwXojYaNzUcjTs s6AQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=Ud7RrIJT; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d 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=20161025; 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=mmcJ5aqAZNH71TAu2QfPTxaxQ2J1j7Eawbo2JkD64Ag=; b=EqMz21d2iu0Qo+0iOeo9qUfiGejmNACq97Poogx3CHOl8GYeIB8R7iuCStGJOK9yVV BwUqwutRE1fDoSzk3NVVNYBkcuaIk12gI+4bF/4lFgoY2ODgKUn/HY3ODs8n7go+8O2G q1b8IKcmeOf9WmRi44iOa5xCWVRy7jbXJdDxxa7dSuXt3UlDg8EM4luJ5jBZEAIvQau7 00eTMbSJPKPf77q35xHmLnm75sjs3ZZ9R0wCLXbBmWfb68pmXXMl6TpNv05XhNGdGE42 c1OKwLl8E1ITnj+KkJ535J8ypmmU0x/E8bU8GWQxgQGTJv2fNDexScE0piNIggv+ESRk 7nYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=mmcJ5aqAZNH71TAu2QfPTxaxQ2J1j7Eawbo2JkD64Ag=; b=hMu8O1a8xUCeJHfW8fUvi9dm0IfN+/HMY9d/+fvmbp8ubPYucQ4+8sXiIZGacwQ9u1 k8+3CPB5Ogb4oTgFqYdcFDREQWQrT3Qr8Em3B+TuQd367vSVkTRzPG07f6zl+0eeI89T Vz2++aO0AP3b05trZf1eFbZp2vkPEHaq6LckYtsHygk+mu9wNvWwIgcjdJnTlQs6e2fp L6Iv33KGb26bXxC85qS3PstG/7Lv1FzlauONJG0pLxj+57F0W3Uql/ivRvVZ2NXKnWzw 1duC1zGk7TPFRguNxNtRNoE5zEOqErUNTdwRKl8IQhf7uMrClF9xUx+LW/1uvwMp3Twx JT2g== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531Ug68+n8oxQ3nTW4adoSr3Oe7ZA5+mlk2Rf0JBTMykqW9CGsPE 9ny+Du156G04kc79dOJVrzI= X-Google-Smtp-Source: ABdhPJw/Q/FBeq1W8afAOMjmyrNOET4752V0YZ2pqcESc0G2fg0/e2sbRSbTMT4C6BRSL3mI4UD8Zg== X-Received: by 2002:ac8:5a44:: with SMTP id o4mr1335397qta.14.1601824370965; Sun, 04 Oct 2020 08:12:50 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:620a:228d:: with SMTP id o13ls3296401qkh.9.gmail; Sun, 04 Oct 2020 08:12:47 -0700 (PDT) X-Received: by 2002:a05:620a:128c:: with SMTP id w12mr10707055qki.355.1601824367731; Sun, 04 Oct 2020 08:12:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601824367; cv=none; d=google.com; s=arc-20160816; b=cADySeKi/jcRL9LwTxv7WvpGvueHUKVUHgvC/R+V4jqBwHi2nW66tdyDLdT5q3mU+L 31bSB0azfBifDKqgZ0UXe8NpA8kJm/Ga6/7p8h8FY7BIVil0vyyUFSYrTrJUvzi88NsC zILyk8KKv87wd4XIJqmqseDzt6/9dX1vDPi+9XNvwrK1ehV/E+3oLZPDx8+0MyGBdoOk r+qghdHOUChr8Dgn4EAnHYBVD/CIfqwNirloDB1wORrMUscYq26QTPWmNy8cukwI3U/p 97t4TvVeowpw+izLF8v6LwIzSA/fDrUKt0Kbda74PM18Q83wlQgb51Pu2RziBrmQdrU7 uLmA== 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=jXEZf9Z/vTP1JPTP7pMuHh0ShYFkI/6sJlBZyVPRqu8=; b=LUGJZcl+oSx5rS4SoYu/GpvIxbJTnWibLXA33EPU/JFsq9ih7Cm7hHnxpO7GIrTaB2 9CB1SRxf1gAKIvxHd0zOnJPcGedFGuTYh4hn6W1N/lm3DM3zUytbBP/OWKTnRXSZyjZX MZWroHXv++RxA6It6z7cLDwfREuaqTSgGfKCIPcKQQ5cH5dghmGe5pcu+RbYyv8cnxbx adQNRslid1xmU8qW5mHgrp2/VV/bgbWjlNuAt7MjPiLRI7YpYtMirMBCRWrJLuJfIAZb +nmpI24OvB4bwnA+6LlZnieoy7DBXcuc8jF3jL/wbFr8wCVJ5YNE7Z2xt3BcxSjReEPR oPfA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley-edu.20150623.gappssmtp.com header.s=20150623 header.b=Ud7RrIJT; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org Original-Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com. [2607:f8b0:4864:20::102d]) by gmr-mx.google.com with ESMTPS id a27si429420qtw.4.2020.10.04.08.12.47 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Oct 2020 08:12:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d as permitted sender) client-ip=2607:f8b0:4864:20::102d; Original-Received: by mail-pj1-x102d.google.com with SMTP id i3so3743365pjz.4 for ; Sun, 04 Oct 2020 08:12:47 -0700 (PDT) X-Received: by 2002:a17:90a:514e:: with SMTP id k14mr12556253pjm.48.1601824366622; Sun, 04 Oct 2020 08:12:46 -0700 (PDT) Original-Received: from johnmacfarlane.net (li55-134.members.linode.com. [74.82.3.134]) by smtp.gmail.com with ESMTPSA id 99sm7632580pjo.40.2020.10.04.08.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 08:12:45 -0700 (PDT) Original-Received: by johnmacfarlane.net (Postfix, from userid 1000) id 1204CA23F; Sun, 4 Oct 2020 11:12:35 -0400 (EDT) In-Reply-To: <66e3e0f4-a77c-4ff6-b71e-68182d95ac2an-/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=Ud7RrIJT; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::102d 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:26307 Archived-At: The table of contents is generated by the HTML writer. So, if you create a custom writer, you'll have to reproduce this functionality in your writer. William Lupton writes: > Hello, > > % pandoc --version > pandoc 2.9.2.1 > > I want to generate modified HTML for headers (to be specific, I want to add > a link to each header, like Sphinx does), so I decided to create a custom > lua writer. > > I started with the supplied sample.lua and modified the Header() function, > but I find (when I run with --standalone --table-of-contents) that I don't > get a ToC. And when I look at the variables in the Doc() function I don't > see 'toc' or 'table-of-contents'. > > Should I be able do this, or do I have to use my custom writer to generate > a fragment and then run pandoc again to process the fragment and generate > the ToC (I've tried this and it works)? > > Note: I tried to parse this comment in sample.lua Doc(), but am not clear > whether it's saying that I can use --template in the _same_ pandoc > invocation or whether I need to use a separate invocation: > * You could use the metadata table to fill variables in a custom lua > template. Or, pass `--template=...` to pandoc, and pandoc will do the > template processing as usual. > > I can supply more detailed info on request. > > Thanks, > William Lupton > > -- > 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/66e3e0f4-a77c-4ff6-b71e-68182d95ac2an%40googlegroups.com.