From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32042 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Lua filter to process chunkedhtml output Date: Fri, 20 Jan 2023 09:54:02 +0000 Message-ID: References: <1D22B433-211B-4033-8A63-F637F52B2008@gmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000027a56f05f2af0886" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="651"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBBR6JVGPAMGQEVZRPESY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 20 10:54:20 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f60.google.com ([209.85.128.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIo6E-000AWa-Om for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Jan 2023 10:54:18 +0100 Original-Received: by mail-wm1-f60.google.com with SMTP id fl5-20020a05600c0b8500b003db12112fdesf2727636wmb.5 for ; Fri, 20 Jan 2023 01:54:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674208458; cv=pass; d=google.com; s=arc-20160816; b=jx0i1GLihf90CT9scgSSzxPZcrjVMu6+sYP4O+GCDOcK4dq/8t3ZxIZJYVeksOVL83 XZ2tl7U9OtHBOEpGEWvHGUrcEp6AN7/0fXrne8aEEYDWvbI0vRLeB2GiMICHVMkTbhHV 7NrGwWiuPXJvkmieFJvAnVFpHjNFX1kppZORWuql/MlcvDnobcL16NWiqU+WUNQXAVlN y9K7gvscDeUZk0JalJBahh8ufoBuWWufBHk7zkxR9dMWs0nnLPQMyz+t0/w2vlUbx4cF GcIaau2etE9j5SInVT05AJNBPQFqb5SObucyDjfTF5GRPNMNyS2TAK6qr348Ek6paeEY EwOw== 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:to:subject:message-id:date :from:in-reply-to:references:mime-version:dkim-signature; bh=6P4c1/NMH6GOx7/swsn84M0qUd21As78wkAzmVKL3VM=; b=ZkmTrcC7LL9AO2h+8JfA3HgkWf0ig1X0R4UMJkwjL2MKc2WSOVnErR5DaRPJFSN4+Y 61zJ/haGooTP8VpArT/vxygpPovJlps8eH4Ba1nZvTytu75AzOVDpiMDfUZqaA6YHvo8 0T7HME1tedJJylu0MX3CA5Gp7JQzsWJ7KZNaM724tvh6jvBI47MZ0FmBesQa4O0iteri MU1x2oGVPNbpkDdlYIdYI6Dv4M7tQczb9RzdG+8TLmd4mkH8Y/K2QjmjMn6NFkkvJXT0 HobV8GIq26vMQYtPZj0TRj0cPuOu3p5Hhck/sVr3j8jqQ3wVU12LEcgkHT5MFVef4O5H eWlg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=pd9hxZrG; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version:from:to:cc :subject:date:message-id:reply-to; bh=6P4c1/NMH6GOx7/swsn84M0qUd21As78wkAzmVKL3VM=; b=jjfZx4jlP4MlIH07FS8tTo6Dch5K9v2i6OnYvqtB+qWLMnCTe/hEkTpcIzRFZNXeh1 oO+Pp4rbzX4EGVAUTF9kWq3O6/UeNwZkZlb8LHRXQav+lkKJriNH//zyLwsxrQOkpzoY ik4nV+VMww9W39YevbwZC6toCNaFNzJpfeimcUaTqZZU7frnA3LtRSxadc5EKas0wnD+ 1m5UB30h8CXl3c0v2FRrL1bDPYn9Fo8fYd1byWNs1IA4QXUpJuxsOH4BtoccnXZxBMKr PkZQnudoNjqkt6/pJpvqqQSTu6jOm7n9ZiVcwoH/o3cu0V4mP4Wvc7Jz4oAesPI2tsqj LxUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:to:subject :message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6P4c1/NMH6GOx7/swsn84M0qUd21As78wkAzmVKL3VM=; b=k/0k9kDBqIWg+jVI0zWo5978uki0SThyyk9inhJ9TAocrefx1wWmpNDN3rdWfHqEoU bmOVUOwQCz234z244GiuPDfo2vPRmBHUjxBxN7q2/odU0yBi/D5t0xRRUJbufyfMKqw5 lld0jGk2hK/vFXYlngZ84Kf9z34rhWV8nq8D434/y7wSMTRj40I09O+DjfiIoHMHXq9F /T9F/CYpq3oIhjyPBowg7G4YbV8e/ndiM/E+1e3ReyH6ex1NFdA0YzIBbWeNR3N/H6s+ JzOMR8wmFSB+6+bQg/QSAYkxthWYzYBSFwseHcEPQ11YAi5JnrxWentAV4E0WhQ X-Gm-Message-State: AFqh2kqVoO9CEZ7PNHegi5WH5ky4EeG8S8rveXxXat7dSpdeGSkcHJSg OBJMK6IiJL7S9xFUJBkfII4= X-Google-Smtp-Source: AMrXdXtrTez0h216RDhdJj5KlDqow1ykz2Uurca548s88xSadTQYjrFsO0aUa4Zjt54kGu+Rmxw+eQ== X-Received: by 2002:a05:600c:15cb:b0:3c6:bd12:ac68 with SMTP id v11-20020a05600c15cb00b003c6bd12ac68mr779417wmf.123.1674208458138; Fri, 20 Jan 2023 01:54:18 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:4f93:b0:3cf:9be3:73dd with SMTP id n19-20020a05600c4f9300b003cf9be373ddls4011489wmq.3.-pod-canary-gmail; Fri, 20 Jan 2023 01:54:14 -0800 (PST) X-Received: by 2002:a05:600c:3545:b0:3c6:e60f:3f4a with SMTP id i5-20020a05600c354500b003c6e60f3f4amr13496707wmq.1.1674208454407; Fri, 20 Jan 2023 01:54:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674208454; cv=none; d=google.com; s=arc-20160816; b=FcKiwgJG41o6y6xh/jlFHs9cmoI9Xh+zWdkcQ5Y6UA9vQ2HHo01WbcUqSnwWi4XLUF pHPgjCcPEF4NP5WTJC25vbdZKFCHAVnfKsfvaPnHPYTx3ec3AFg12Rm4zfCRPGJpb4W5 Z2hIPcVvdJr+9NfaHMTNrKcObjOj/7if46DSWRorfvjPveBemYcHCeS9IHNIefYPY+iw TqhjT2AMAudDwgJgFTjP9RrYGKrv36HL/2HyfdXhDJjgI6Xkjsn3PPRFeHBpqtZwCQKE RqjFFUtSRZ0bzMam50kdYCvCgX0iRXVa4sYPKwgge5L1FZtgKKobZf9o8xq1RKA0AmiO kobw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=cZgSEB5xwIIrqi0TZDAVvc2ntFN8Sa4142nZmYm3HT0=; b=PZLjNPGQjTtRgvU3G5Lzcv3fRK1E+N5pNJBb/W2m4u0TjTVKus9LdoTRcXUNcWIl8j n4XUNyENeocubF9UF4XR3Ve15glT2FBm0vKenhXwUJGpkgIpN6id1SoM/oOmsVcGQwaS YuING7mb8Gvb3bYyU4uR/bCW/MPqaGV1IcPfiwVsw/U6z1cYs0bzSceUMb6RDky/Vdhy syYXmYvbEs6ocb/3C1G5o/XI6lqTuRHjADNzbQu1DPp8/Km5UCqUQeH4SM9TX0S3OM/R 5NWPfz5MIyvNhMZLvMzQyNPHu9fDKJkUWnIjwehfp6ZYUyrCweb6wvGLCsbEsNgRCoc3 MJag== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=pd9hxZrG; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org Original-Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com. [2a00:1450:4864:20::62f]) by gmr-mx.google.com with ESMTPS id fl7-20020a05600c0b8700b003db110e1928si91024wmb.1.2023.01.20.01.54.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jan 2023 01:54:14 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62f as permitted sender) client-ip=2a00:1450:4864:20::62f; Original-Received: by mail-ej1-x62f.google.com with SMTP id ud5so12595365ejc.4 for ; Fri, 20 Jan 2023 01:54:14 -0800 (PST) X-Received: by 2002:a17:906:f895:b0:7c1:3382:4c87 with SMTP id lg21-20020a170906f89500b007c133824c87mr1220432ejb.403.1674208453552; Fri, 20 Jan 2023 01:54:13 -0800 (PST) In-Reply-To: X-Original-Sender: wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=pd9hxZrG; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62f as permitted sender) smtp.mailfrom=wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadband-forum.org X-Original-From: William Lupton 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:32042 Archived-At: --00000000000027a56f05f2af0886 Content-Type: text/plain; charset="UTF-8" Re this: > Also, I tried to print the value of PANDOC_WRITER_OPTIONS, but wlupton's logging.lua errors on it (bad argument #1 to 'for iterator' (table expected, got light userdata)) I investigated, and parts of the writer options are "light userdata" (I hadn't heard of that). I've committed and merged a fix that will report such items as "". You can now list most of the writer options (just a few colors show as ). I'm not sure whether the use of light userdata is intentional here (this isn't a 3.0 thing; it was already the case in previous versions). Albert? On Thu, 19 Jan 2023 at 21:32, ChrisD wrote: > On 1/19/2023 10:12 AM, John MacFarlane wrote: > > sitemap.json is really for processing with external tools. If you're > using a Lua filter, then you can use the new module > > https://pandoc.org/lua-filters.html#module-pandoc.structure > I started playing with this, but quickly got confused. > > Inside my lua filter, pandoc.structure is nil. Is this available in a > filter, or only in a custom writer? Should I be trying to write a custom > writer rather than a filter? > > Is there an example of getting or using the table of contents? > > Also, I tried to print the value of PANDOC_WRITER_OPTIONS, but wlupton's > logging.lua errors on it (bad argument #1 to 'for iterator' (table > expected, got light userdata)). I the tried the debugging printer I have > used in the past, kikito's inspect.lua, and it reports its value as " > ". How do I access writer_options from a filter (for example, > the toc-depth)? For what it's worth, I can print the value of > PANDOC_READER_OPTIONS. > > Thanks, > > -- > 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/f761231d-87ea-6bfb-38c3-99eb15184263%40intielectronics.com > . > -- 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/CAEe_xxiQAz2MVihALKGes6Ai%3DUrOPKgkvGq19ULiLsjBhTuTbQ%40mail.gmail.com. --00000000000027a56f05f2af0886 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Re this:

