From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/31739 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "'William Lupton' via pandoc-discuss" Newsgroups: gmane.text.pandoc Subject: Re: Multiple HTML file (chunked) output with template Date: Fri, 11 Nov 2022 12:58:13 +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> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f6607305ed31714f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33954"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCS4HJ6WSAHBB4MNXGNQMGQEL6GVOKA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Nov 11 13:58:30 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 1otTc5-0008dc-Cg for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 11 Nov 2022 13:58:29 +0100 Original-Received: by mail-ot1-f63.google.com with SMTP id t15-20020a0568301e2f00b0066ceaf260d1sf2325334otr.3 for ; Fri, 11 Nov 2022 04:58:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1668171508; cv=pass; d=google.com; s=arc-20160816; b=YaYNvh1WNam6Fbw3qzMmYtjvoWJDI0e5auq5IKLDnLItfslEz5ZLE93xSw48KeIIsg 3/BjoAaEYyz5b4qdb5EQ3h7QP4xxWLlx3eTei2zgxISHYXGHDqEkQixND3ePJLewZHFl sNXI1QLA6DQpw8mZQ0KiaThNlDI++03xvBnpehGaAf8XBX7C3C6ZyBhY7+AlsWrC4lEy xAG2lEPkUSlYEQnbOxSb95NJ1l8/h3x1ctlO0znfI17EU9b01hWNAsBd6k5wUY3VV4YW LN3z99t8W0ysons+j06eHEm3yZ6wzFw0CUrzheHMDHFqz5AMCwAy9Ty2gdAesrT7oO30 T2dA== 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=CW4u9SHWZmmdVh0CSZ3t3dM5cmNyfivW/bunNKzCdS8=; b=HjL9X4iDKqBxVAqTKFaV71uxyIiLLEy3C22Gz45FNlnxrXwd06mClabnmc/sj9VXEP F7qvHPY0A8STtYqV0NRszKxldlNHxYzSk1hNRVD4kpttjZ3e8nY4SliroN5mmbtFmKr5 7R3moOsuhS9pUb2GXZz1KzGl0Tla59d9ZTDRcNpgKA5vqiD38N9HwdtANVk4mkmCgsFA HGsMw4QE3opRlDU9gD11OrOtzBD6QsLjESedxGma1Vk+AzpkbnEwdF+dnaiIOkA7tLxX NpWCRCrF2vFiZzVAfKEQFeiOhNwP/8msYFfstqojjNXQ+RcBT80w7B/lKFwKEQt+nWEV OMCw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=dpgrpioI; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b33 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=CW4u9SHWZmmdVh0CSZ3t3dM5cmNyfivW/bunNKzCdS8=; b=DK/YxIJV8UU1qylqmtueetgR1bSDnA+P71MSI4IkK4z7k12HpbDNzjbOWpoUSTNj6R iVtB7JtGFN7tohJa96epgaC1w2DcNiFjDgQtHlSlgdmem4ZqoVJ8q+utW5lxUgkGXcwV HnxcHVygkiZizvKcPRw53qX2E2qsAo2iN5Wk+srEKaDNeh50z0nMOVdtETfIw4y10SN+ wijNjHfzdKz7d+vln3zAaVIQt9x8y9N4592jAyTX9SZdsqrmKPjGyv0Uo5VcfeDv+liK wPT+F8RKoh4lPADyeMe8ZmrAe4UMEny1nSoaAeMNaMqd4poVGNmumBN0puUOq/aTUYdG xYeQ== 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=CW4u9SHWZmmdVh0CSZ3t3dM5cmNyfivW/bunNKzCdS8=; b=leceJxly9RTzmdqK+y0Kd4enIUs/Xugb+uGTMa4HDt2PovWOa6C4AIPMGjLe+cAkM9 PnYUTwTyaKxbpkl3luTT7l2z1k6592mcHYMXC5KRCtH3YjM2Or/86JmYScisybeh+MhW /dCMl/QUmtPyhupLUIuXhmlNhP1abs+kOX8NeuRLa1RRhp+oYZh8fyAZM0tdzmLP6MD6 CRK5iUEhRfcW8DwNQxuRW9kvgrkqHrZL7NgRgLbp4w3YtvnzFohB8yHOzX49nvCbThiq wIYrVtso9+hrZD0wHgKBY17PGXFIdQ/4nscz8wBxuQNj5CrlU+Wuc5trquxggoP X-Gm-Message-State: ANoB5pnETq5iBYCMDp8okFhIaLrZ3Gmn6nT5BCE52Wq0+rhsN1kn4LDz cNmpFUQ4fvnC11I9ubx5AW4= X-Google-Smtp-Source: AA0mqf4sWYQHA0xCpWYCIaf6tiRC1A4JB46t/7f77y1FvTvzOJZ1ZKs8H5jgxrV7AO7yaS0S6SkKaA== X-Received: by 2002:a9d:4c8f:0:b0:66c:62fb:6437 with SMTP id m15-20020a9d4c8f000000b0066c62fb6437mr1119123otf.5.1668171508210; Fri, 11 Nov 2022 04:58:28 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:7688:b0:13b:6766:edd8 with SMTP id dx8-20020a056870768800b0013b6766edd8ls1587642oab.3.-pod-prod-gmail; Fri, 11 Nov 2022 04:58:25 -0800 (PST) X-Received: by 2002:a05:6870:c0d5:b0:13c:12cf:17e8 with SMTP id e21-20020a056870c0d500b0013c12cf17e8mr800674oad.21.1668171505474; Fri, 11 Nov 2022 04:58:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668171505; cv=none; d=google.com; s=arc-20160816; b=J6CMhCjF13hOVy99CF1MNFFi/cl+RMeWmWw6BhPTvaX4+GPmMjMPQONmaN0LFIfO/+ eCMivsc7G/yDXhhNdJIn33fpTEGDVgDSkYhKFM/+LajpQ2GDcXn8redv0O/j4FH+zNsf PKFgm8IvacvGm5ci0YTOS7xrrtlwgtgduzxxx3wZ/cg54L7tKa7O4M9JkDWATbPtmf0+ nmLu6D4R7MX9QBES9LSDUBuoHgY1LreyxpbGHqnvxbqQf6eGMdtS98AsrwEGfwQToSAE Wfujc5iQakHE/Q/U0lUiNiMNF4Gfkat4Zw1yHegHoWrww3Q/ztzppgiDyxZHFljk2kCg p+ZA== 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=UnHlBGVSgDUOXm+nUP3heeCB6QF2W4tfztms0stK5qw=; b=EzB6FAbLM80DbzRog0KoTkmtbZ7ty9XTQPzTPsab6E0Mzl41hJwVfAthYFrLO0qMFv Mb7C5RC2EY94D0Q3S9dO9iCqgZGV4570HlX2jcs5k1aDBW7jHFhHcWpbzXo1S1GdeLQK 5pcfgP9/8w6YcL9puXASNF0Ef4vcP/AF/oJpVgRSzbpCoaHLBccr0gy2ZgIL2HOVJgXg js1FJ54pe+pg1h7ZJxHFTPXMeXrby36dAU3Ypz1WDPj/18M+MkdMVbpKOFkeMujWMKO1 WDmYmp/seepHjNAk2doubqWFgOVL0BqudRpY4Y3S/mIIGZX2fj739HDqbAPh+svdB+QH JaLw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@broadband-forum.org header.s=google header.b=dpgrpioI; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b33 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-xb33.google.com (mail-yb1-xb33.google.com. [2607:f8b0:4864:20::b33]) by gmr-mx.google.com with ESMTPS id j187-20020aca3cc4000000b003544a421e56si145024oia.3.2022.11.11.04.58.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Nov 2022 04:58:25 -0800 (PST) Received-SPF: pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b33 as permitted sender) client-ip=2607:f8b0:4864:20::b33; Original-Received: by mail-yb1-xb33.google.com with SMTP id e68so2989364ybh.2 for ; Fri, 11 Nov 2022 04:58:25 -0800 (PST) X-Received: by 2002:a5b:b8d:0:b0:6d4:d047:5d2f with SMTP id l13-20020a5b0b8d000000b006d4d0475d2fmr1645412ybq.443.1668171504696; Fri, 11 Nov 2022 04:58:24 -0800 (PST) In-Reply-To: <7f4b28ec-1e91-4228-ab03-fe58a2e5cf18n-/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=dpgrpioI; spf=pass (google.com: domain of wlupton-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org designates 2607:f8b0:4864:20::b33 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:31739 Archived-At: --000000000000f6607305ed31714f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Oh, I'm so sorry! I hadn't tested exactly what I gave you (I'd put the contents of utils.lua into the writer for testing, but then put it into a new file to share with you, so the writer didn't need to change), but I forgot to put 'return utils' at the bottom. I've now added this line: https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0fea4bf#file-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 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/nuMyEUIsrzH9SisXa4x6EXUF0@public.gmane.org= g > wrote: > >> can you confirm what's in line 38 of the writer? if you haven't edited >> the file then it's this >> >> : >> >> local output_file_dir, output_file_base =3D utils.path.split(output_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-ut= ils-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 no= w >>> there is an error with html-multi-writer.lua itself (log below). I neve= r >>> worked with Lua before, apologies if I am making something dumb. >>> >>> $ wget >>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/loggi= ng.lua >>> --2022-11-10 17:28:08-- >>> https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/loggi= ng.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 saved [= 8173/8173] >>> >>> $ mkdir -p $HOME/.local/share/pandoc/filters >>> $ mv logging.lua $HOME/.local/share/pandoc/filters >>> $ export LUA_PATH=3D"$HOME/.local/share/pandoc/filters/?.lua;;" >>> $ pandoc multi-test.md -t html-multi-writer.lua -o output/multi-test.ht= ml >>> 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. Thi= s >>>> should be sufficient for the writer to run without error (please let m= e >>>> know if not). >>>> >>>> Note that you'll also need to get logging.lua as described, and also >>>> note that any generated YAML files will be empty (I didn't want to sha= re my >>>> brain-dead YAML writer but there appear to be lua YAML writers out the= re >>>> 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= it >>>> (questions are OK though). I'm providing the gist just as a demo of th= e >>>> 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, = wrote: >>>>> >>>>>> Thank you very much for sharing, that looks very promising. >>>>>> >>>>>> Pandoc can't run the script though, says it can't find the utils >>>>>> package. I installed luarocks and with it lua-utils but the error pr= evails: >>>>>> >>>>>> $ pandoc multi-test.md -t html-multi-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 woul= d >>>>>> 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/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 i= f you >>>>>>>> could share more details on that custom writer. >>>>>>>> >>>>>>>> Thank you and regards. >>>>>>>> >>>>>>>> On Friday, 4 November 2022 at 17:51:24 UTC+1 >>>>>>>> wlu...-QSt+ys/nuMyEUIsrzH9SikB+6BGkLq7r@public.gmane.org wrote: >>>>>>>> >>>>>>>>> See https://usp.technology/specification for an example of how >>>>>>>>> the Broadband Forum has recently been publishing some specs. This= output is >>>>>>>>> generated via an html-multi-writer.lua custom writer that contain= s the >>>>>>>>> logic for splitting the output into multiple files (based on head= er 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. T= he >>>>>>>>> multiple files are then passed through pandoc again (to add the o= verall >>>>>>>>> sidebar ToC and the top/bottom navigation bars, and to generate m= ultiple >>>>>>>>> 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 cus= tom writer >>>>>>>>> and give some example command lines.) >>>>>>>>> >>>>>>>>> On Fri, 4 Nov 2022 at 12:45, Lu=C3=ADs de Sousa >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Dear all, >>>>>>>>>> >>>>>>>>>> I am currently working on a long document that must served as a >>>>>>>>>> web page. The single file output is becoming too slow and cumber= some for >>>>>>>>>> readers. I am aware this functionality is not available, but a F= eature >>>>>>>>>> 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 template= s, but >>>>>>>>>> never seen one that would split a long document in a set of smal= l files. >>>>>>>>>> Would there be an example somewhere I could follow? Otherwise, c= ould >>>>>>>>>> someone provide a general idea of how such template would functi= on? >>>>>>>>>> >>>>>>>>>> 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-4= 389-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-4a7= 2-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-= a88b-eff2479a8130n%40googlegroups.com >>>>>> >>>>>> . >>>>>> >>>>> -- >>> You received this message because you are subscribed to the Google >>> Groups "pandoc-discuss" group. >>> To unsubscribe from this group and stop receiving emails from it, 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-83d= 1-4b4c99dc3b3fn%40googlegroups.com >>> >>> . >>> >> -- > You received this message because you are subscribed to the Google Groups > "pandoc-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to pandoc-discuss+unsubscribe-/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-ab03-= fe58a2e5cf18n%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_xxh--%3DVrfpuU75HDuSe1uLJ1ZmFbdhBpX4VcTysmCVoyhQ%40mail= .gmail.com. --000000000000f6607305ed31714f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Oh, I'm so sorry! I hadn't tested exactly what I g= ave you (I'd put the contents of utils.lua into the writer for testing,= but then put it into a new file to share with you, so the writer didn'= t need to change), but I forgot to put 'return utils' at the bottom= .

