From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31731 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: Thu, 10 Nov 2022 17:05:52 +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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c4287105ed20c983" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22242"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBB7G6WSNQMGQEBAHY7PA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Nov 10 18:06:09 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-qk1-f188.google.com ([209.85.222.188]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1otB0C-0005VX-WF for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 10 Nov 2022 18:06:09 +0100 Original-Received: by mail-qk1-f188.google.com with SMTP id w4-20020a05620a444400b006fa24b2f394sf2471645qkp.15 for ; Thu, 10 Nov 2022 09:06:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668099968; cv=pass; d=google.com; s=arc-20160816; b=lKUqUB5Kfi6+9SxjZgUdeYHTYma4HXz5Tg4LKWj+MjbROMdQ4A2bep5N3JcizCk5d0 pkz5MwYk31uEHvPqPlM5mHpNsifk2wnhWeI8VqlAGX3Tdja5ygDafLZgIGDoVGBvL/91 I+2ekk2QBjewQPxmjLTrbian8tizpKrNlsUAX2ca4ooCyCwAmAaaoMD9xXWGJ6zr53HS WD4FHXOwkwASMrias/1E0zuZ99PZrDJJBUGnzbYGy8yJBXbgdR9Qi2/tN0HHgs0BrmPH SndjNTXJZqrdG5ooqhGl+nVxRlANyO5m1vasEvPJ+erNwnQimUZnOmNgvssc2kZ7X1Xo D7Fw== 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=mMksNZ+oHMe1eMzM5/silW/tN7mvJrY6pi2yzM07LAc=; b=ftxp6jXplXr9xAvWVzHQvjLFbTBqNjIFtdC8gNXXRtx3ED6D0TbvW/EjUQwq3eegdg Rqb/GkAROcBF/+e6pF9k7gzIVTSC5UM4y3NY8hMD8K/ZrzKu4kom4LQIvgY0zJzMqnkO fkS2O6Evb4sOr7+HSXgnjV7BHiK6roAHpcmNRqPpvTRyKOUywacu/WlQjjiV8IRDXxSF XsCQMZIQYsOKvA4lCw8I01x8uJO6NBYyF/BYyUl7rZifA5hmDAwIfV8zHHfmNjkWVjk9 O81y5j6S7b4DSI4G/sXOJGBPEGEyEy3Pdn9JZA6JVD4B5u559DmyREPjwEds8XZCsP73 FFaQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=BH1PWgyX; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b36 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=mMksNZ+oHMe1eMzM5/silW/tN7mvJrY6pi2yzM07LAc=; b=Qqvt0cDkNZG01BF73qL6g0LUaqPnKnLFXwTukDCvvM1bQ3MI37prFnqR5C0Y7scGSi lOvZ6qZDcUjNb1PXMXsaZa7M89ptqrra1kMoWLujno0NXDm1mgc2lpLrtwx/avb06ORg /i71xPu2k/2SiVDXmPVpzlVJKGy2N8b3aazwq6nZ/OT/pxgvOdcwv/LplD5HibWaOvl8 U0PC4m0XRxr9Zhln3O3XT7wFMujOXLIjp/a+j79FiPIDjSqJrEp4Rv2CDjI6ClPvPwk6 vzdaZVX8RkAwwrCflajtCoQzjkVdf4iXFlTZj0a7J10iXoxuU0wM/N37Wv5i/4EPv6OD PDUQ== 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=mMksNZ+oHMe1eMzM5/silW/tN7mvJrY6pi2yzM07LAc=; b=DkOhVWK8blWzPMVfIgggVRqWo+fqCzDDQbyAA0fdbXxMAAyPo6inyDpid72CXYV8Aa hgRZ0VzzCah5KaDvwGJFsHIXaRkEfR5rnhq4tJeXIfxMjlxysBto9+hYnRNtsYWj1MWY cOpRJohhK7SLOqCfz+7hA/YO3X7JnBILB4aR4TDSXKWj9Fg+voyuVmpBcIGzZpzmJoMG xEzSmJXqfLFgBW96t90tRjse4fYMiYWhPxUBkIL81LPUEqHefOkroxczLNW9iut82NtD xVcwEMA2FC1whOKhLH9nF9A5moSfDgKDwuHZYEjvvwE2vi7PrU9mE5mPrpgBTL/ X-Gm-Message-State: ACrzQf1LAGL3WLlXSjyvF2hzkcUDcAQu1mnRWNtEYyW+4Be0eWjPDxcK nd0nhJ+1aEozlFvHtnzRFng= X-Google-Smtp-Source: AMsMyM7VqgiwfPG+OVz5NCNPb1jlOPezeDlETOUHaQH/9Kudot1IovSr0ndb+PAjrIBcgx/VABL/0A== X-Received: by 2002:a05:620a:601a:b0:6fa:b56f:7ede with SMTP id dw26-20020a05620a601a00b006fab56f7edemr1035000qkb.383.1668099966834; Thu, 10 Nov 2022 09:06:06 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a0c:e2d3:0:b0:4bb:c902:f716 with SMTP id t19-20020a0ce2d3000000b004bbc902f716ls1332605qvl.6.-pod-prod-gmail; Thu, 10 Nov 2022 09:06:04 -0800 (PST) X-Received: by 2002:a05:6214:c86:b0:4bb:9658:3a53 with SMTP id r6-20020a0562140c8600b004bb96583a53mr59043558qvr.114.1668099964208; Thu, 10 Nov 2022 09:06:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668099964; cv=none; d=google.com; s=arc-20160816; b=ozGmHKxdcyavXM2KQa8lC/uoS2yWOMujD/2okO1wURSX4J1mHqpXntDYTvXZ+1UrVD lk0R8/1jghAYeZROqqNj4PElyDO3pTmrmAtXIGQVcGestD881Ju7w42cqvDf2jKG1G7r pHkm2XTWBXm2X39gNTLJ2DdqGrpCXDSq+ihRqvNc+tpHoMs/EV6V3dIc210yNUML9D3A oNS5z4mR8X2F9ducNEiNI7PrjmSaTueh6oVaZhxZFZVETYRzIcSIUOC1GBaHAAzLdiYX eGXeQm97NuFH+awxrFABcq2g3w8Be94C/W/z3sp3VUBuyLYfOy6nzdy90RCKGicSrXw2 9vKw== 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=fCsdU92hGmvjlzOPUrMu54eepFBHgTrpwzBzgBc0KMs=; b=Sg+IS+wwn/vyY/rbXomvYjiSpEbPPACwKtdIuFzztEm6YXhvLneiyHXdMRpECanj3f k7FrNAV4fsoWkbFDTwmVCbdxt8QvHiTHFCqua6yKi4qksuCFh/CkDHvXxgl8/PIMSMvD 7wqjZvli8QdDGdWItwx1M9IOlKStmVGssPrTHAjUeWIg7CjU2RhPUPIJaQ8M2nBWNPlT yPmB2BYoqF7N3BguL4nz9ILgIk80tjK9Uo4rYAtgOpCgh+Zr+eZaLWQYVXfW1B3+GwzW RzCtxDDjSLQLcarcXaMa3MzJTdRna+ej8l4MQnXc+i9fQW+FhXQRUxkdt5lfrLZeVJ/1 DvRw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=BH1PWgyX; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b36 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-yb1-xb36.google.com (mail-yb1-xb36.google.com. [2607:f8b0:4864:20::b36]) by gmr-mx.google.com with ESMTPS id q22-20020ae9e416000000b006ee9c67dfb5si750020qkc.4.2022.11.10.09.06.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Nov 2022 09:06:04 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b36 as permitted sender) client-ip=2607:f8b0:4864:20::b36; Original-Received: by mail-yb1-xb36.google.com with SMTP id e68so223560ybh.2 for ; Thu, 10 Nov 2022 09:06:04 -0800 (PST) X-Received: by 2002:a05:6902:10c2:b0:6d5:afd8:1ae9 with SMTP id w2-20020a05690210c200b006d5afd81ae9mr25033376ybu.247.1668099963359; Thu, 10 Nov 2022 09:06:03 -0800 (PST) In-Reply-To: <539db8b9-47f4-43b8-83d1-4b4c99dc3b3fn-/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=BH1PWgyX; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b36 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:31731 Archived-At: --000000000000c4287105ed20c983 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable can you confirm what's in line 38 of the writer? if you haven't edited the file then it's this : local output_file_dir, output_file_base =3D utils.path.split(output_file) can you confirm that you've also copied utils.lua and that it's being found? it should be calling the function at this line: https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-utils= -lua-L31 On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de Sousa wrote: > Thank you once more for keeping this going. I made some progress but now > there is an error with html-multi-writer.lua itself (log below). I never > worked with Lua before, apologies if I am making something dumb. > > $ wget > https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging= .lua > --2022-11-10 17:28:08-- > https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging= .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.1= 99.111.133|:443... > connected. > HTTP request sent, awaiting response... 200 OK > Length: 8173 (8,0K) [text/plain] > Saving to: =E2=80=98logging.lua=E2=80=99 > > logging.lua 100%[=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>] 7,98K > --.-KB/s in 0s > > 2022-11-10 17:28:08 (42,0 MB/s) - =E2=80=98logging.lua=E2=80=99 saved [81= 73/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/nuMyEUIsrzH9SisXa4x6EXUF0@public.gmane.org= g > 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 (please let me >> know if not). >> >> Note that you'll also need to get logging.lua as described, and also not= e >> that any generated YAML files will be empty (I didn't want to share my >> brain-dead YAML 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... this depends on how you set up the make rules). >> >> I don't really want to create a repo for this (well... a gist _is_ a >> repo!) because I don't want (at this point) to provide any support for i= t >> (questions are OK though). I'm providing the gist just as a demo of the >> approach. Maybe later... >> >> On Wed, 9 Nov 2022 at 18:28, William Lupton >> 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, wr= ote: >>> >>>> Thank you very much for sharing, that looks very promising. >>>> >>>> Pandoc can't run the script though, says it can't find the utils >>>> package. I installed luarocks and with it lua-utils but the error prev= ails: >>>> >>>> $ 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/nuMyEUIsrzH9SisXa4x6EXUF0@public.gmane.org= g >>>> wrote: >>>> >>>>> I've created this gist: >>>>> https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf >>>>> >>>>> I added a README.md and hope that there's enough info to get going. >>>>> Please let me know if not. >>>>> >>>>> (Please note that this writer does some other things too, which might >>>>> need to be stripped out. Also, it's an old-style writer... I haven't = got >>>>> around to updating it yet,) >>>>> >>>>> On Mon, 7 Nov 2022 at 09:22, Lu=C3=ADs de Sousa >>>>> wrote: >>>>> >>>>>> Hi there. That is precisely the kind of output I would like to have. >>>>>> Similar to what tools like mdBook produce. I would be glad if you co= uld >>>>>> share more details on that custom writer. >>>>>> >>>>>> Thank you and regards. >>>>>> >>>>>> On Friday, 4 November 2022 at 17:51:24 UTC+1 >>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>> >>>>>>> See https://usp.technology/specification for an example of how the >>>>>>> Broadband Forum has recently been publishing some specs. This outpu= t is >>>>>>> generated via an html-multi-writer.lua custom writer that contains = the >>>>>>> logic for splitting the output into multiple files (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 bottom of the pages. The >>>>>>> multiple files are then passed through pandoc again (to add the ove= rall >>>>>>> sidebar ToC and the top/bottom navigation bars, and to generate mul= tiple >>>>>>> standalone docs). >>>>>>> >>>>>>> Please let me know if you'd like more details (the overall setup is >>>>>>> not very easily shareable, because it's heavily dependent on >>>>>>> rather complicated make rules, but I could probably share the custo= m writer >>>>>>> and give some example command lines.) >>>>>>> >>>>>>> On Fri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa >>>>>>> wrote: >>>>>>> >>>>>>>> Dear all, >>>>>>>> >>>>>>>> I am currently working on a long document that must served as a we= b >>>>>>>> page. The single file output is becoming too slow and cumbersome f= or >>>>>>>> readers. I am aware this functionality is not available, but a Fea= ture >>>>>>>> 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 templates, but never s= een one >>>>>>>> that would split a long document in a set of small files. Would th= ere be an >>>>>>>> example somewhere I could follow? Otherwise, could someone provide= a >>>>>>>> general idea of how such template would function? >>>>>>>> >>>>>>>> Thank you. >>>>>>>> >>>>>>>> [0] https://github.com/jgm/pandoc/issues/6122 >>>>>>>> >>>>>>>> [1] >>>>>>>> https://github.com/jgm/pandoc/issues/6122#issuecomment-583593340 >>>>>>>> >>>>>>>> -- >>>>>>>> You received this message because you are subscribed to the Google >>>>>>>> Groups "pandoc-discuss" group. >>>>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>>>> To view this discussion on the web visit >>>>>>>> https://groups.google.com/d/msgid/pandoc-discuss/264eeee0-68c8-438= 9-a5c5-12563c6926f6n%40googlegroups.com >>>>>>>> >>>>>>>> . >>>>>>>> >>>>>>> -- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "pandoc-discuss" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>>> >>>>> To view this discussion on the web visit >>>>>> https://groups.google.com/d/msgid/pandoc-discuss/cb3753d7-e845-4a72-= a1aa-e93086a32f11n%40googlegroups.com >>>>>> >>>>>> . >>>>>> >>>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "pandoc-discuss" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/pandoc-discuss/1ef6858a-0a37-4f5f-a8= 8b-eff2479a8130n%40googlegroups.com >>>> >>>> . >>>> >>> -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, 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/539db8b9-47f4-43b8-83d1-= 4b4c99dc3b3fn%40googlegroups.com > > . > --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/CAEe_xxiUW_GbEf3_uEaW4wyOGG6Um-%3DSoukd-VonV9HdGCv30g%40mail= .gmail.com. --000000000000c4287105ed20c983 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
can you confirm what's in line 38 of the writer? if yo= u haven't edited the file then it's local output_file_d= ir, output_file_base =3D utils.path.split(output_file)



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

$ wget https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/loggin= g.lua
--2022-11-10 17:28:08-- =C2=A0https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging.= lua
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.1= 33, 185.199.108.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githu= busercontent.com)|185.199.111.133|:443... connected.
HTTP request se= nt, awaiting response... 200 OK
Length: 8173 (8,0K) [text/plain]
Savi= ng 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--.-K= B/s =C2=A0 =C2=A0in 0s

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