> Also, I tried to print th= e value of PANDOC_WRITER_OPTIONS, but wlupton's logging.lua errors on i= t (bad argument #1 to 'for iterator' (table expected, got light use= rdata))

I investigated, and parts of the write= r options are "light userdata" (I hadn't heard of that). I= 9;ve committed and merged a fix that will report such items as "<po= inter>". You can now list most of the writer options (just a few co= lors show as <pointer>).

I'm not sure wh= ether the use of light userdata is intentional here (this isn't a 3.0 t= hing; it was already the case in previous versions). Albert?
On Thu, 1= 9 Jan 2023 at 21:32, ChrisD <cd34-gg-4SSc53hpTiu9TMao6EloiEEOCMrvLtNR@public.gmane.org> wrote:
On 1/19/2023 10:12 AM, John MacFarlane wro= te:
> sitemap.json is really for processing with external tools. If you'= re using a Lua filter, then you can use the new module
> https://pandoc.org/lua-filters.html#= module-pandoc.structure
I started playing with this, but quickly got confused.

Inside my lua filter, pandoc.structure is nil.=C2=A0 Is this available in a= filter, or only in a custom writer? Should I be trying to write a custom w= riter rather than a filter?

Is there an example of getting or using the table of contents?

Also, I tried to print the value of PANDOC_WRITER_OPTIONS, but wlupton'= s logging.lua errors on it (bad argument #1 to 'for iterator' (tabl= e expected, got light userdata)). I the tried the debugging printer I have = used in the past, kikito's inspect.lua, and it reports its value as &qu= ot; <userdata 1>". How do I access writer_options from a filter = (for example, the toc-depth)? For what it's worth, I can print the valu= e of PANDOC_READER_OPTIONS.

Thanks,

--
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 pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d= /msgid/pandoc-discuss/f761231d-87ea-6bfb-38c3-99eb15184263%40intielectronic= s.com.

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAEe_xxiQAz2MVihALKGes6Ai%3DUrOPKgkvGq1= 9ULiLsjBhTuTbQ%40mail.gmail.com.
--00000000000027a56f05f2af0886--