I've now added this line:=C2=A0
On Fri, 11 Nov 2022 at 12:33, Lu=C3=ADs de Sousa <luis.a.de.sousa-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=C2=A0 parsed without error. Anything else I can try?=C2=A0=

Thank you.

On Thursday, 10 November 2022 at 18:06:0= 6 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:

<= /div>
local output_file_dir, output_file_base = =3D utils.path.split(output_file)

can y= ou confirm that you've also copied utils.lua and that it's being fo= und? it should be calling the function at this line:=C2=A0https://gist.github.com/wlupton/2fc2= 3fc1c4e4b4899121bfafc0fea4bf#file-utils-lua-L31


On Thu, 10 Nov 2022 at 16:36, Lu=C3=ADs de So= usa <luis.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 html-multi-writer.lua itself (log below). I neve= r worked with Lua before, apologies if I am making something dumb.

=
$ wget https:/= /raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/logging.lua<= br>--2022-11-10 17:28:08-- =C2=A0https://raw.githubusercontent.com/wlupton/pandoc-lua-logging/main/l= ogging.lua
Resolving raw.githubusercontent.com (raw.gi= thubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.110.1= 33, ...
Connecting to raw.githubusercontent.com (raw.git= hubusercontent.com)|185.199.111.133|:443... connected.
HTTP request = sent, awaiting response... 200 OK
Length: 8173 (8,0K) [text/plain]
Sa= ving 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...@broadb= and-forum.org wrote:
I've updated the gist by adding utils.lua a= nd updating the README. This should be sufficient for the writer to run wit= hout error (please let me know if not).

Note that you= 9;ll also need to get logging.lua as described, and also note that any gene= rated YAML files will be empty=C2=A0(I didn't want to share my brain-de= ad 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 = it (questions are OK though). I'm providing the gist just as a demo of = the approach. Maybe later...

On Wed, 9 Nov 2022= at 18:28, William Lupton <wlu...-QSt+ys/nuMyEUIsrzH9SisXa4x6EXUF0@public.gmane.org= g> 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 look= s very promising.

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

$ pandoc multi= -test.md -t html-multi-writer.lua -o output/multi-test.html
Error runnin= g 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 './u= tils.lua'
=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 fil= e './utils.so'
stack traceback:
=C2=A0 =C2=A0 html-multi-writ= er.lua:21: in main chunk

P.S.: would you consider creatin= g a repository for this work? I would like to automate the second stage wit= h 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:=C2=A0https://gist.github.com/wlupton/2fc23fc1c4e4b4899121bfafc0= fea4bf

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

(Please note that this writer does some other things too, which mi= ght need to be stripped out. Also, it's an old-style writer... I haven&= #39;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> wrote:
Hi there. Tha= t is precisely the kind of output I would like to have. Similar to what too= ls like mdBook produce. I would be glad if you could share more details on = that custom writer.

Thank you and regards.

On Friday, 4 No= vember 2022 at 17:51:24 UTC+1 wlu...@broadba= nd-forum.org wrote:
See=C2=A0https://usp.tech= nology/specification for an example of how the Broadband Forum has rece= ntly been publishing some specs. This output 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 wr= iter also takes care of generating the navigation bar that you see at the t= op and bottom of the pages. The multiple files are then passed through pand= oc again (to add the overall sidebar ToC and the top/bottom navigation=C2= =A0bars, and to generate multiple standalone docs).

Please let me know if you'd like more details=C2=A0(the overall setup= is not very easily shareable, because it's heavily dependent on rather= =C2=A0complicated make rules, but I could probably share the=C2=A0custom wr= iter 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> wrote:
D= ear all,

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

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

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

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

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

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

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https= ://groups.google.com/d/msgid/pandoc-discuss/7f4b28ec-1e91-4228-ab03-fe58a2e= 5cf18n%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_xxh--%3DVrfpuU75HDuSe1uLJ1ZmFbdhBp= X4VcTysmCVoyhQ%40mail.gmail.com.
--000000000000f6607305ed31714f--