$ mkdir -p $HOME/.local/share/p= andoc/filters
$ mv logging.lua $HOME/.local/share/pandoc/filters
$ ex= port 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 Thu= rsday, 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 shou= ld 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 YAML writer but there appear t= o 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 u= p the make rules).

I don't really want to crea= te a repo for this (well... a gist _is_ a repo!) because I don't want (= at this point) to provide any support for it (questions are OK though). I&#= 39;m providing the gist just as a demo of the approach. Maybe later...

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


$ 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.preloa= d['utils']
=C2=A0 =C2=A0 no file '/usr/local/share/lua/5.4/u= tils.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.lu= a'
=C2=A0 =C2=A0 no file '/usr/local/lib/lua/5.4/utils/init.lua&= #39;
=C2=A0 =C2=A0 no file './utils.lua'
=C2=A0 =C2=A0 no fil= e './utils/init.lua'
=C2=A0 =C2=A0 no file '/usr/local/lib/l= ua/5.4/utils.so'
=C2=A0 =C2=A0 no file '/usr/local/lib/lua/5.4/l= oadall.so'
=C2=A0 =C2=A0 no file './utils.so'
stack trace= back:
=C2=A0 =C2=A0 html-multi-writer.lua:21: in main chunk

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

I've created this gis= t:=C2=A0https://gist.github= .com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf

