From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31741 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Multiple HTML file (chunked) output with template Date: Fri, 11 Nov 2022 14:30:01 +0000 Message-ID: References: <264eeee0-68c8-4389-a5c5-12563c6926f6n@googlegroups.com> <1ef6858a-0a37-4f5f-a88b-eff2479a8130n@googlegroups.com> <539db8b9-47f4-43b8-83d1-4b4c99dc3b3fn@googlegroups.com> <7f4b28ec-1e91-4228-ab03-fe58a2e5cf18n@googlegroups.com> <5e290d88-1c47-407d-819b-34a094d8b48fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000041435005ed32baf9" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29812"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBB5VYXGNQMGQEYXSV42I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Nov 11 15:30:20 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pj1-f64.google.com ([209.85.216.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1otV2x-0007Wp-0d for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 11 Nov 2022 15:30:19 +0100 Original-Received: by mail-pj1-f64.google.com with SMTP id v10-20020a17090a7c0a00b00215deac75b4sf2918609pjf.3 for ; Fri, 11 Nov 2022 06:30:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668177017; cv=pass; d=google.com; s=arc-20160816; b=r+p5lTePVZocGpAlYdzt5ofx/hdwfYboC5WDAm9DK9Bpd9+9ba3htCG9VHn+WP0ATu XeBKTZwg8WnN19wfuZmzND3GT1C/utqdPbjkFL/hp/yij4Wf5ANGSp6sqQpPo1AMmpkn kEvBGOZOu8j7r0pkA4qP1TDoQTBJk1PLa7o3jk/b/UOV/h9vu9zEdYIHJM2CgOhEJtl2 X2XGz9jPLI/lS5x4coxb6JW6XYVIY+LM7LoSe42rrhpBcK6JWyRl6IrVJyB/epdgtPpV WCyRzdFK31vkbGNcOPyr7TPMl2Cug6whrN0J5PDOiTvgE5R+HSFfmKJADa7drhr/5KmZ eDFQ== 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=vU3r51L4eVrrg3oQpcpMnKtLpF/yIjLh5M+KjErm+RM=; b=GUQ51sSTXZFDLlS/dQsVOVBK4WYPdg/hFgMkrTaSC/UWLRSZGX7piGjOcpmBHU/4Qj ldAIvGDuWKiCkMT++DYejTyLmg1NACyhhCEhyM9J2Zo5+Cwdjplu7oP2Q1WZJA2w45Um ZIsWuPWRgvpa35pTJIsO30CEx7bXXJdrEUCjNqilUfzNsj8iEpt/L+YcnqeYgbU6+/CQ FbQMiDeojkceX1KkAQtHy3F1dlV/ET4tpJW1eoYWpVh70UnFWFr+KE4nP54U6etWsLK9 946sXGdovWuwNbvLU+63fgymQumfgSjVL/qYMamX+0G9VdFHZIUcSz1KsQlhIrOlBnsI UTjg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=XucZ8+KD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::112f 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=vU3r51L4eVrrg3oQpcpMnKtLpF/yIjLh5M+KjErm+RM=; b=nH+CA1NKoJLk1YXuUKBLg2J+po67pMU9kpk4CLjNDnQ7Tpuil5cbuJBddKOX0yZk3M LD6Dqph1aYLGH1tYAyOPgkW3duYCnri/zcC/wqcyk8OdptaaCrvh7Of4gWr5kYLql5NE 08P1f2k3BosTSICMSmIjdx9X0+iZtOaJ/zYKbiCF62WqTY9rclZFntejmmdKtD0C7OMd 45fWOtBfdC9wNwJyiQs/03BUAogDV0sPpTC+A1j7iBb38VyrQdxjzGGslhTId0MmLjUw dxJwe72KP5vLW8XU0nZGnwK++ku0dZKuzjZDh6jm2m7EP7X4cetk4dTJNc2L3WbcCHKQ ZLJg== 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=vU3r51L4eVrrg3oQpcpMnKtLpF/yIjLh5M+KjErm+RM=; b=qV0IHzKI7cUxfIKykpU4MsvByOoM6F4siCMpzhzP0cPMAG6kuzXXJuEAufQ7ORaN+T ENnAVjzGVEwGVO48USrU6IBTccVrx3hRHkpjuOjO0sw3D3fP3asc9SQoD7yIeNFY0T/D Ia2xoHS3ZTTR/JaEXKLSAt24Pa0Qf7nvMQy7vtmHtfUdt3I7VpaJwlOIHqa1OVzoJCqk 6wgX+vTdvZWUrJAqvHe7jbG0QmXNjMt3Gy1sAYR9k87yruLzdD85KlPvESKnVgDrAdAv xNVWb74Z52JOqpiU1WRNIk2nmGW20BfEMEkrVQfAH/XM/Dy16/95pQiUifnW8m4 X-Gm-Message-State: ANoB5pl0XJ+EMLsPiafXKd2zTKza9CYugBCx57/zbAJaxIaIXbNL/Wjh cURUyz7BjFGoYqIlO6jyskc= X-Google-Smtp-Source: AA0mqf5CEhrrz4fzR343ClmNUbflddcfSQcczDQl4XyvNWBiis2ShNnWQNoNBBzwgd5A93/1n8x0qg== X-Received: by 2002:a62:e412:0:b0:563:1ef3:c920 with SMTP id r18-20020a62e412000000b005631ef3c920mr2950321pfh.30.1668177017591; Fri, 11 Nov 2022 06:30:17 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:3b41:b0:213:fe:7f8d with SMTP id t1-20020a17090a3b4100b0021300fe7f8dls6127232pjf.3.-pod-canary-gmail; Fri, 11 Nov 2022 06:30:13 -0800 (PST) X-Received: by 2002:a17:902:8647:b0:17f:63a3:cb48 with SMTP id y7-20020a170902864700b0017f63a3cb48mr2817514plt.123.1668177013826; Fri, 11 Nov 2022 06:30:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668177013; cv=none; d=google.com; s=arc-20160816; b=pwAlC8cp015E5bp7PvezbXXQxt8jVD0YHyRGz03ROwoR9NskAYdhcbEz1ya7E8Q3Wd yHQ9PTfFxtOQ7kRkNB0djH5tQf5yZxYokBKeVW5iaTMypfBCyD5R/n4aujzAJ/yDuZt3 zzKSAVcRLSgwx3O43YnZj6baLuE4v73AFkjqJcGEIochDegg3DrtpkYmc/OEJNu9hWQq aPEQz1IdDL1Pz4Mwc2Od2qQ5sget/QlbltdPmEiqDnOzujxhCU5ZBa8en5re1dt8DE0v 1jacc1EHGIISPpzyx2r8a24QeARfcpj/of/w54dZFQUpZWm2FVX2STQEUgZJfEsJ//V4 owag== 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=47gICeiStI+lsPNrJYRRpvrUtmit8eMOfEXWRmvpEAU=; b=mqeMblzq7f18SBy35eZygi33hNofhGnjc1iEzSC5isyBb1l/S/CCD1GyrsA4yIu2j2 SFWBJdrWUn+djx3uwwj3V8hpbYXqYi2Vjrwn8OHk7mrWd3u4+U2sqjY7sc8ixfPr+U1l d9myu0cDtLLFneDA7jH1RKw7YVMvvx+4uK6YTYrM3k7fkgaBgysf30UxDxx7LJ1ihJ/i OjNX+eagoWj5hC3XvXdPOOfiHO6CDsMGmEQsMMDB2JiTBJwWLVdI+n7adbJMRMWMrmnh wtytRAtMeAI4StYvPZuF5yJzVxe0NyFRlHNnLVni9pbbBPXzzkfqOUvIEIXvbFPDgiBZ UgeQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=XucZ8+KD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::112f 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-yw1-x112f.google.com (mail-yw1-x112f.google.com. [2607:f8b0:4864:20::112f]) by gmr-mx.google.com with ESMTPS id s4-20020a170903214400b0018712ccd6e0si138889ple.2.2022.11.11.06.30.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 06:30:13 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::112f as permitted sender) client-ip=2607:f8b0:4864:20::112f; Original-Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-36cbcda2157so45389177b3.11 for ; Fri, 11 Nov 2022 06:30:13 -0800 (PST) X-Received: by 2002:a81:13c1:0:b0:373:4460:e8bd with SMTP id 184-20020a8113c1000000b003734460e8bdmr2169620ywt.11.1668177012533; Fri, 11 Nov 2022 06:30:12 -0800 (PST) In-Reply-To: <5e290d88-1c47-407d-819b-34a094d8b48fn-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> 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=XucZ8+KD; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::112f 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:31741 Archived-At: --00000000000041435005ed32baf9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Inline... On Fri, 11 Nov 2022 at 14:01, Lu=C3=ADs de Sousa wrote: > Alright, it is working now, many thanks. The output HTML looks pretty > solid and well linked. Two questions: Great! 1. What is the purpose of the /dev/null bit in the second compile command? > That's what this remark in the README is referring to (rather obliquely): > Including the HTML via --include-in-header was a workaround I think, and might no longer be necessary. I think there was a problem with parsing HTML at one point, and this was a way of injecting HTML without passing it through pandoc. > 2. Could you share an HTML template? It would greatly facilitate the > design work. > I've added github-template.html (somewhat anonymised) to the gist. Next I will give it a try with a more elaborate document including > cross-references, citations, etc. Will report back on that. > You'll probably have noted that the writer attempts to fix cross-references so they reference the correct output file. Regards. > > On Friday, 11 November 2022 at 13:58:28 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org > wrote: > >> Oh, I'm so sorry! I hadn't tested exactly what I gave you (I'd put the >> contents of utils.lua into the writer for testing, but then put it into = a >> new file to share with you, so the writer didn't need to change), but I >> forgot to put 'return utils' at the bottom. >> >> I've now added this line: >> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-ut= ils-lua-L51 >> and this time I've tested it locally. Please try again. >> >> On Fri, 11 Nov 2022 at 12:33, Lu=C3=ADs de Sousa = wrote: >> >>> Hello again. I confirm those are the contents in line 38. I assume >>> utils.lua is being found, line 21 is now being parsed without error. >>> Anything else I can try? >>> >>> Thank you. >>> >>> On Thursday, 10 November 2022 at 18:06:06 UTC+1 >>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>> >>>> can you confirm what's in line 38 of the writer? if you haven't edited >>>> the file then it's this >>>> >>>> : >>>> >>>> local output_file_dir, output_file_base =3D utils.path.split(output_fi= le) >>>> >>>> can you confirm that you've also copied utils.lua and that it's being >>>> found? it should be calling the function at this line: >>>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-= utils-lua-L31 >>>> >>>> >>>> On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa >>>> wrote: >>>> >>>>> Thank you once more for keeping this going. I made some progress but >>>>> now there is an error with html-multi-writer.lua itself (log below). = I >>>>> never worked with Lua before, apologies if I am making something dumb= . >>>>> >>>>> $ wget >>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/log= ging.lua >>>>> --2022-11-10 17:28:08-- >>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/log= ging.lua >>>>> Resolving raw.githubusercontent.com (raw.githubusercontent.com)... >>>>> 185.199.111.133, 185.199.108.133, 185.199.110.133, ... >>>>> Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|1= 85.199.111.133|:443... >>>>> connected. >>>>> HTTP request sent, awaiting response... 200 OK >>>>> Length: 8173 (8,0K) [text/plain] >>>>> Saving to: =E2=80=98logging.lua=E2=80=99 >>>>> >>>>> logging.lua 100%[=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>] 7,98K >>>>> --.-KB/s in 0s >>>>> >>>>> 2022-11-10 17:28:08 (42,0 MB/s) - =E2=80=98logging.lua=E2=80=99 saved= [8173/8173] >>>>> >>>>> $ mkdir -p $HOME/.local/share/pandoc/filters >>>>> $ mv logging.lua $HOME/.local/share/pandoc/filters >>>>> $ export LUA_PATH=3D"$HOME/.local/share/pandoc/filters/?.lua;;" >>>>> $ pandoc multi-test.md -t html-multi-writer.lua -o >>>>> output/multi-test.html >>>>> Error running Lua: >>>>> html-multi-writer.lua:38: attempt to index a boolean value (local >>>>> 'utils') >>>>> stack traceback: >>>>> >>>>> >>>>> On Thursday, 10 November 2022 at 13:47:52 UTC+1 >>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>> >>>>>> I've updated the gist by adding utils.lua and updating the README. >>>>>> This should be sufficient for the writer to run without error (pleas= e let >>>>>> me know if not). >>>>>> >>>>>> Note that you'll also need to get logging.lua as described, and also >>>>>> note that any generated YAML files will be empty (I didn't want to s= hare my >>>>>> brain-dead YAML writer but there appear to be lua YAML writers out t= here >>>>>> that might work... anyway you might decide that you don't need the >>>>>> generated YAML... this depends on how you set up the make rules). >>>>>> >>>>>> I don't really want to create a repo for this (well... a gist _is_ a >>>>>> repo!) because I don't want (at this point) to provide any support f= or it >>>>>> (questions are OK though). I'm providing the gist just as a demo of = the >>>>>> approach. Maybe later... >>>>>> >>>>>> On Wed, 9 Nov 2022 at 18:28, William Lupton < >>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wrote: >>>>>> >>>>>>> Oh sorry, yes, utils is one of mine! I'll look into this tomorrow..= . >>>>>>> >>>>>>> On Wed, 9 Nov 2022, 16:03 Lu=C3=ADs de Sousa, >>>>>>> wrote: >>>>>>> >>>>>>>> Thank you very much for sharing, that looks very promising. >>>>>>>> >>>>>>>> Pandoc can't run the script though, says it can't find the utils >>>>>>>> package. I installed luarocks and with it lua-utils but the error = prevails: >>>>>>>> >>>>>>>> $ pandoc multi-test.md -t html-multi-writer.lua -o >>>>>>>> output/multi-test.html >>>>>>>> Error running Lua: >>>>>>>> html-multi-writer.lua:21: module 'utils' not found: >>>>>>>> no field package.preload['utils'] >>>>>>>> no file '/usr/local/share/lua/5.4/utils.lua' >>>>>>>> no file '/usr/local/share/lua/5.4/utils/init.lua' >>>>>>>> no file '/usr/local/lib/lua/5.4/utils.lua' >>>>>>>> no file '/usr/local/lib/lua/5.4/utils/init.lua' >>>>>>>> no file './utils.lua' >>>>>>>> no file './utils/init.lua' >>>>>>>> no file '/usr/local/lib/lua/5.4/utils.so' >>>>>>>> no file '/usr/local/lib/lua/5.4/loadall.so' >>>>>>>> no file './utils.so' >>>>>>>> stack traceback: >>>>>>>> html-multi-writer.lua:21: in main chunk >>>>>>>> >>>>>>>> P.S.: would you consider creating a repository for this work? I >>>>>>>> would like to automate the second stage with bash, shouldn't be to= o hard. >>>>>>>> >>>>>>>> On Monday, 7 November 2022 at 15:46:58 UTC+1 >>>>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>>>> >>>>>>>>> I've created this gist: >>>>>>>>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf >>>>>>>>> >>>>>>>>> I added a README.md and hope that there's enough info to get >>>>>>>>> going. Please let me know if not. >>>>>>>>> >>>>>>>>> (Please note that this writer does some other things too, which >>>>>>>>> might need to be stripped out. Also, it's an old-style writer... = I haven't >>>>>>>>> got around to updating it yet,) >>>>>>>>> >>>>>>>>> On Mon, 7 Nov 2022 at 09:22, Lu=C3=ADs de Sousa >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi there. That is precisely the kind of output I would like to >>>>>>>>>> have. Similar to what tools like mdBook produce. I would be glad= if you >>>>>>>>>> could share more details on that custom writer. >>>>>>>>>> >>>>>>>>>> Thank you and regards. >>>>>>>>>> >>>>>>>>>> On Friday, 4 November 2022 at 17:51:24 UTC+1 >>>>>>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>>>>>> >>>>>>>>>>> See https://usp.technology/specification for an example of how >>>>>>>>>>> the Broadband Forum has recently been publishing some specs. Th= is output is >>>>>>>>>>> generated via an html-multi-writer.lua custom writer that conta= ins the >>>>>>>>>>> logic for splitting the output into multiple files (based on he= ader level >>>>>>>>>>> and/or specific classes). The writer also takes care of generat= ing the >>>>>>>>>>> navigation bar that you see at the top and bottom of the pages.= The >>>>>>>>>>> multiple files are then passed through pandoc again (to add the= overall >>>>>>>>>>> sidebar ToC and the top/bottom navigation bars, and to generate= multiple >>>>>>>>>>> standalone docs). >>>>>>>>>>> >>>>>>>>>>> Please let me know if you'd like more details (the overall setu= p >>>>>>>>>>> is not very easily shareable, because it's heavily dependent on >>>>>>>>>>> rather complicated make rules, but I could probably share the c= ustom writer >>>>>>>>>>> and give some example command lines.) >>>>>>>>>>> >>>>>>>>>>> On Fri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Dear all, >>>>>>>>>>>> >>>>>>>>>>>> I am currently working on a long document that must served as = a >>>>>>>>>>>> web page. The single file output is becoming too slow and cumb= ersome for >>>>>>>>>>>> readers. I am aware this functionality is not available, but a= Feature >>>>>>>>>>>> Request is open [0]. >>>>>>>>>>>> >>>>>>>>>>>> In that issue there are some hints to this issue being >>>>>>>>>>>> addressable with a template [1]. I have tried many HTML templa= tes, but >>>>>>>>>>>> never seen one that would split a long document in a set of sm= all files. >>>>>>>>>>>> Would there be an example somewhere I could follow? Otherwise,= could >>>>>>>>>>>> someone provide a general idea of how such template would func= tion? >>>>>>>>>>>> >>>>>>>>>>>> Thank you. >>>>>>>>>>>> >>>>>>>>>>>> [0] https://github.com/jgm/pandoc/issues/6122 >>>>>>>>>>>> >>>>>>>>>>>> [1] >>>>>>>>>>>> https://github.com/jgm/pandoc/issues/6122#issuecomment-5835933= 40 >>>>>>>>>>>> >>>>>>>>>>>> -- >>>>>>>>>>>> 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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>>>> To view this discussion on the web visit >>>>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/264eeee0-68c8= -4389-a5c5-12563c6926f6n%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>> >>>>>>>>> To view this discussion on the web visit >>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/cb3753d7-e845-4= a72-a1aa-e93086a32f11n%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/1ef6858a-0a37-4f5= f-a88b-eff2479a8130n%40googlegroups.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, sen= d >>>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> >>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/pandoc-discuss/539db8b9-47f4-43b8-8= 3d1-4b4c99dc3b3fn%40googlegroups.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-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/pandoc-discuss/7f4b28ec-1e91-4228-ab0= 3-fe58a2e5cf18n%40googlegroups.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/5e290d88-1c47-407d-819b-= 34a094d8b48fn%40googlegroups.com > > . > --=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/CAEe_xxjk4tfW2iyU1%3DrikSnmTWN6kDGYneGcqYc2_1WdReSqUw%40mail= .gmail.com. --00000000000041435005ed32baf9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Inline...

=
On Fri, 11= Nov 2022 at 14:01, Lu=C3=ADs de Sousa <luis.a.de.sousa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Alright, it is working now, many than= ks. The output HTML looks pretty solid and well linked. Two questions:=C2= =A0

Great!

1. What is the purpose of the /d= ev/null bit in the second compile command?

That's what this remark in the README is referring to (rather obl= iquely):

>=C2=A0Including the HTML via --includ= e-in-header was a workaround I think, and might no longer be necessary.

I think there was a problem with parsing HTML at one = point, and this was a way of injecting HTML without passing it through pand= oc.
=C2=A0
2. Could you share an HTML template? It would greatly facilitate the = design work.

I've added=C2=A0github-template.html=C2=A0(somewhat anonymised)= to the gist.

Next I will give it a try with a more elaborate document in= cluding cross-references, citations, etc. Will report back on that.

You'll probably have noted that the = writer attempts to fix cross-references so they reference the correct outpu= t file.=C2=A0

Regards.

On Friday, 11 November 2022 at 13:5= 8:28 UTC+1 = wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:
Oh, I'm so sorry! I hadn't t= ested exactly what I gave you (I'd put the contents of utils.lua into t= he writer for testing, but then put it into a new file to share with you, s= o the writer didn't need to change), but I forgot to put 'return ut= ils' at the bottom.

I've now added this line:=C2= =A0https://gist.git= hub.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-utils-lua-L51 and= this time I've tested it locally. Please try again.

On Fri, 11 Nov 2022 at 12:33, Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Hell= o again. I confirm those are the contents in line 38. I assume utils.lua is= being found, line 21 is now being=C2=A0 parsed without error. Anything els= e I can try?=C2=A0

Thank you.

On Thursday, 10 Novemb= er 2022 at 18:06:06 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:
can you confirm what's in line 38 of the writer? if you haven= 't edited the file then it's this:

local output_file_dir, output_file_base =3D utils.path.split(out= put_file)

can you confirm that you'= ve also copied utils.lua and that it's being found? it should be callin= g the function at this line:=C2=A0https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fe= a4bf#file-utils-lua-L31


On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Thank you once mor= e for keeping this going. I made some progress but now there is an error wi= th html-multi-writer.lua itself (log below). I never worked with Lua before= , apologies if I am making something dumb.

$ wget https://raw.githubusercontent.c= om/wlupton/pandoc-lua-logging/main/logging.lua
--2022-11-10 17:28:08= -- =C2=A0https://raw.gith= ubusercontent.com/wlupton/pandoc-lua-logging/main/logging.lua
Resolv= ing raw.githubusercontent.com (raw.githubusercontent.com)= ... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...
Connecting to= raw.githubusercontent.com (raw.githubusercontent.com)|18= 5.199.111.133|:443... connected.
HTTP request sent, awaiting response...= 200 OK
Length: 8173 (8,0K) [text/plain]
Saving to: =E2=80=98logging.= lua=E2=80=99

logging.lua =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1= 00%[=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D>] =C2=A0 7,98K =C2=A0--.-KB/s =C2=A0 =C2=A0in 0s
2022-11-10 17:28:08 (42,0 MB/s) - =E2=80=98logging.lua=E2=80=99 saved= [8173/8173]

$ mkdir -p $HOME/.local/share/pandoc/filters
$ mv lo= gging.lua $HOME/.local/share/pandoc/filters
$ export LUA_PATH=3D"$H= OME/.local/share/pandoc/filters/?.lua;;"
$ pandoc multi-test.md -t = html-multi-writer.lua -o output/multi-test.html
Error running Lua:
ht= ml-multi-writer.lua:38: attempt to index a boolean value (local 'utils&= #39;)
stack traceback:


On Thursday, 10 November 2022 = at 13:47:52 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:=
I've updated the gist by adding utils.lua and updating the README. Th= is should be sufficient for the writer to run without error (please let me = know if not).

Note that you'll also need to get logg= ing.lua as described, and also note that any generated YAML files will be e= mpty=C2=A0(I didn't want to share my brain-dead YAML writer but there a= ppear to be lua YAML writers out there that might work... anyway you might = decide that you don't need the generated YAML... this depends on how yo= u set up the make rules).

I don't really want = to create a repo for this (well... a gist _is_ a repo!) because I don't= want (at this point) to provide any support for it (questions are OK thoug= h). I'm providing the gist just as a demo of the approach. Maybe later.= ..

On Wed, 9 Nov 2022 at 18:28, William Lupton = <wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org> wrote:
=
Oh sorr= y, yes, utils is one of mine! I'll look into this tomorrow...

=
On Wed, 9 = Nov 2022, 16:03 Lu=C3=ADs de Sousa, <luis.a....@gmai= l.com> wrote:
Thank you very much for sharing, that looks very promising.

Pandoc can't run the script though, says it can't find the= utils package. I installed luarocks and with it lua-utils but the error pr= evails:

$ pandoc multi-test.md -t html-multi-write= r.lua -o output/multi-test.html
Error running Lua:
html-multi-writer.= lua:21: module 'utils' not found:
=C2=A0 =C2=A0 no field package= .preload['utils']
=C2=A0 =C2=A0 no file '/usr/local/share/lu= a/5.4/utils.lua'
=C2=A0 =C2=A0 no file '/usr/local/share/lua/5.4= /utils/init.lua'
=C2=A0 =C2=A0 no file '/usr/local/lib/lua/5.4/u= tils.lua'
=C2=A0 =C2=A0 no file '/usr/local/lib/lua/5.4/utils/in= it.lua'
=C2=A0 =C2=A0 no file './utils.lua'
=C2=A0 =C2=A0= no file './utils/init.lua'
=C2=A0 =C2=A0 no file '/usr/loca= l/lib/lua/5.4/utils.so'
=C2=A0 =C2=A0 no file '/usr/local/lib/lu= a/5.4/loadall.so'
=C2=A0 =C2=A0 no file './utils.so'
stac= k traceback:
=C2=A0 =C2=A0 html-multi-writer.lua:21: in main chunk
P.S.: would you consider creating a repository for this work? = I would like to automate the second stage with bash, shouldn't be too h= ard.

On Monday, 7 November 2022 at 15:46:58 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:
I've created th= is gist:=C2=A0https://gist.= github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf

= I added a README.md and hope that there's enough info to get going. Ple= ase=C2=A0let me know if not.

(Please note that thi= s writer does some other things too, which might need to be stripped out. A= lso, it's an old-style writer... I haven't got around to updating i= t yet,)

On Mon, 7 Nov 2022 at 09:22, = Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<= /a>> wrote:
Hi there. That is precisely the kind of ou= tput I would like to have. Similar to what tools like mdBook produce. I wou= ld be glad if you could share more details on that custom writer.

<= /div>
Thank you and regards.

On Friday, 4 November 2022 at 17:51:24 UTC+1= wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:
See=C2=A0https://usp.technology/specification for = an example of how the Broadband Forum has recently been publishing some spe= cs. This output is generated via an html-multi-writer.lua custom writer tha= t contains the logic for splitting the output into multiple files (based on= header level and/or specific classes). The writer also takes care of gener= ating the navigation bar that you see at the top and bottom of the pages. T= he multiple files are then passed through pandoc again (to add the overall = sidebar ToC and the top/bottom navigation=C2=A0bars, and to generate multip= le standalone docs).

Please let me know if you'= ;d like more details=C2=A0(the overall setup is not very easily shareable, = because it's heavily dependent on rather=C2=A0complicated make rules, b= ut I could probably share the=C2=A0custom writer and give some example comm= and=C2=A0lines.)

On Fri, 4 Nov 2022 a= t 12:45, Lu=C3=ADs de Sousa <luis.a....@g= mail.com> wrote:
Dear all,

I am = currently working on a long document that must served as a web page. The si= ngle file output is becoming too slow and cumbersome for readers. I am awar= e this functionality is not available, but a Feature Request is open [0].= =C2=A0

In that issue there are some hints to this = issue being addressable with a template [1]. I have tried many HTML templat= es, but never seen one that would split a long document in a set of small f= iles. Would there be an example somewhere I could follow? Otherwise, could = someone provide a general idea of how such template would function?

Thank you.

--
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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/264= eeee0-68c8-4389-a5c5-12563c6926f6n%40googlegroups.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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/1ef= 6858a-0a37-4f5f-a88b-eff2479a8130n%40googlegroups.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 pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
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/5e290d88-1c47-407d-819b-34a094d= 8b48fn%40googlegroups.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_xxjk4tfW2iyU1%3DrikSnmTWN6kDGYneGc= qYc2_1WdReSqUw%40mail.gmail.com.
--00000000000041435005ed32baf9--