From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31758 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: Tue, 15 Nov 2022 18:28:58 +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> <20b2a20b-69ad-4b93-863a-c70db01d45een@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002d91f105ed8688b4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22810"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBB55UZ6NQMGQEL6RB4YA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 15 19:29:16 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f64.google.com ([209.85.128.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ov0gN-0005iN-1W for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 15 Nov 2022 19:29:15 +0100 Original-Received: by mail-wm1-f64.google.com with SMTP id x10-20020a05600c420a00b003cfa33f2e7csf8668647wmh.2 for ; Tue, 15 Nov 2022 10:29:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668536954; cv=pass; d=google.com; s=arc-20160816; b=p4YfpzfPeEmbz1JH3xXLA04Zbz5OGnRS4jsRr8a/yDsO2KBB8E9yROcnhQuSVrdZWK Rt7wBAtVOhDj+W32GnxqlwAO2LLhr8cFCNPRjBmws/pYDRFUbpo6VksZbv1FzQ5rTCrG /HoSddlZC6I8voe+63hswAJLE+kgoWiCS4dvZwC66yF6amQ3fHY2oLcVXgkt4DhpysvJ Y6SSd2TDEZ2BEUB3K8mML7+rCy49hyJG7AhPL/uvH0FJeZ2g/o/+eW+elRcxQMuQVLDi O8rxokRC6Vg2H/83i8zLdObjz53lnPZWx/mToLIIG2hnNlXSYhI5sjgVpSKBSVik2s1J Ae1g== 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=06c+7lJglgScQgByngZCchleK8jZWZMRcOUd7zapTyQ=; b=eSwfz63Da+qppGiN0rOxGy63r6zJqKaDrx1OFLmQYbD6Un3gBN/jCyQ/uowDcCJSNO iuiIKWIIw8+m7xnKClGT0pHQOgQekpTY7wBFPK26NoRzs+Rh09LNqWcocDRQ7f+DTJ/9 EW/qfXCMoMxRQkWZ00rGia6w/BWV5sXsa/BYpZ7JQ63XlONUpFR51J4KMneSGypB/tV6 q+6dfRV4leWTINxpl9LfXS7STllZ7CCMMWguzkX23BjNxLAZ/wIdv7x+W2cUmP273473 lu8HH7TtD6alGYOOF02qGNA8xIaUP3Ll7gnUFPOfUR8Z93JipgkRb6qr/8jSUFXgk2u5 x8Sg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=BNNBF0Ib; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b 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=06c+7lJglgScQgByngZCchleK8jZWZMRcOUd7zapTyQ=; b=Bp4LHM/BIKA7O4FHqtC3dxcxnEPsT012KAFjN2jSR3GHu4iU9zwWsckbpFgNg1GuWG abXCL9ghh6Kgz5FpxVe86czWP5SMy5tVxiWxvl23p5NCgt401GdYQ26RSZ14u6HxfqWw LdtHPuFiT26eQ0txyH2mSBDrn8aUnxoR7/pzoTfBs7c2m9Q9REec7Tuo/Wf8Pgrzt4kX qWEKy+QhjUmPxzS6N9LYvtqnHec9NL2VuJ0U0CtEldKtXhQmGI4agQ/NSP5P6GOLxuBX kXBG4copux0JvYt6tFFoPszlIj31Gba5Vf5MRe98q/qBN1PWVJSupHgRIAHFfxlLUWSp R02g== 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=06c+7lJglgScQgByngZCchleK8jZWZMRcOUd7zapTyQ=; b=VuThjnknNJOwdnmrFJqdl9ckvL4WboA5TApOcHgkAGHIeDKrlMcd13AAMMSBGvoV7s sBJ///WN4D+j5T2EHUD9S7Qf+L9Jx/PyBvinplNxtM2Hif0ZDMoGcSbX7/3CTLdJm5Op EBdl5Fi60B0l4WkviAl1wpfKR3gyHN7T2JeqAqLw1B1SAmDr47oWsSXNM0ClEEHfAk9x 7mXIywflAe/+sx67/RCmRoH3Kwo+Wc+cGZ8/0xbBfynOYt8Av4LcNbI05BNEA0v19Ijf amsdS/qZnRtc5YoRJR487T+iEqEa+FVI4kHvmtDmiAXZqLQ5sj2uq/7vTOL0F9V X-Gm-Message-State: ANoB5pnJBRkcLDJ/VsaH0X0qG0MAcy0c3c7RByhHlChc6CPV+Sz62BWB nRwZIz+OoV9Q0y/m/VIHfLM= X-Google-Smtp-Source: AA0mqf7p7/pxn3pgAsTXQazc9T3PIEm+GGGw5vx03xzKcy+dLqYExCmLYzir0N3EXRJEfrPFM1liMg== X-Received: by 2002:a5d:52ca:0:b0:238:3d2b:44b4 with SMTP id r10-20020a5d52ca000000b002383d2b44b4mr12196415wrv.453.1668536954452; Tue, 15 Nov 2022 10:29:14 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a7b:ce96:0:b0:3cd:d7d0:14b6 with SMTP id q22-20020a7bce96000000b003cdd7d014b6ls7556991wmj.1.-pod-control-gmail; Tue, 15 Nov 2022 10:29:10 -0800 (PST) X-Received: by 2002:a05:600c:314a:b0:3cf:5237:c0be with SMTP id h10-20020a05600c314a00b003cf5237c0bemr2417540wmo.163.1668536950377; Tue, 15 Nov 2022 10:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668536950; cv=none; d=google.com; s=arc-20160816; b=J6U+3PRL+LAR/uX1xgWNvXXoj8Qo3zaxEwF3UY6Oc4+qZy0HGCak8u428Y3CKvI5Pp JzCY1RDOMOuBIsTUtQVAD3pFlWjuMJ91MrL/62epNHxVUsNS1iy/bId/RvzYsU/Hu23Y vIY+xyy1Qb1yk5p6a9i0uYqQZY0bhSPOwLYeXby/0liPrADAdW9MjGr8BJdqYHuGiffk TpC2Wnawvc0xGpu7j4Sg6Fb7ltr8Iw2MWbK2Dkd82qDnQP50QUMB8FNHqOmxMYpSyTcn 2upP5/RrTjB/7Fu+JA5K0sQUztRam+794mRQD2zdI+yMdSA6kRurevg6PeBkIoQE8III yoQw== 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=5eiA0/RtA4mELKCKsG/ylvppn1VNAUwP1b+X5tTwaP4=; b=WUjxbL3dAlJwLAGNbw5L5AiSZfMFjB3VQtsQn55hgmaMFdL7SWn4rwoyapNbDyYFQ8 yW6CpQOeQyRMrhdzn0uFsm5pPuFd0nGVclTueQGNdwZfPwp5qz4aiS9GiTnqCfLW0J5G cSgAElEf90Vmr4+N+AGoCYsKTHHgL2vp47+0NUVdHs6Kocw6Sh7TznlIpZKOE0JGKqHk GzJsHV1TOotqvt4eF4+cbDTFwoQjz8R0vdU6nfZOrwfxWpmvUM2MEx1MM6SmpDIkOd/a 6jHRVJSK6MehxERLZlshswj1ntxfkJVpcsMOAYDzAda0bnF9OtAHW19qMqqdZHv3flWN nwJA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=BNNBF0Ib; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b 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-x62b.google.com (mail-ej1-x62b.google.com. [2a00:1450:4864:20::62b]) by gmr-mx.google.com with ESMTPS id d11-20020adfef8b000000b0022f74ffaae6si428933wro.8.2022.11.15.10.29.10 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Nov 2022 10:29:10 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b as permitted sender) client-ip=2a00:1450:4864:20::62b; Original-Received: by mail-ej1-x62b.google.com with SMTP id t25so38175306ejb.8 for ; Tue, 15 Nov 2022 10:29:10 -0800 (PST) X-Received: by 2002:a17:906:495:b0:7ae:9188:ddc2 with SMTP id f21-20020a170906049500b007ae9188ddc2mr15077791eja.647.1668536949625; Tue, 15 Nov 2022 10:29:09 -0800 (PST) In-Reply-To: <20b2a20b-69ad-4b93-863a-c70db01d45een-/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=BNNBF0Ib; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2a00:1450:4864:20::62b 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:31758 Archived-At: --0000000000002d91f105ed8688b4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Well not really, apart from using a very simple input file. See below for an example (I've downloaded the template from the gist to github-template-gist.html and put it in the current directory). I'm wondering whether your problem might be that you're not supplying the needed metadata, so it _looks_ as though it's using the default template but in fact it isn't. I hope that you noted this comment in the README: - This is intended as a demo just to show the approach. It is not likely to be directly usable. In particular, all generated YAML files will currently be empty. Have you tried editing the template, e.g., to insert some arbitrary HTML, so you can be absolutely sure whether it's being used or not? % cat temp.md Document. % pandoc temp.md