I adde= d a README.md and hope that there's enough info to get going. Please=C2= =A0let me know if not.

(Please note that this writ= er does some other things too, which might need to be stripped out. Also, i= t'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....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org&g= t; wrote:
Hi there. That is precisely the kind of output I= would like to have. Similar to what tools like mdBook produce. I would be = glad if you could share more details on that custom writer.

<= div>Thank you and regards.

On Friday, 4 November 2022 at 17:51:24 UTC+1 wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote:
See= =C2=A0https://usp.technology/specification for an e= xample of how the Broadband Forum has recently been publishing some specs. = This output is generated via an html-multi-writer.lua custom writer that co= ntains the logic for splitting the output into multiple files (based on hea= der level and/or specific classes). The writer also takes care of generatin= g the navigation bar that you see at the top and bottom of the pages. The m= ultiple files are then passed through pandoc again (to add the overall side= bar ToC and the top/bottom navigation=C2=A0bars, and to generate multiple s= tandalone docs).

Please let me know if you'd l= ike more details=C2=A0(the overall setup is not very easily shareable, beca= use it's heavily dependent on rather=C2=A0complicated make rules, but I= could probably share the=C2=A0custom writer and give some example command= =C2=A0lines.)

On Fri, 4 Nov 2022 at 1= 2:45, Lu=C3=ADs de Sousa <luis.a....@gmai= l.com> wrote:
Dear all,

I am cur= rently working on a long document that must served as a web page. The singl= e file output is becoming too slow and cumbersome for readers. I am aware t= his functionality is not available, but a Feature Request is open [0].=C2= =A0

In that issue there are some hints to this iss= ue being addressable with a template [1]. I have tried many HTML templates,= but never seen one that would split a long document in a set of small file= s. Would there be an example somewhere I could follow? Otherwise, could som= eone provide a general idea of how such template would function?
=
Thank you.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/264= eeee0-68c8-4389-a5c5-12563c6926f6n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pandoc-discuss/1ef= 6858a-0a37-4f5f-a88b-eff2479a8130n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/539db8b9-47f4-43b8-83d1-4b4c99d= c3b3fn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://group= s.google.com/d/msgid/pandoc-discuss/CAEe_xxiUW_GbEf3_uEaW4wyOGG6Um-%3DSoukd= -VonV9HdGCv30g%40mail.gmail.com.
--000000000000c4287105ed20c983--