From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31740 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Lu=C3=ADs_de_Sousa?= Newsgroups: gmane.text.pandoc Subject: Re: Multiple HTML file (chunked) output with template Date: Fri, 11 Nov 2022 06:01:43 -0800 (PST) Message-ID: <5e290d88-1c47-407d-819b-34a094d8b48fn@googlegroups.com> 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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1064_370452429.1668175303795" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40151"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCOZLZGK4QDBBS5LXGNQMGQEBJBNRZY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Nov 11 15:01:51 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f63.google.com ([209.85.210.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1otUbP-000AEt-4r for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 11 Nov 2022 15:01:51 +0100 Original-Received: by mail-ot1-f63.google.com with SMTP id l31-20020a9d1b22000000b0066c48e9249fsf2401666otl.5 for ; Fri, 11 Nov 2022 06:01:51 -0800 (PST) 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-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :sender:from:to:cc:subject:date:message-id:reply-to; bh=V0w9RqBAUeFKkbGLwSoKAIw2yxBsBghZAFz2qOxYEdo=; b=evzzBRPKKTLJr+9ZZyIFQIY+X4MaLCx+eSsQw0wE2sLg8O/ZR6MugS+phdt/yBOt+O 39t8jLarxWFE8fDUl3O/rEtQ73l1rStmw3dcYnlKo2rSLmRhPZKyE0eO8aX1Caa1RR16 yaWONMyXwAOXHWaOP+T/wmiQbSsRqdw2Qu6R462Otp2Lk5SrdU7r+Hur5R3v5aEoP5tW JIflTT0NlXvcV5vUg7Ab8IY9DfvxHKN/GfJ34UIqbwfHANUZlX4Uk57QWjw20Ro/wQwp X1Bcl/r5LeK2HwZ+RvmUjUO/ypaWH0+ziAd9F1tkaDd8Smrm5l0Db6s90RrX2CGocXwF PMow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:x-original-sender :mime-version:subject:references:in-reply-to:message-id:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=V0w9RqBAUeFKkbGLwSoKAIw2yxBsBghZAFz2qOxYEdo=; b=PsxCkTHiXDT6WWWQ0ZfL5qswRHdh4qPcM+HPkCDd6y0FNmEV39qLHkmYGt7kB3kN+C N4FdLr+KGljYsclwe+ICfOnii7fKycCCQgp7EvF/QfCI//QkTU+9gNRlNWbkr/4zdwy3 hiM93ZJs17AzFJp62zKTKpnI3D8iFD3RD5hwGONSC00xMcq34sxYfY7/FQzh2Oig34eM EWOczmFdqCPs5HR4U6OwgFBaxtw4VrJMnHPL7gbcZ9RorLRqK7uGu4g6CEXkDIFXqw7U pBdattXvpkJQc3UhRoRLgTbO17FXXjrFVdGHW4/UG6NOw9HUe4vCahAVDk00BntNzH+1 Gc0A== 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-sender:mime-version:subject:references:in-reply-to :message-id:to:from:date:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=V0w9RqBAUeFKkbGLwSoKAIw2yxBsBghZAFz2qOxYEdo=; b=i+S+ad+NjOU0AAJ9/7OwJ0ShYjbFFm0RX+LTFeIhc8d5zJwlQzmHkxSjoGQu7IBZ17 2qoK8JOWaG2SV2cpIbJmYvx1DhCGRj3BOlYAD14nO8oU9HOH0HhoO8uxNqdzGrSaBloo EEEsKr92EXry3jy0OcWf31qn5Wr9aeHbN89L443bv0UsA6UuVsxw6IvYvnMe9p17YQFh +gZPZcETmUGAjqgCNYsMO5PRsd2w1zLcyYDM7yuQdwZ8IoGMKIrACniUijDYqVLsDFcO e4rP505uB36GEV6DTqXyEn11EX2tHreNQexhDd5/nunJY6Uku4uSTtHtLovL5riHz8oP puEA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pnWoVWLtRUcPg4L8+NmOpykHoihKz8gicEyhzyOGw8NexFaz833 VgxQW6Zsbzh/Xn7ugP706WA= X-Google-Smtp-Source: AA0mqf7CnmArjzYOs8d/OX2LoFeSrwcT9nMoOPJ60cAFZ3PkPJTAANbpkD/eJCRZ1k/c/fKn+IGpGA== X-Received: by 2002:a05:6830:1483:b0:66c:7306:1d57 with SMTP id s3-20020a056830148300b0066c73061d57mr1257554otq.134.1668175309811; Fri, 11 Nov 2022 06:01:49 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a4a:af4c:0:b0:49e:a5a0:99d0 with SMTP id x12-20020a4aaf4c000000b0049ea5a099d0ls215672oon.9.-pod-prod-gmail; Fri, 11 Nov 2022 06:01:46 -0800 (PST) X-Received: by 2002:a4a:e81d:0:b0:49f:980:e1ce with SMTP id b29-20020a4ae81d000000b0049f0980e1cemr885002oob.9.1668175304588; Fri, 11 Nov 2022 06:01:44 -0800 (PST) In-Reply-To: X-Original-Sender: Luis.A.de.Sousa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:31740 Archived-At: ------=_Part_1064_370452429.1668175303795 Content-Type: multipart/alternative; boundary="----=_Part_1065_2025469975.1668175303795" ------=_Part_1065_2025469975.1668175303795 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Alright, it is working now, many thanks. The output HTML looks pretty solid= =20 and well linked. Two questions:=20 1. What is the purpose of the /dev/null bit in the second compile command? 2. Could you share an HTML template? It would greatly facilitate the design= =20 work. Next I will give it a try with a more elaborate document including=20 cross-references, citations, etc. Will report back on that. Regards. On Friday, 11 November 2022 at 13:58:28 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org=20 wrote: > Oh, I'm so sorry! I hadn't tested exactly what I gave you (I'd put the=20 > contents of utils.lua into the writer for testing, but then put it into a= =20 > new file to share with you, so the writer didn't need to change), but I= =20 > forgot to put 'return utils' at the bottom. > > I've now added this line:=20 > https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-uti= ls-lua-L51=20 > and this time I've tested it locally. Please try again. > > On Fri, 11 Nov 2022 at 12:33, Lu=C3=ADs de Sousa w= rote: > >> Hello again. I confirm those are the contents in line 38. I assume=20 >> utils.lua is being found, line 21 is now being parsed without error.=20 >> Anything else I can try?=20 >> >> Thank you. >> >> On Thursday, 10 November 2022 at 18:06:06 UTC+1=20 >> 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= =20 >>> the file then it's this=20 >>> >>> : >>> >>> local output_file_dir, output_file_base =3D utils.path.split(output_fil= e) >>> >>> can you confirm that you've also copied utils.lua and that it's being= =20 >>> found? it should be calling the function at this line:=20 >>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-u= tils-lua-L31 >>> >>> >>> On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa = =20 >>> wrote: >>> >>>> Thank you once more for keeping this going. I made some progress but= =20 >>>> now there is an error with html-multi-writer.lua itself (log below). I= =20 >>>> never worked with Lua before, apologies if I am making something dumb. >>>> >>>> $ wget=20 >>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logg= ing.lua >>>> --2022-11-10 17:28:08-- =20 >>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logg= ing.lua >>>> Resolving raw.githubusercontent.com (raw.githubusercontent.com)...=20 >>>> 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...=20 >>>> 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=20 >>>> --.-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=20 >>>> output/multi-test.html >>>> Error running Lua: >>>> html-multi-writer.lua:38: attempt to index a boolean value (local=20 >>>> 'utils') >>>> stack traceback: >>>> >>>> >>>> On Thursday, 10 November 2022 at 13:47:52 UTC+1=20 >>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>> >>>>> I've updated the gist by adding utils.lua and updating the README.=20 >>>>> This should be sufficient for the writer to run without error (please= let=20 >>>>> me know if not). >>>>> >>>>> Note that you'll also need to get logging.lua as described, and also= =20 >>>>> note that any generated YAML files will be empty (I didn't want to sh= are my=20 >>>>> brain-dead YAML writer but there appear to be lua YAML writers out th= ere=20 >>>>> that might work... anyway you might decide that you don't need the=20 >>>>> 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= =20 >>>>> repo!) because I don't want (at this point) to provide any support fo= r it=20 >>>>> (questions are OK though). I'm providing the gist just as a demo of t= he=20 >>>>> 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, = =20 >>>>>> 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=20 >>>>>>> package. I installed luarocks and with it lua-utils but the error p= revails: >>>>>>> >>>>>>> $ pandoc multi-test.md -t html-multi-writer.lua -o=20 >>>>>>> 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=20 >>>>>>> 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=20 >>>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>>> >>>>>>>> I've created this gist:=20 >>>>>>>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf >>>>>>>> >>>>>>>> I added a README.md and hope that there's enough info to get going= .=20 >>>>>>>> Please let me know if not. >>>>>>>> >>>>>>>> (Please note that this writer does some other things too, which=20 >>>>>>>> might need to be stripped out. Also, it's an old-style writer... I= haven't=20 >>>>>>>> got around to updating it yet,) >>>>>>>> >>>>>>>> On Mon, 7 Nov 2022 at 09:22, Lu=C3=ADs de Sousa =20 >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi there. That is precisely the kind of output I would like to=20 >>>>>>>>> have. Similar to what tools like mdBook produce. I would be glad = if you=20 >>>>>>>>> could share more details on that custom writer. >>>>>>>>> >>>>>>>>> Thank you and regards. >>>>>>>>> >>>>>>>>> On Friday, 4 November 2022 at 17:51:24 UTC+1=20 >>>>>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>>>>> >>>>>>>>>> See https://usp.technology/specification for an example of how= =20 >>>>>>>>>> the Broadband Forum has recently been publishing some specs. Thi= s output is=20 >>>>>>>>>> generated via an html-multi-writer.lua custom writer that contai= ns the=20 >>>>>>>>>> logic for splitting the output into multiple files (based on hea= der level=20 >>>>>>>>>> and/or specific classes). The writer also takes care of generati= ng the=20 >>>>>>>>>> navigation bar that you see at the top and bottom of the pages. = The=20 >>>>>>>>>> multiple files are then passed through pandoc again (to add the = overall=20 >>>>>>>>>> sidebar ToC and the top/bottom navigation bars, and to generate = multiple=20 >>>>>>>>>> standalone docs). >>>>>>>>>> >>>>>>>>>> Please let me know if you'd like more details (the overall setup= =20 >>>>>>>>>> is not very easily shareable, because it's heavily dependent on= =20 >>>>>>>>>> rather complicated make rules, but I could probably share the cu= stom writer=20 >>>>>>>>>> and give some example command lines.) >>>>>>>>>> >>>>>>>>>> On Fri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa =20 >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Dear all, >>>>>>>>>>> >>>>>>>>>>> I am currently working on a long document that must served as a= =20 >>>>>>>>>>> web page. The single file output is becoming too slow and cumbe= rsome for=20 >>>>>>>>>>> readers. I am aware this functionality is not available, but a = Feature=20 >>>>>>>>>>> Request is open [0].=20 >>>>>>>>>>> >>>>>>>>>>> In that issue there are some hints to this issue being=20 >>>>>>>>>>> addressable with a template [1]. I have tried many HTML templat= es, but=20 >>>>>>>>>>> never seen one that would split a long document in a set of sma= ll files.=20 >>>>>>>>>>> Would there be an example somewhere I could follow? Otherwise, = could=20 >>>>>>>>>>> someone provide a general idea of how such template would funct= ion? >>>>>>>>>>> >>>>>>>>>>> Thank you. >>>>>>>>>>> >>>>>>>>>>> [0] https://github.com/jgm/pandoc/issues/6122 >>>>>>>>>>> >>>>>>>>>>> [1]=20 >>>>>>>>>>> https://github.com/jgm/pandoc/issues/6122#issuecomment-58359334= 0 >>>>>>>>>>> >>>>>>>>>>> --=20 >>>>>>>>>>> You received this message because you are subscribed to the=20 >>>>>>>>>>> Google Groups "pandoc-discuss" group. >>>>>>>>>>> To unsubscribe from this group and stop receiving emails from= =20 >>>>>>>>>>> it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>>>> To view this discussion on the web visit=20 >>>>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/264eeee0-68c8-= 4389-a5c5-12563c6926f6n%40googlegroups.com=20 >>>>>>>>>>> >>>>>>>>>>> . >>>>>>>>>>> >>>>>>>>>> --=20 >>>>>>>>> You received this message because you are subscribed to the Googl= e=20 >>>>>>>>> Groups "pandoc-discuss" group. >>>>>>>>> To unsubscribe from this group and stop receiving emails from it,= =20 >>>>>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>>> >>>>>>>> To view this discussion on the web visit=20 >>>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/cb3753d7-e845-4a= 72-a1aa-e93086a32f11n%40googlegroups.com=20 >>>>>>>>> >>>>>>>>> . >>>>>>>>> >>>>>>>> --=20 >>>>>>> You received this message because you are subscribed to the Google= =20 >>>>>>> Groups "pandoc-discuss" group. >>>>>>> To unsubscribe from this group and stop receiving emails from it,= =20 >>>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>> To view this discussion on the web visit=20 >>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/1ef6858a-0a37-4f5f= -a88b-eff2479a8130n%40googlegroups.com=20 >>>>>>> >>>>>>> . >>>>>>> >>>>>> --=20 >>>> You received this message because you are subscribed to the Google=20 >>>> Groups "pandoc-discuss" group. >>>> To unsubscribe from this group and stop receiving emails from it, send= =20 >>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> >>> To view this discussion on the web visit=20 >>>> https://groups.google.com/d/msgid/pandoc-discuss/539db8b9-47f4-43b8-83= d1-4b4c99dc3b3fn%40googlegroups.com=20 >>>> >>>> . >>>> >>> --=20 >> You received this message because you are subscribed to the Google Group= s=20 >> "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n=20 >> email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit=20 >> https://groups.google.com/d/msgid/pandoc-discuss/7f4b28ec-1e91-4228-ab03= -fe58a2e5cf18n%40googlegroups.com=20 >> >> . >> > --=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/5e290d88-1c47-407d-819b-34a094d8b48fn%40googlegroups.com. ------=_Part_1065_2025469975.1668175303795 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Alright, it is working now, many thanks. The output HTML looks pretty solid= and well linked. Two questions: 

1. What is the pu= rpose of the /dev/null bit in the second compile command?

2. Could you share an HTML template? It would greatly facilitate th= e design work.

Next I will give it a try with a mo= re elaborate document including cross-references, citations, etc. Will repo= rt back on that.

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.

<= div>I've now added this line:=C2=A0https://gist.github.com/wlupton/2fc2= 3fc1c4e4b4899121bfafc0fea4bf#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:
H= ello 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 = else I can try?=C2=A0

Thank you.

On Thursday, 10 Nov= ember 2022 at 18:06:06 UTC+1 wlu= ...@broadband-forum.org wrote:
can you confirm what's in line 38 o= f the writer? if you haven't edited the file then it's this:

local outpu= t_file_dir, output_file_base =3D utils.path.split(output_file)

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


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

$ wget https://raw.githubuserconte= nt.com/wlupton/pandoc-lua-logging/main/logging.lua
--2022-11-10 17:2= 8:08-- =C2=A0htt= ps://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging.lua<= /a>
Resolving
raw.githubuser= content.com (raw.githubuser= content.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133, ...<= br>Connecting to raw.githubuser= content.com (raw.githubuser= content.com)|185.199.111.133|:443... connected.
HTTP request sent, a= waiting 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 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

2022-11-10 17:28:08 (42,0 MB/s) - =E2=80=98loggin= g.lua=E2=80=99 saved [8173/8173]

$ mkdir -p $HOME/.local/share/pando= c/filters
$ mv logging.lua $HOME/.local/share/pandoc/filters
$ export= LUA_PATH=3D"$HOME/.local/share/pandoc/filters/?.lua;;"
$ pand= oc multi-test.md -t html-multi-writer.lua -o output/multi-test.html
Erro= r running Lua:
html-multi-writer.lua:38: attempt to index a boolean valu= e (local 'utils')
stack traceback:


<= div class=3D"gmail_quote">
On Thursda= y, 10 November 2022 at 13:47:52 UTC+1 wlu...@broadband-= forum.org wrote:
I've updated the gist by adding utils.lua and upd= ating the README. This should be sufficient for the writer to run without e= rror (please let me know if not).

Note that you'll a= lso need to get logging.lua as described, and also note that any generated = YAML files will be empty=C2=A0(I didn't want to share my brain-dead YAM= L writer 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... th= is depends on how you set up the make rules).

I do= n'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 (qu= estions are OK though). I'm providing the gist just as a demo of the ap= proach. Maybe later...

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

On Wed, 9 Nov 2022, 16:03 Lu=C3=ADs de Sousa, <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Thank you very much for sharing, that looks very p= romising.

Pandoc can't run the script though, says i= t can't find the utils package. I installed luarocks and with it lua-ut= ils 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:
=C2=A0 =C2= =A0 no field package.preload['utils']
=C2=A0 =C2=A0 no file '= ;/usr/local/share/lua/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/utils.lua'
=C2=A0 =C2=A0 no file '/usr/local/= lib/lua/5.4/utils/init.lua'
=C2=A0 =C2=A0 no file './utils.lua&#= 39;
=C2=A0 =C2=A0 no file './utils/init.lua'
=C2=A0 =C2=A0 no= file '/usr/local/lib/lua/5.4/utils.so'
=C2=A0 =C2=A0 no file &#= 39;/usr/local/lib/lua/5.4/loadall.so'
=C2=A0 =C2=A0 no file './u= tils.so'
stack traceback:
=C2=A0 =C2=A0 html-multi-writer.lua:21:= in main chunk

P.S.: would you consider creating a reposi= tory for this work? I would like to automate the second stage with bash, sh= ouldn't be too hard.

On Monday, 7 November 2022 at 15:46:58 = UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:<= br>
I added a README.md and hope that there's enough info = to get going. Please=C2=A0let me know if not.

(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,)

On Mon, 7 No= v 2022 at 09:22, Lu=C3=ADs de Sousa <luis= .a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
<= 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.

Thank you and regards.

On Friday, 4 November 2022 a= t 17:51:24 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org<= /a> wrote:
See=C2=A0https://usp.technology/specification for an example of ho= w the Broadband Forum has recently been publishing some specs. This output = is generated via an html-multi-writer.lua custom writer that contains the l= ogic for splitting the output into multiple files (based on header level an= d/or specific classes). The writer also takes care of generating the naviga= tion bar that you see at the top and bottom of the pages. The multiple file= s are then passed through pandoc again (to add the overall sidebar ToC and = the top/bottom navigation=C2=A0bars, and to generate multiple standalone do= cs).

Please let me know if you'd like more det= ails=C2=A0(the overall setup is not very easily shareable, because it's= heavily dependent on rather=C2=A0complicated make rules, but I could proba= bly share the=C2=A0custom writer and give some example command=C2=A0lines.)=

On Fri, 4 Nov 2022 at 12:45, Lu=C3= =ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&g= t; wrote:
Dear all,

I am currently work= ing on a long document that must served as a web page. The single file outp= ut is becoming too slow and cumbersome for readers. I am aware this functio= nality is not available, but a Feature Request is open [0].=C2=A0

In that issue there are some hints to this issue being addr= essable with a template [1]. I have tried many HTML templates, but never se= en one that would split a long document in a set of small files. Would ther= e 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-discus= s/264eeee0-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-discus= s/1ef6858a-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...@googleg= roups.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://groups.google.com/d= /msgid/pandoc-discuss/5e290d88-1c47-407d-819b-34a094d8b48fn%40googlegroups.= com.
------=_Part_1065_2025469975.1668175303795-- ------=_Part_1064_370452429.1668175303795--