From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/33149 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bastien DUMONT Newsgroups: gmane.text.pandoc Subject: Re: requiring other lua files from parent directories from within filters Date: Tue, 3 Oct 2023 16:50:26 +0000 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26615"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDCINCES2QJRBW4M6GUAMGQEUZ3EOMA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Oct 03 18:50:40 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-wm1-f55.google.com ([209.85.128.55]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1qnibY-0006YU-9G for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 03 Oct 2023 18:50:40 +0200 Original-Received: by mail-wm1-f55.google.com with SMTP id 5b1f17b1804b1-3fe182913c5sf8549485e9.0 for ; Tue, 03 Oct 2023 09:50:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696351839; cv=pass; d=google.com; s=arc-20160816; b=mYRXMZpSNX+TjasqStfZbforaa0N3u/knFHsNvl2NOoMgjGRLrV2IKKuTJUi3wt49w fWVpy/UmVgQAtUb8wW/jmhYx6jF8jasmvO7VAiwCdJmMA9hafteWqsOzyCQTFMC1PKI1 Or0IsR3TYttSx8MNW21aIQIrke+SrrUKPWWdjNM/s9nPxQypbVr+MVXfknvupOkH/qzm yNztLxe1LEBobKfJtejkYW30zPJd1gFreApYCYkJCpNV/UoKForHH7BQzyZj8XOxackF R2RpORVopQbh1rlqYHZ3bQobBNrVf7bWzSwOUdwqbPFQXWHujo8YL81PRHH+dtr1KbxN VfjQ== 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:dkim-signature; bh=qVL6170VKMZO/flMsY+va9hrwcdb/dlHXasD30fg1e8=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=uzx46kP2k5IofD0ZScqsdV3aYkDBqaVpZDNQ53P9uJ6cxeFt71PDmm1kPaOrSyzfQz lVffQ00ApzuU2s0PIamkjyHiQAycFGAyX2C8mtJ07gm0cMBIglEcoH/UvuPsLFLu/r0x SjPzsvbAHHmLJ0dGjJj9rdgJyF3fA4JR7vv2m4R1LaRxLUjUs58RYg9/psd+iz4itZfA oC6HGF6Sp2OvaKIbg0E3lOIz/0T3g5yoynmWiNV8Sa8pTDiKsRVI0EayKY95VCpYMR1p 7T8wN8Q1fFp7xNMLC43N7w2KEVv4aT7f0R5RA2JQlZOkMWYExjyt5NiJtlEmctHgs91x tQvg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=SIlIo5Zt; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1696351839; x=1696956639; darn=m.gmane-mx.org; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:sender:from:to:cc :subject:date:message-id:reply-to; bh=qVL6170VKMZO/flMsY+va9hrwcdb/dlHXasD30fg1e8=; b=FSQ8j/f98YUvoNWgk6XPjdH3ZwkKrmionTONoOrcCDNs/9K4K+PkA06cA1FtT99z7S n8o1V6LKbMWH5Bre/ZaB46GqJnDPN9DYcIi5cjLHX6zFuHAey4q7l+XVUtB8APaTXGsH nzvgYdVDERwvGpWS+Qypy8qzp1VACuuHrYc0kYxl3/Vj5cy/iqhez61tBShJGSo5DfyF 56ARa0aIhP3O7NgwQOj33fat1rBsRJJs04R0Qol3i0qhNVaiIvDtLMdwQOrZnBpMTDNL X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696351839; x=1696956639; 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:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:x-beenthere :x-gm-message-state:sender:from:to:cc:subject:date:message-id :reply-to; bh=qVL6170VKMZO/flMsY+va9hrwcdb/dlHXasD30fg1e8=; b=ZTFr9YsB7MvOtAQr3weXNrrD7vGb7FpQB8Sd9FIvrj4N2/PrBrJF9cumdjy9/Iohd7 c7GG1S7MxaGDOcPabpHe2DVUyCsEMEVE4mtC3kkp1h6F1BwkKhpYg4Gebqt3AuzdVCPY xt3hBac7+ZQ7NxVcDyvBvHiWdSysY1bCr/Oubp5g8KkMwzL0BPcyNGBxmWzUHWLf3qQc 9/0WGVTXna0MdT0MJHqecMPAhywT Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOJu0YzXfWo5zJblxFb/jWn1SAnOrj/tuaQdbI0N40HAwYrgGCYrla4e tleSC0noUuAfHSb+I8hu3XE= X-Google-Smtp-Source: AGHT+IH/KCet35Ngs1FqVBrD8/Uh7ihDX1GwqTBGXT18GP4aCfsozi+NDmN7Nou7ZpTsraNYuZ0r6g== X-Received: by 2002:a5d:4751:0:b0:321:6fb0:9a8b with SMTP id o17-20020a5d4751000000b003216fb09a8bmr11987182wrs.70.1696351839540; Tue, 03 Oct 2023 09:50:39 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:600c:3c8e:b0:405:2359:570a with SMTP id bg14-20020a05600c3c8e00b004052359570als167566wmb.1.-pod-prod-01-eu; Tue, 03 Oct 2023 09:50:34 -0700 (PDT) X-Received: by 2002:a7b:c7d5:0:b0:405:3d27:70e8 with SMTP id z21-20020a7bc7d5000000b004053d2770e8mr13345699wmk.36.1696351834271; Tue, 03 Oct 2023 09:50:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696351834; cv=none; d=google.com; s=arc-20160816; b=rlvQkw3yRzXd1xGZKM+tN2XhMZmK+P3OgCBdCF7/2q+e4xZjDM4Eza6M7Y9vFOZ+RQ hKL8n5CbTLrC8bPmWqrVZ5ELCqxnciyCWhw7kDZvOUJTUIuL2orv4BQxfthlYXa9lEtu vEmHV4j+TRMRn0Yhjm3jGn3wmDOMmnGrUNgI5xRqfh+7wwvqgSFVdeADRH15/cQEYxSX gty/GtTmX2ex8YS5sVL2EwoI7vwgRdQxMLWLdMOEE+eyLNNrPYNhNnFBTbuaiIKLrf/N nz5oWgqr9W5XQ+tvE1c0uWzqDyQtG63Rm0hFlIZoaugPD9W5zlFydECZLDO4R/AoHrRT Q54A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=f8df3zb/PTTwqn8sMoPmPfBcMUZzZyXGefcrQkEgJa4=; fh=m01AhCNo7xUywHldCVYouaJypLlN7JgtNYbImzBf4N4=; b=KRyUmaChjsPA4h3gHld8llybSBdERJ5daambm5sb5/s268nR97Q8BBYslsSEkIZZzW sfouC0iTosqeXKHYlG9DQwxdvU2bwtgT10dr7ahteSoI/e5Ezl6vo2TfUzqdKYM7PK5O WYnuZm1zrU2asF+vO+SSsaPjU7eUzkY0ieJ6ymKgxG8BY6XjpANtBlaNGQxVvC97+ODL LN4G6fhZCjXx2soqjuFXs+0qh23QO50bgvms/+wkKWX5OCkHfQIQFIIfwLJlhvEWdXAo 0jSYPRh/+F3rL9Z1AgJ/STuPVJpTwtQCq1eelFzt2Eoyf+jIKLtZloaKLcDKFCQSlolu yUag== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=SIlIo5Zt; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net Original-Received: from mout02.posteo.de (mout02.posteo.de. [185.67.36.66]) by gmr-mx.google.com with ESMTPS id fl8-20020a05600c0b8800b00404ca34ab7csi123406wmb.1.2023.10.03.09.50.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 09:50:34 -0700 (PDT) Received-SPF: pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) client-ip=185.67.36.66; Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 36E5A240101 for ; Tue, 3 Oct 2023 18:50:33 +0200 (CEST) Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S0P2c68nxz6tvc for ; Tue, 3 Oct 2023 18:50:32 +0200 (CEST) Content-Disposition: inline In-Reply-To: X-Original-Sender: bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@posteo.net header.s=2017 header.b=SIlIo5Zt; spf=pass (google.com: domain of bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org designates 185.67.36.66 as permitted sender) smtp.mailfrom=bastien.dumont-VwIFZPTo/vqsTnJN9+BGXg@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.net 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:33149 Archived-At: The argument of require() is not a path, but a string that is passed to a t= emplate. The template is composed of semi-colon separated strings where ? i= s stands for the argument of require() (after all . have been replaced with= /). For instance, if the template is: ./?.lua;/usr/local/share/lua/5.4/?.lua and you pass 'library.library' to it, Lua will search in ./library/library.= lua and /usr/local/share/lua/5.4/library/library.lua The path is controlled by environment variables. In your case, if all loade= d files are in the ../library directory, I would advise to call your script= with: LUA_PATH=3D'../library/?.lua' pandoc-lua script.lua and to write in inner/script.lua: library =3D require("library") Of course, you can also set the path to '../?.lua;./?.lua' if you want to b= e able to load files from the current directory and to write explicitely th= e path to library.lua as library.library! Le Tuesday 03 October 2023 =C3=A0 09:17:04AM, ch_...-S0/GAf8tV78@public.gmane.org a =C3=A9crit : > I have the following file structure: >=20 > inner/script.lua > library/library.lua >=20 > I try to load the library from within the script >=20 > library =3D require("../library/library.lua") >=20 > but get an error when running inside inner: pandoc lua script.lua >=20 > Error running Lua: > script.lua:1: module '../library/library.lua' not found: > no field package.preload['../library/library.lua'] > no file '/usr/local/share/lua/5.4////library/library/lua.lua' > no file '/usr/local/share/lua/5.4////library/library/lua/init.lua' > no file '/usr/local/lib/lua/5.4////library/library/lua.lua' > no file '/usr/local/lib/lua/5.4////library/library/lua/init.lua' > no file './///library/library/lua.lua' > no file './///library/library/lua/init.lua' > no file '/usr/local/lib/lua/5.4////library/library/lua.so' > no file '/usr/local/lib/lua/5.4/loadall.so' > no file './///library/library/lua.so' > no file '/usr/local/lib/lua/5.4/.so' > no file '/usr/local/lib/lua/5.4/loadall.so' > no file './.so' > stack traceback: > script.lua:1: in main chunk >=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= email > to [1]pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit [2]https://groups.google.com/d/m= sgid/ > pandoc-discuss/ee1ceb10-3318-48d0-ae1a-0ca538a3cdc9n%40googlegroups.com. >=20 > References: >=20 > [1] mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [2] https://groups.google.com/d/msgid/pandoc-discuss/ee1ceb10-3318-48d0-a= e1a-0ca538a3cdc9n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter --=20 You received this message because you are subscribed to the Google Groups "= pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/= pandoc-discuss/ZRxGUn7zsP-pRL0O%40localhost.