From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31757 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: Tue, 15 Nov 2022 07:54:10 -0800 (PST) Message-ID: <20b2a20b-69ad-4b93-863a-c70db01d45een@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> <5e290d88-1c47-407d-819b-34a094d8b48fn@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1854_440126859.1668527650835" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40685"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBCOZLZGK4QDBBJHMZ2NQMGQEA5DORFI-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Nov 15 16:54:17 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f64.google.com ([209.85.160.64]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ouyGO-000AIe-B2 for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 15 Nov 2022 16:54:16 +0100 Original-Received: by mail-oa1-f64.google.com with SMTP id 586e51a60fabf-13b6f7d8bf4sf6856715fac.7 for ; Tue, 15 Nov 2022 07:54:16 -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=ysQuFlrE5UVmyF9swMyO8eWlNBFwvXgYhThiV8wPKZY=; b=q0U4d5nsKIsXqhXIpaL9iBydFvNwMvkHE3G5IdfNXUHso1KzkqCEs1mBmZbsCqhvFu kpMi2rWBmkl/G13yOpKxX9hhsOjDVnZxDQGyMa3qCJ9LoQLLi30DBF45y3mxYrgza1Vh NygCa69hZp0yLzwFj9q0rwnJ0INlNwK6ErZxcNrhZZf4RH6bMNPrMBaIkp2RdIyt4xCx TQXLy2yIwNzRoIBRhf1YYOzI+f5Oo2H8u1PELz47u0nJrUQ4qJs40VXL6sGaRgbBWnOj 2u52llNIigInT92leQTQj6/5V8VjH7E4zF/FXCpAQcglhevmtJwf6Ba3WRWc/d4jhsJp hhDw== 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=ysQuFlrE5UVmyF9swMyO8eWlNBFwvXgYhThiV8wPKZY=; b=eyxK07Kdv0c7XlmownLa/HO6i3Zw+jr1z4rRCDAdzMhWdiShq2jOoiZ9OEDId+FugE I3Gh8h0OugzaqKh1TB5emj/krdFe0NrLanhTkLKm6xt3rfQBNAuXM1hb5QE/GRMHordP rwIb/1sQ75Ug0heSvhR1itg8lJm58IcIZhDVEGA0ah6vPsjAeawB6YfXCLNX4NLavVpE sp1Mwhi4l0E8z3cYjGsEDQ6W/IwwN5hHK3RwvRI9wHpaMJqOOG6CXdkzajX4HQhgELNL MoK6UagyqZ34bqZb4UmRLQhONOe7u9HgW9jKV7dtU4YVBrvPI5JMZOKBynK755LfrBT8 4vIA== 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=ysQuFlrE5UVmyF9swMyO8eWlNBFwvXgYhThiV8wPKZY=; b=urUG7lcPbdW2shGsMvY1miNT+FkPHgyttapjAElx+SXLmcLEYzq0HF5OD78fuJ5+Rs yvCm5ZfXo9/hJc3gMURN7w2hBtpac69y0mzVQgtiTZenv940ZOHX6vcfVA7C1M8BKA1h oGEduLrFfEveWbdt/0up85HfgIePqtqd0pdBYOJhhOqfmp6o5frfFBmIRBd5Me/4MVX1 2DrXB5aBFiHhPrcecjFIP/37v+a4IpO3+Z+c1akPcqBgWHn/gXsLl/2Mow45d3kdAtNW rG3YTBa+prZoDWbeaUsRdUksePxa8tgRhjItB2A+amn9dXiJ3cfNP7jpulWqJTCjGVBs HsDA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: ANoB5pkIVyrAlfO30+TvWbzAmgZ5MXkuzFa9+PAdZtfuwnwZRrM896fW aldl+Se1awI/qO0i9yc/P50= X-Google-Smtp-Source: AA0mqf4Kri8yJtx0/u/EuP8YhjeAWw24WYglfF7ml1x/8zCQN2qbf2DjLIOHWJPDVvRdCPI4nLc/AQ== X-Received: by 2002:a4a:e2c3:0:b0:480:7fd1:1875 with SMTP id l3-20020a4ae2c3000000b004807fd11875mr7787343oot.24.1668527655141; Tue, 15 Nov 2022 07:54:15 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6808:55c:b0:354:d7cd:c5e5 with SMTP id i28-20020a056808055c00b00354d7cdc5e5ls4577752oig.3.-pod-prod-gmail; Tue, 15 Nov 2022 07:54:12 -0800 (PST) X-Received: by 2002:a54:480e:0:b0:35a:260b:794d with SMTP id j14-20020a54480e000000b0035a260b794dmr1225887oij.123.1668527651829; Tue, 15 Nov 2022 07:54:11 -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:31757 Archived-At: ------=_Part_1854_440126859.1668527650835 Content-Type: multipart/alternative; boundary="----=_Part_1855_1413516021.1668527650835" ------=_Part_1855_1413516021.1668527650835 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi again Will, sorry for bothering you further. I so far failed to get the= =20 template to work. I tried to add it to the data folder=20 ($HOME/.local/share/pandoc/templates/) but still nothing. Looks like the=20 default template is being applied no matter what. For instance, none of the= =20 meta predicates in the head section ever make it to the final HTML.=20 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=20 wrote: > Inline... > > On Fri, 11 Nov 2022 at 14:01, Lu=C3=ADs de Sousa w= rote: > >> Alright, it is working now, many thanks. The output HTML looks pretty=20 >> solid and well linked. Two questions:=20 > > > 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, an= d=20 > might no longer be necessary. > > I think there was a problem with parsing HTML at one point, and this was = a=20 > way of injecting HTML without passing it through pandoc. > =20 > >> 2. Could you share an HTML template? It would greatly facilitate the=20 >> design work. >> > > I've added github-template.html=20 > (somewhat=20 > anonymised) to the gist. > > Next I will give it a try with a more elaborate document including=20 >> cross-references, citations, etc. Will report back on that. >> > > You'll probably have noted that the writer attempts to fix=20 > cross-references so they reference the correct output file.=20 > > 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-u= tils-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 = =20 >>> wrote: >>> >>>> 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 edite= d=20 >>>>> the file then it's this=20 >>>>> >>>>> : >>>>> >>>>> local output_file_dir, output_file_base =3D utils.path.split(output_f= ile) >>>>> >>>>> 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= -utils-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 dum= b. >>>>>> >>>>>> $ wget=20 >>>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/lo= gging.lua >>>>>> --2022-11-10 17:28:08-- =20 >>>>>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/lo= gging.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)|= 185.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 save= d [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 (plea= se let=20 >>>>>>> me know if not). >>>>>>> >>>>>>> Note that you'll also need to get logging.lua as described, and als= o=20 >>>>>>> note that any generated YAML files will be empty (I didn't want to = share my=20 >>>>>>> brain-dead YAML writer but there appear to be lua YAML writers out = there=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 = for it=20 >>>>>>> (questions are OK though). I'm providing the gist just as a demo of= the=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= prevails: >>>>>>>>> >>>>>>>>> $ 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 t= oo 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=20 >>>>>>>>>> going. 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 gla= d 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. T= his output is=20 >>>>>>>>>>>> generated via an html-multi-writer.lua custom writer that cont= ains the=20 >>>>>>>>>>>> logic for splitting the output into multiple files (based on h= eader level=20 >>>>>>>>>>>> and/or specific classes). The writer also takes care of genera= ting 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 th= e overall=20 >>>>>>>>>>>> sidebar ToC and the top/bottom navigation bars, and to generat= e multiple=20 >>>>>>>>>>>> standalone docs). >>>>>>>>>>>> >>>>>>>>>>>> Please let me know if you'd like more details (the overall=20 >>>>>>>>>>>> setup is not very easily shareable, because it's heavily depen= dent on=20 >>>>>>>>>>>> rather complicated make rules, but I could probably share the = custom writer=20 >>>>>>>>>>>> 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 as= =20 >>>>>>>>>>>>> a web page. The single file output is becoming too slow and c= umbersome 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 templ= ates, but=20 >>>>>>>>>>>>> never seen one that would split a long document in a set of s= mall files.=20 >>>>>>>>>>>>> Would there be an example somewhere I could follow? Otherwise= , could=20 >>>>>>>>>>>>> someone provide a general idea of how such template would fun= ction? >>>>>>>>>>>>> >>>>>>>>>>>>> Thank you. >>>>>>>>>>>>> >>>>>>>>>>>>> [0] https://github.com/jgm/pandoc/issues/6122 >>>>>>>>>>>>> >>>>>>>>>>>>> [1]=20 >>>>>>>>>>>>> https://github.com/jgm/pandoc/issues/6122#issuecomment-583593= 340 >>>>>>>>>>>>> >>>>>>>>>>>>> --=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-68c= 8-4389-a5c5-12563c6926f6n%40googlegroups.com=20 >>>>>>>>>>>>> >>>>>>>>>>>>> . >>>>>>>>>>>>> >>>>>>>>>>>> --=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/cb3753d7-e845-= 4a72-a1aa-e93086a32f11n%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/1ef6858a-0a37-4f= 5f-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,=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/539db8b9-47f4-43b8-= 83d1-4b4c99dc3b3fn%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/7f4b28ec-1e91-4228-ab= 03-fe58a2e5cf18n%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/5e290d88-1c47-407d-819b= -34a094d8b48fn%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/20b2a20b-69ad-4b93-863a-c70db01d45een%40googlegroups.com. ------=_Part_1855_1413516021.1668527650835 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi again Will, sorry for bothering you further. I so far failed to get 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 be= ing applied no matter what. For instance, none of the meta predicates in th= e head section ever make it to the final HTML. 

Wou= ld you have any suggestion to debug this issue?

Th= ank you.

On Friday, 11 November 2022 at 15:30:17 UTC+1 wlu..= .@broadband-forum.org wrote:
Inline...
=
On Fri, 11 No= v 2022 at 14:01, Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Alright, it is working now, many thanks. The ou= tput HTML looks pretty solid and well linked. Two questions:=C2=A0

=
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 (rath= er obliquely):

>=C2=A0Including the HTML via --= include-in-header was a workaround I think, and might no longer be necessar= y.

I think there was a problem with parsing HTML a= t one point, and this was a way of injecting HTML without passing it throug= h pandoc.
=C2=A0
2. Coul= d you share an HTML template? It would greatly facilitate the design work.<= /div>

Regards.

=
Oh, I'm so sorry! I h= adn'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 = 9;return utils' at the bottom.

I've now added th= is line:=C2=A0https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4b= f#file-utils-lua-L51 and this time I've tested it locally. Please t= ry again.

On Fri, 11 Nov 2022 at 12:3= 3, Lu=C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> = wrote:
Hello again. I confirm those are the contents in li= ne 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 November 2022 at 18:06:06 UTC+1 w= lu...-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 out= put_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 being found? it should be calling the function at th= is line:=C2=A0https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4b= f#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 more f= or 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, a= pologies if I am making something dumb.

$ wget https://raw.githubuserc= ontent.com/wlupton/pandoc-lua-logging/main/logging.lua
--2022-11-10 = 17:28:08-- =C2=A0https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging.= lua
Resolving raw.github= usercontent.com (raw.github= usercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.133, = ...
Connecting to raw.github= usercontent.com (raw.github= usercontent.com)|185.199.111.133|:443... connected.
HTTP request sen= t, awaiting response... 200 OK
Length: 8173 (8,0K) [text/plain]
Savin= g 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=98loggi= ng.lua=E2=80=99 saved [8173/8173]

$ mkdir -p $HOME/.local/share/pand= oc/filters
$ mv logging.lua $HOME/.local/share/pandoc/filters
$ expor= t LUA_PATH=3D"$HOME/.local/share/pandoc/filters/?.lua;;"
$ pan= doc multi-test.md -t html-multi-writer.lua -o output/multi-test.html
Err= or running Lua:
html-multi-writer.lua:38: attempt to index a boolean val= ue (local 'utils')
stack traceback:


=
On Thursd= ay, 10 November 2022 at 13:47:52 UTC+1 wlu...@broadband= -forum.org wrote:
I've updated the gist by adding utils.lua and up= dating the README. This should be sufficient for the writer to run without = error (please 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=C2=A0(I didn't want to share my brain-dead YA= ML 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... t= his depends on how you set up the make rules).

I d= on'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 (q= uestions are OK though). I'm providing the gist just as a demo of the a= pproach. Maybe later...

On Wed, 9 Nov 2022 at 1= 8: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....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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-u= tils but the error prevails:

$ pandoc multi-test.m= d -t html-multi-writer.lua -o output/multi-test.html
Error running Lua:<= br>html-multi-writer.lua:21: module 'utils' not found:
=C2=A0 = =C2=A0 no field package.preload['utils']
=C2=A0 =C2=A0 no file &= #39;/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/loc= al/lib/lua/5.4/utils/init.lua'
=C2=A0 =C2=A0 no file './utils.lu= a'
=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= '/usr/local/lib/lua/5.4/loadall.so'
=C2=A0 =C2=A0 no file '= ./utils.so'
stack traceback:
=C2=A0 =C2=A0 html-multi-writer.lua:= 21: in main chunk

P.S.: would you consider creating a rep= ository 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 wrot= e:

Hi there. That is prec= isely the kind of output I would like to have. Similar to what tools like m= dBook produce. I would be glad if you could share more details on that cust= om writer.

Thank you and regards.

On Friday, 4 November 20= 22 at 17:51:24 UTC+1 wlu...@broadband-forum.= org wrote:
<= div dir=3D"ltr">
See=C2=A0https://usp.technology/specification for an example o= f how the Broadband Forum has recently been publishing some specs. This out= put is generated via an html-multi-writer.lua custom writer that contains t= he logic for splitting the output into multiple files (based on header leve= l and/or specific classes). The writer also takes care of generating the na= vigation 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 standalon= e docs).

Please let me know if you'd like more= details=C2=A0(the overall setup is not very easily shareable, because it&#= 39;s heavily dependent on rather=C2=A0complicated make rules, but I could p= robably share the=C2=A0custom writer and give some example command=C2=A0lin= es.)

On Fri, 4 Nov 2022 at 12:45, Lu= =C3=ADs de Sousa <luis.a....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

=
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...-/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/20b2a20b-69ad-4b93-863a-c70db01d45een%40googlegroups.= com.
------=_Part_1855_1413516021.1668527650835-- ------=_Part_1854_440126859.1668527650835--