Document.

% pandoc -s temp.md -o temp-default.html [WARNING] This document format requires a nonempty element. Defaulting to 'temp' as the title. To specify a title, use 'title' in metadata or --metadata title=3D"...". % pandoc -s --template github-template-gist.html temp.md -o temp-github.htm= l [WARNING] This document format requires a nonempty <title> element. Defaulting to 'temp' as the title. To specify a title, use 'title' in metadata or --metadata title=3D"...". % diff -w temp-default.html temp-github.html 1a2 > <!-- ORGANIZATION GitHub Pages pandoc template; modified from default.html template --> 164a166 > <!-- XXX header includes are included just before the ToC (below) --> 165a168 > 166a170,182 > <section class=3D"page-header"> > <h1 class=3D"project-name"> > <a href=3D"" style=3D"text-decoration: none; color: white;"> > <img src=3D"bbflogo-reverse-dark.png"/><br> > > </a> > </h1> > <h2 class=3D"project-tagline"></h2> > <p></p> > <p></p> > </section> > > <section class=3D"main-content"> 167a184,194 > <div style=3D"clear: both;"/> > <footer class=3D"site-footer"> > <span class=3D"site-footer-owner"> > </span> > <span class=3D"site-footer-credits"> > This page was generated by <a href=3D"https://pandoc.org">pandoc<= /a> > and <a href=3D"https://pages.github.com">GitHub Pages</a>. > <span class=3D"release"/> > </span> > </footer> > </section> On Tue, 15 Nov 2022 at 15:54, Lu=C3=ADs de Sousa <luis.a.de.sousa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org= > wrote: > Hi again Will, sorry for bothering you further. I so far failed to get th= e > template to work. I tried to add it to the data folder > ($HOME/.local/share/pandoc/templates/) but still nothing. Looks like the > default template is being applied no matter what. For instance, none of t= he > meta predicates in the head section ever make it to the final HTML. > > Would you have any suggestion to debug this issue? > > Thank you. > > On Friday, 11 November 2022 at 15:30:17 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org > wrote: > >> Inline... >> >> On Fri, 11 Nov 2022 at 14:01, Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> = 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 comman= d? >>> >> >> 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 >> <https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-g= ithub-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/nuMyEUIsrzH9SisXa4x6EXUF0@public.gmane.org= g >>> 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 int= o 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-= 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: >>>> >>>>> 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 >>>>>> <https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#fi= le-html-multi-writer-lua-L38> >>>>>> : >>>>>> >>>>>> local output_file_dir, output_file_base =3D >>>>>> utils.path.split(output_file) >>>>>> >>>>>> can you confirm that you've also copied utils.lua and that it's bein= g >>>>>> found? it should be calling the function at this line: >>>>>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#fil= e-utils-lua-L31 >>>>>> >>>>>> >>>>>> On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa <luis.a....@gmail.c= om> >>>>>> wrote: >>>>>> >>>>>>> Thank you once more for keeping this going. I made some progress bu= t >>>>>>> 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 du= mb. >>>>>>> >>>>>>> $ wget >>>>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/l= ogging.lua >>>>>>> --2022-11-10 17:28:08-- >>>>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/l= ogging.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)= |185.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 sav= ed [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 (ple= ase 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 wa= nt to >>>>>>>> share my brain-dead YAML writer but there appear to be lua YAML wr= iters out >>>>>>>> there that might work... anyway you might decide that you don't ne= ed 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 suppo= rt for it >>>>>>>> (questions are OK though). I'm providing the gist just as a demo o= f 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, <luis.a....@gmail.c= om> >>>>>>>>> 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 erro= r 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 = too 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/2fc23fc1c4e4b4899121bfafc0fea4b= f >>>>>>>>>>> >>>>>>>>>>> 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 <luis.a....@gma= il.com> >>>>>>>>>>> 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 gl= ad 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 spe= cs. This >>>>>>>>>>>>> output is generated via an html-multi-writer.lua custom write= r that >>>>>>>>>>>>> contains the logic for splitting the output into multiple fil= es (based on >>>>>>>>>>>>> header level and/or specific classes). The writer also takes = care of >>>>>>>>>>>>> generating the navigation bar that you see at the top and bot= tom of the >>>>>>>>>>>>> pages. The multiple files are then passed through pandoc agai= n (to add the >>>>>>>>>>>>> overall sidebar ToC and the top/bottom navigation bars, and t= o generate >>>>>>>>>>>>> multiple standalone docs). >>>>>>>>>>>>> >>>>>>>>>>>>> Please let me know if you'd like more details (the overall >>>>>>>>>>>>> setup is not very easily shareable, because it's heavily depe= ndent on >>>>>>>>>>>>> rather complicated make rules, but I could probably share the= custom writer >>>>>>>>>>>>> and give some example command lines.) >>>>>>>>>>>>> >>>>>>>>>>>>> On Fri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa < >>>>>>>>>>>>> luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Dear all, >>>>>>>>>>>>>> >>>>>>>>>>>>>> I am currently working on a long document that must served a= s >>>>>>>>>>>>>> a web page. The single file output is becoming too slow and = cumbersome 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 temp= lates, but >>>>>>>>>>>>>> never seen one that would split a long document in a set of = small files. >>>>>>>>>>>>>> Would there be an example somewhere I could follow? Otherwis= e, could >>>>>>>>>>>>>> someone provide a general idea of how such template would fu= nction? >>>>>>>>>>>>>> >>>>>>>>>>>>>> Thank you. >>>>>>>>>>>>>> >>>>>>>>>>>>>> [0] https://github.com/jgm/pandoc/issues/6122 >>>>>>>>>>>>>> >>>>>>>>>>>>>> [1] >>>>>>>>>>>>>> https://github.com/jgm/pandoc/issues/6122#issuecomment-58359= 3340 >>>>>>>>>>>>>> >>>>>>>>>>>>>> -- >>>>>>>>>>>>>> You received this message because you are subscribed to the >>>>>>>>>>>>>> Google Groups "pandoc-discuss" group. >>>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails fro= m >>>>>>>>>>>>>> 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-68= c8-4389-a5c5-12563c6926f6n%40googlegroups.com >>>>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/264eeee0-6= 8c8-4389-a5c5-12563c6926f6n%40googlegroups.com?utm_medium=3Demail&utm_sourc= e=3Dfooter> >>>>>>>>>>>>>> . >>>>>>>>>>>>>> >>>>>>>>>>>>> -- >>>>>>>>>>>> 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= -4a72-a1aa-e93086a32f11n%40googlegroups.com >>>>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/cb3753d7-e84= 5-4a72-a1aa-e93086a32f11n%40googlegroups.com?utm_medium=3Demail&utm_source= =3Dfooter> >>>>>>>>>>>> . >>>>>>>>>>>> >>>>>>>>>>> -- >>>>>>>>>> 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-4= f5f-a88b-eff2479a8130n%40googlegroups.com >>>>>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/1ef6858a-0a37-= 4f5f-a88b-eff2479a8130n%40googlegroups.com?utm_medium=3Demail&utm_source=3D= footer> >>>>>>>>>> . >>>>>>>>>> >>>>>>>>> -- >>>>>>> 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/539db8b9-47f4-43b8= -83d1-4b4c99dc3b3fn%40googlegroups.com >>>>>>> <https://groups.google.com/d/msgid/pandoc-discuss/539db8b9-47f4-43b= 8-83d1-4b4c99dc3b3fn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfoo= ter> >>>>>>> . >>>>>>> >>>>>> -- >>>>> 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/7f4b28ec-1e91-4228-a= b03-fe58a2e5cf18n%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/pandoc-discuss/7f4b28ec-1e91-4228-= ab03-fe58a2e5cf18n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfoote= r> >>>>> . >>>>> >>>> -- >>> 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/5e290d88-1c47-407d-819= b-34a094d8b48fn%40googlegroups.com >>> <https://groups.google.com/d/msgid/pandoc-discuss/5e290d88-1c47-407d-81= 9b-34a094d8b48fn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter> >>> . >>> >> -- > 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/20b2a20b-69ad-4b93-863a-= c70db01d45een%40googlegroups.com > <https://groups.google.com/d/msgid/pandoc-discuss/20b2a20b-69ad-4b93-863a= -c70db01d45een%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter> > . > --=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_xxg7Gy3Ag3gzwFO8855d%3D7JE%3DXqOw4C4HivpJkuB109y0w%40ma= il.gmail.com. --0000000000002d91f105ed8688b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Well not really, apart from using a very simple input file= . See below for an example (I've downloaded the template from the gist = to=C2=A0<span style=3D"font-family:monospace">github-template-gist.html</sp= an>=C2=A0and put it in the current directory).<div><br></div><div>I'm w= ondering whether your problem might be that you're not supplying the ne= eded metadata, so it _looks_ as though it's using the default template = but in fact it isn't. I hope that you noted this comment in the README:= </div><div><ul><li>This is intended as a demo just to show the approach. It= is not likely to be directly usable. In particular, all generated YAML fil= es will currently be empty.</li></ul></div><div>Have you tried editing the = template, e.g., to insert some arbitrary HTML, so you can be absolutely sur= e whether it's being used or not?</div><div><br><div><div><div><font fa= ce=3D"monospace">% cat temp.md<br>Document.<br><br></font></div><div><font = face=3D"monospace">% pandoc temp.md <br><p>Document.</p><br><br= ></font></div><div><font face=3D"monospace">% pandoc -s temp.md -o temp-def= ault.html<br>[WARNING] This document format requires a nonempty <title&g= t; element.<br>=C2=A0 Defaulting to 'temp' as the title.<br>=C2=A0 = To specify a title, use 'title' in metadata or --metadata title=3D&= quot;...".<br><br></font></div><div><font face=3D"monospace">%=C2=A0pa= ndoc -s --template github-template-gist.html temp.md -o temp-github.html<br= >[WARNING] This document format requires a nonempty <title> element.<= br>=C2=A0 Defaulting to 'temp' as the title.<br>=C2=A0 To specify a= title, use 'title' in metadata or --metadata title=3D"...&quo= t;.<br><br></font></div><div><font face=3D"monospace">% diff -w temp-defaul= t.html temp-github.html <br>1a2<br>> <!-- ORGANIZATION GitHub Pages p= andoc template; modified from default.html template --><br>164a166<br>&g= t; =C2=A0 <!-- XXX header includes are included just before the ToC (bel= ow) --><br>165a168<br>> <br>166a170,182<br>> =C2=A0 <section cl= ass=3D"page-header"><br>> =C2=A0 =C2=A0 <h1 class=3D&quo= t;project-name"><br>> =C2=A0 =C2=A0 =C2=A0 <a href=3D"&q= uot; style=3D"text-decoration: none; color: white;"><br>> = =C2=A0 =C2=A0 =C2=A0 =C2=A0 <img src=3D"bbflogo-reverse-dark.png&qu= ot;/><br><br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>> =C2=A0 =C2= =A0 =C2=A0 </a><br>> =C2=A0 =C2=A0 </h1><br>> =C2=A0 =C2= =A0 <h2 class=3D"project-tagline"></h2><br>> =C2= =A0 =C2=A0 <p></p><br>> =C2=A0 =C2=A0 <p></p><br= >> =C2=A0 </section><br>> <br>> =C2=A0 <section class=3D&= quot;main-content"><br>167a184,194<br>> =C2=A0 =C2=A0 <div st= yle=3D"clear: both;"/><br>> =C2=A0 =C2=A0 <footer class= =3D"site-footer"><br>> =C2=A0 =C2=A0 =C2=A0 <span class= =3D"site-footer-owner"><br>> =C2=A0 =C2=A0 =C2=A0 </span= ><br>> =C2=A0 =C2=A0 =C2=A0 <span class=3D"site-footer-credit= s"><br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 This page was generated by = <a href=3D"<a href=3D"https://pandoc.org">https://pandoc.org</a>&qu= ot;>pandoc</a><br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 and <a href= =3D"<a href=3D"https://pages.github.com">https://pages.github.com</a>&= quot;>GitHub Pages</a>.<br>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 <sp= an class=3D"release"/><br>> =C2=A0 =C2=A0 =C2=A0 </span&= gt;<br>> =C2=A0 =C2=A0 </footer><br>> =C2=A0 </section></= font><br></div></div></div></div></div><br><div class=3D"gmail_quote"><div = dir=3D"ltr" class=3D"gmail_attr">On Tue, 15 Nov 2022 at 15:54, Lu=C3=ADs de= Sousa <<a href=3D"mailto:luis.a.de.sousa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">luis.a.de.sousa@gma= il.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left= :1ex">Hi again Will, sorry for bothering you further. I so far failed to ge= t the template to work. I tried to add it to the data folder ($HOME/.local/= share/pandoc/templates/) but still nothing. Looks like the default template= is being applied no matter what. For instance, none of the meta predicates= in the head section ever make it to the final HTML.=C2=A0<div><br></div><d= iv>Would you have any suggestion to debug this issue?</div><div><br></div><= div>Thank you.<br><div><br></div></div><div class=3D"gmail_quote"><div dir= =3D"auto" class=3D"gmail_attr">On Friday, 11 November 2022 at 15:30:17 UTC+= 1 <a href=3D"mailto:wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org" target=3D"_blank">wlu...@br= oadband-forum.org</a> wrote:<br></div><blockquote class=3D"gmail_quote" sty= le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi= ng-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr"><div>Inline...</div><div><br= ></div></div><div class=3D"gmail_quote"></div></div><div dir=3D"ltr"><div c= lass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, 11 Nov 2= 022 at 14:01, Lu=C3=ADs de Sousa <<a rel=3D"nofollow">luis.a....@gmail.c= om</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= ">Alright, it is working now, many thanks. The output HTML looks pretty sol= id and well linked. Two questions:=C2=A0</blockquote><div><br></div></div><= /div><div dir=3D"ltr"><div class=3D"gmail_quote"><div>Great!</div></div></d= iv><div dir=3D"ltr"><div class=3D"gmail_quote"><div><br></div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli= d rgb(204,204,204);padding-left:1ex"><div>1. What is the purpose of the /de= v/null bit in the second compile command?</div></blockquote><div><br></div>= </div></div><div dir=3D"ltr"><div class=3D"gmail_quote"><div>That's wha= t this remark in the README is referring to (rather obliquely):</div><div><= br></div><div>>=C2=A0Including the HTML via --include-in-header was a wo= rkaround I think, and might no longer be necessary.</div><div><br></div><di= v>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.</div></div></div= ><div dir=3D"ltr"><div class=3D"gmail_quote"><div>=C2=A0</div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli= d rgb(204,204,204);padding-left:1ex"><div>2. Could you share an HTML templa= te? It would greatly facilitate the design work.</div></blockquote><div><br= ></div></div></div><div dir=3D"ltr"><div class=3D"gmail_quote"><div>I'v= e added=C2=A0<a href=3D"https://gist.github.com/wlupton/2fc23fc1c4e4b489912= 1bfafc0fea4bf#file-github-template-html" rel=3D"nofollow" target=3D"_blank"= >github-template.html</a>=C2=A0(somewhat anonymised) to the gist.</div></di= v></div><div dir=3D"ltr"><div class=3D"gmail_quote"><div><br></div><blockqu= ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px= solid rgb(204,204,204);padding-left:1ex"><div>Next I will give it a try wi= th a more elaborate document including cross-references, citations, etc. Wi= ll report back on that.<br></div></blockquote><div><br></div></div></div><d= iv dir=3D"ltr"><div class=3D"gmail_quote"><div>You'll probably have not= ed that the writer attempts to fix cross-references so they reference the c= orrect output file.=C2=A0</div><div><br></div><blockquote class=3D"gmail_qu= ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20= 4);padding-left:1ex"></blockquote></div></div><div dir=3D"ltr"><div class= =3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px = 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Reg= ards.<br><div><br></div></div><div class=3D"gmail_quote"><div dir=3D"auto" = class=3D"gmail_attr">On Friday, 11 November 2022 at 13:58:28 UTC+1 <a rel= =3D"nofollow">wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org</a> wrote:<br></div><blockquote cl= ass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid= rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">Oh, I'm so sorry! = I hadn't tested exactly what I gave you (I'd put the contents of ut= ils.lua into the writer for testing, but then put it into a new file to sha= re with you, so the writer didn't need to change), but I forgot to put = 'return utils' at the bottom.<div><br></div><div>I've now added= this line:=C2=A0<a href=3D"https://gist.github.com/wlupton/2fc23fc1c4e4b48= 99121bfafc0fea4bf#file-utils-lua-L51" rel=3D"nofollow" target=3D"_blank">ht= tps://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-utils-l= ua-L51</a> and this time I've tested it locally. Please try again.</div= ></div><br><div class=3D"gmail_quote"></div><div class=3D"gmail_quote"><div= dir=3D"ltr" class=3D"gmail_attr">On Fri, 11 Nov 2022 at 12:33, Lu=C3=ADs d= e Sousa <<a rel=3D"nofollow">luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br></di= v></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style= =3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding= -left:1ex">Hello again. I confirm those are the contents in line 38. I assu= me utils.lua is being found, line 21 is now being=C2=A0 parsed without erro= r. Anything else I can try?=C2=A0<div><br></div><div>Thank you.<br><br></di= v><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On Thur= sday, 10 November 2022 at 18:06:06 UTC+1 <a rel=3D"nofollow">wlu...@broadba= nd-forum.org</a> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D= "margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le= ft:1ex"><div dir=3D"ltr">can you confirm what's in line 38 of the write= r? if you haven't edited the file then it's <a href=3D"https://gist= .github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-html-multi-writer= -lua-L38" rel=3D"nofollow" target=3D"_blank">this</a>:<div><br></div><div><= font face=3D"monospace">local output_file_dir, output_file_base =3D utils.p= ath.split(output_file)<br></font></div><div><br></div><div>can you confirm = that you've also copied utils.lua and that it's being found? it sho= uld be calling the function at this line:=C2=A0<a href=3D"https://gist.gith= ub.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-utils-lua-L31" rel=3D"= nofollow" target=3D"_blank">https://gist.github.com/wlupton/2fc23fc1c4e4b48= 99121bfafc0fea4bf#file-utils-lua-L31</a></div><div><br></div></div><br><div= class=3D"gmail_quote"></div><div class=3D"gmail_quote"><div dir=3D"ltr" cl= ass=3D"gmail_attr">On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa <<a = rel=3D"nofollow">luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br></div></div><div cl= ass=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0= px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thank= you once more for keeping this going. I made some progress but now there i= s an error with html-multi-writer.lua itself (log below). I never worked wi= th Lua before, apologies if I am making something dumb.<div><br></div><div>= $ wget <a href=3D"https://raw.githubusercontent.com/wlupton/pandoc-lua-logg= ing/main/logging.lua" rel=3D"nofollow" target=3D"_blank">https://raw.github= usercontent.com/wlupton/pandoc-lua-logging/main/logging.lua</a><br>--2022-1= 1-10 17:28:08-- =C2=A0<a href=3D"https://raw.githubusercontent.com/wlupton/= pandoc-lua-logging/main/logging.lua" rel=3D"nofollow" target=3D"_blank">htt= ps://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging.lua<= /a><br>Resolving <a href=3D"http://raw.githubusercontent.com" rel=3D"nofoll= ow" target=3D"_blank">raw.githubusercontent.com</a> (<a href=3D"http://raw.= githubusercontent.com" rel=3D"nofollow" target=3D"_blank">raw.githubusercon= tent.com</a>)... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...<br>= Connecting to <a href=3D"http://raw.githubusercontent.com" rel=3D"nofollow"= target=3D"_blank">raw.githubusercontent.com</a> (<a href=3D"http://raw.git= hubusercontent.com" rel=3D"nofollow" target=3D"_blank">raw.githubuserconten= t.com</a>)|185.199.111.133|:443... connected.<br>HTTP request sent, awaitin= g response... 200 OK<br>Length: 8173 (8,0K) [text/plain]<br>Saving to: =E2= =80=98logging.lua=E2=80=99<br><br>logging.lua =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 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>] =C2=A0 7,98K =C2=A0--.-KB/s =C2= =A0 =C2=A0in 0s<br><br>2022-11-10 17:28:08 (42,0 MB/s) - =E2=80=98logging.l= ua=E2=80=99 saved [8173/8173]<br><br>$ mkdir -p $HOME/.local/share/pandoc/f= ilters<br>$ mv logging.lua $HOME/.local/share/pandoc/filters<br>$ export LU= A_PATH=3D"$HOME/.local/share/pandoc/filters/?.lua;;"<br>$ pandoc = multi-test.md -t html-multi-writer.lua -o output/multi-test.html<br>Error r= unning Lua:<br>html-multi-writer.lua:38: attempt to index a boolean value (= local 'utils')<br>stack traceback:<br></div><div><br><br></div><div= class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On Thursday, = 10 November 2022 at 13:47:52 UTC+1 <a rel=3D"nofollow">wlu...@broadband-for= um.org</a> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi= n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex= "><div dir=3D"ltr">I've updated the gist by adding utils.lua and updati= ng the README. This should be sufficient for the writer to run without erro= r (please let me know if not).<div><br></div><div>Note that you'll also= need to get logging.lua as described, and also note that any generated YAM= L files will be empty=C2=A0(I didn't want to share my brain-dead YAML w= riter but there appear 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 you set up the make rules).</div><div><br></div><div>I don&#= 39;t really want to create a repo for this (well... a gist _is_ a repo!) be= cause I don't want (at this point) to provide any support for it (quest= ions are OK though). I'm providing the gist just as a demo of the appro= ach. Maybe later...</div></div><div dir=3D"ltr"></div><br><div class=3D"gma= il_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, 9 Nov 2022 at 18:28= , William Lupton <<a rel=3D"nofollow">wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org</a>>= wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px = 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir= =3D"auto">Oh sorry, yes, utils is one of mine! I'll look into this tomo= rrow...</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail= _attr">On Wed, 9 Nov 2022, 16:03 Lu=C3=ADs de Sousa, <<a rel=3D"nofollow= ">luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br></div><blockquote class=3D"gmail_q= uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2= 04);padding-left:1ex">Thank you very much for sharing, that looks very prom= ising.<div><br></div><div>Pandoc can't run the script though, says it c= an't find the utils package. I installed luarocks and with it lua-utils= but the error prevails:</div><div><br></div><div>$ pandoc multi-test.md -t= html-multi-writer.lua -o output/multi-test.html<br>Error running Lua:<br>h= tml-multi-writer.lua:21: module 'utils' not found:<br>=C2=A0 =C2=A0= no field package.preload['utils']<br>=C2=A0 =C2=A0 no file '/u= sr/local/share/lua/5.4/utils.lua'<br>=C2=A0 =C2=A0 no file '/usr/lo= cal/share/lua/5.4/utils/init.lua'<br>=C2=A0 =C2=A0 no file '/usr/lo= cal/lib/lua/5.4/utils.lua'<br>=C2=A0 =C2=A0 no file '/usr/local/lib= /lua/5.4/utils/init.lua'<br>=C2=A0 =C2=A0 no file './utils.lua'= <br>=C2=A0 =C2=A0 no file './utils/init.lua'<br>=C2=A0 =C2=A0 no fi= le '/usr/local/lib/lua/5.4/utils.so'<br>=C2=A0 =C2=A0 no file '= /usr/local/lib/lua/5.4/loadall.so'<br>=C2=A0 =C2=A0 no file './util= s.so'<br>stack traceback:<br>=C2=A0 =C2=A0 html-multi-writer.lua:21: in= main chunk<br><br></div><div>P.S.: would you consider creating a repositor= y for this work? I would like to automate the second stage with bash, shoul= dn't be too hard.</div><div><br></div><div class=3D"gmail_quote"><div d= ir=3D"auto" class=3D"gmail_attr">On Monday, 7 November 2022 at 15:46:58 UTC= +1 <a rel=3D"noreferrer nofollow">wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org</a> wrote:<br>= </div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b= order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">I&= #39;ve created this gist:=C2=A0<a href=3D"https://gist.github.com/wlupton/2= fc23fc1c4e4b4899121bfafc0fea4bf" rel=3D"nofollow noreferrer" target=3D"_bla= nk">https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf</a><di= v><br></div><div>I added a README.md and hope that there's enough info = to get going. Please=C2=A0let me know if not.</div><div><br></div><div>(Ple= ase note that this writer does some other things too, which might need to b= e stripped out. Also, it's an old-style writer... I haven't got aro= und to updating it yet,)</div></div><br><div class=3D"gmail_quote"></div><d= iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, 7 No= v 2022 at 09:22, Lu=C3=ADs de Sousa <<a rel=3D"nofollow noreferrer">luis= .a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br></div></div><div class=3D"gmail_quote"><= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">Hi there. That is precisel= y the kind of output I would like to have. Similar to what tools like mdBoo= k produce. I would be glad if you could share more details on that custom w= riter.<div><br></div><div>Thank you and regards.<br><br><div class=3D"gmail= _quote"><div dir=3D"auto" class=3D"gmail_attr">On Friday, 4 November 2022 a= t 17:51:24 UTC+1 <a rel=3D"nofollow noreferrer">wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org<= /a> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0= px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div = dir=3D"ltr"><div>See=C2=A0<a href=3D"https://usp.technology/specification" = rel=3D"nofollow noreferrer" target=3D"_blank">https://usp.technology/specif= ication</a> for an example of how the Broadband Forum has recently been pub= lishing some specs. This output is generated via an html-multi-writer.lua c= ustom writer that contains the logic for splitting the output into multiple= files (based on header level and/or specific classes). The writer also tak= es care of generating 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=C2=A0bars, and to= generate multiple standalone docs).</div><div><br></div><div>Please let me= know if you'd like more details=C2=A0(the overall setup is not very ea= sily shareable, because it's heavily dependent on rather=C2=A0complicat= ed make rules, but I could probably share the=C2=A0custom writer and give s= ome example command=C2=A0lines.)</div></div><br><div class=3D"gmail_quote">= </div><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On F= ri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa <<a rel=3D"nofollow noreferr= er">luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br></div></div><div class=3D"gmail_= quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;= border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<div><br>= </div><div>I am currently working on a long document that must served as a = web page. The single file output is becoming too slow and cumbersome for re= aders. I am aware this functionality is not available, but a Feature Reques= t is open [0].=C2=A0</div><div><br></div><div>In that issue there are some = hints to this issue being addressable with a template [1]. I have tried man= y HTML templates, but never seen one that would split a long document in a = set of small files. Would there be an example somewhere I could follow? Oth= erwise, could someone provide a general idea of how such template would fun= ction?</div><div><br></div><div>Thank you.</div><div><br></div><div>[0]=C2= =A0<a href=3D"https://github.com/jgm/pandoc/issues/6122" rel=3D"nofollow no= referrer" target=3D"_blank">https://github.com/jgm/pandoc/issues/6122</a></= div><div><br></div><div>[1]=C2=A0<a href=3D"https://github.com/jgm/pandoc/i= ssues/6122#issuecomment-583593340" rel=3D"nofollow noreferrer" target=3D"_b= lank">https://github.com/jgm/pandoc/issues/6122#issuecomment-583593340</a><= /div> <p></p></blockquote></div><div class=3D"gmail_quote"><blockquote class=3D"g= mail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204= ,204,204);padding-left:1ex"> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"nofollow noreferrer">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a= >.<br> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/264eeee0-68c8-4389-a5c5-12563c6926f6n%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow norefer= rer" target=3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/264= eeee0-68c8-4389-a5c5-12563c6926f6n%40googlegroups.com</a>.<br> </blockquote></div> </blockquote></div></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"nofollow noreferrer">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a= >.<br></blockquote></div><div class=3D"gmail_quote"><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex"> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/cb3753d7-e845-4a72-a1aa-e93086a32f11n%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow norefer= rer" target=3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/cb3= 753d7-e845-4a72-a1aa-e93086a32f11n%40googlegroups.com</a>.<br> </blockquote></div> </blockquote></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"noreferrer nofollow">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a= >.<br> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/1ef6858a-0a37-4f5f-a88b-eff2479a8130n%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"noreferrer nofol= low" target=3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/1ef= 6858a-0a37-4f5f-a88b-eff2479a8130n%40googlegroups.com</a>.<br> </blockquote></div> </blockquote></div> </blockquote></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"nofollow">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br></blo= ckquote></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa= dding-left:1ex"> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/539db8b9-47f4-43b8-83d1-4b4c99dc3b3fn%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" target= =3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/539db8b9-47f4-= 43b8-83d1-4b4c99dc3b3fn%40googlegroups.com</a>.<br> </blockquote></div> </blockquote></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"nofollow">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br></blo= ckquote></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa= dding-left:1ex"> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/7f4b28ec-1e91-4228-ab03-fe58a2e5cf18n%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" target= =3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/7f4b28ec-1e91-= 4228-ab03-fe58a2e5cf18n%40googlegroups.com</a>.<br> </blockquote></div> </blockquote></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a rel=3D"nofollow">pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br></blo= ckquote></div></div><div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote= class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so= lid rgb(204,204,204);padding-left:1ex"> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/5e290d88-1c47-407d-819b-34a094d8b48fn%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" target= =3D"_blank">https://groups.google.com/d/msgid/pandoc-discuss/5e290d88-1c47-= 407d-819b-34a094d8b48fn%40googlegroups.com</a>.<br> </blockquote></div></div> </blockquote></div> <p></p> -- <br> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org" targ= et=3D"_blank">pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/20b2a20b-69ad-4b93-863a-c70db01d45een%40googlegro= ups.com?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">https= ://groups.google.com/d/msgid/pandoc-discuss/20b2a20b-69ad-4b93-863a-c70db01= d45een%40googlegroups.com</a>.<br> </blockquote></div> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.<br /> To unsubscribe from this group and stop receiving emails from it, send an e= mail to <a href=3D"mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org">pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org</a>.<br /> To view this discussion on the web visit <a href=3D"https://groups.google.c= om/d/msgid/pandoc-discuss/CAEe_xxg7Gy3Ag3gzwFO8855d%3D7JE%3DXqOw4C4HivpJkuB= 109y0w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://gro= ups.google.com/d/msgid/pandoc-discuss/CAEe_xxg7Gy3Ag3gzwFO8855d%3D7JE%3DXqO= w4C4HivpJkuB109y0w%40mail.gmail.com</a>.<br /> --0000000000002d91f105ed8688b4--