From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/32051 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Fun with 'pandoc lua' Date: Fri, 20 Jan 2023 10:04:45 -0800 Message-ID: <6C24F328-997C-4853-880B-244E701F222F@gmail.com> References: <208248AE-608E-4E19-AA46-C902BE91FBE9@gmail.com> <875yd2mm3i.fsf@zeitkraut.de> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) 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="18153"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDW7ZIEHTIIBBQFPVOPAMGQEOAEVXWQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 20 19:04:53 2023 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-pl1-f186.google.com ([209.85.214.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIvky-0004Ze-Vb for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 20 Jan 2023 19:04:53 +0100 Original-Received: by mail-pl1-f186.google.com with SMTP id u15-20020a170902a60f00b00194d7d89168sf2383826plq.10 for ; Fri, 20 Jan 2023 10:04:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674237891; cv=pass; d=google.com; s=arc-20160816; b=HddXli3F98p3Txnn2JiGFobSz+eq+rAyUGBTJ646f2SOOmdnxbncQf3jgjE/lcbVsU HoZG1lOZHkzBS2QRepUxCwVmgvpWOoWCchTXkUZHo/wy3IEJezyT6sXJE20PZUcg/rAj z9uaSrgZiOt73Ns3Fw4g0u06djOZjwtu7xUFyL4GblPAu0lGZG9pZRZ4pijywF2V/Q62 dFj6V4w2Hlay2x5E3BVbdElIxpSYAKujd8hTX8MeVE6X+C6CdMyfcrnD14j4+fVsYqF8 vrFZHmW8GFUE9ns009PIGnHrJhOAM12RlzguWwyaDsdU9x5o/snKjpEGBAnPBm3mLS11 M9IA== 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:message-id:in-reply-to:to :references:date:subject:mime-version:content-transfer-encoding:from :sender:dkim-signature:dkim-signature; bh=6XtQIEbItq1XCkR1Xp5+gfiKcBIrZ3phBEkCKvrJZT8=; b=Ga5szMKbJSnNPMgJ4C6L5xGM2KbDdkQc8Ot2FJtJk8qg4fiDg1FzomrOSJsKC5Wopv PGgqfl1JKvjvDslXF+KU4zW3gY81KbEYFPm2CzDEottEX6cK5VkTczskim9lBeXsDVpe O/HNadh+v2/3kYXS1IZIgQ8LgW+2Lg8cQfx1yFg6GIKTH7dSvAKty6fS/q+aM7NGYclb Rvd6X214jzLvo+gpceMm6D1lAC+vnVSoke6qCdAzWM4VykvR/RTdfUoitPCexruD0BMA NTSrvLiQLXqOa6MjcroT8tt+qgAK+BDf4Utm49f/tOQLzKU/w808ep0+r2cW1DuBiRPo hRMw== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hc1c4UYQ; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=6XtQIEbItq1XCkR1Xp5+gfiKcBIrZ3phBEkCKvrJZT8=; b=b9pqozfpx7n9tCi7sshTYYXQmihUVAhuxWWLAMqEWj8Y0eMEW1ixcLA0h8iuhyMy6B 8OQtpl/WmT3CIVDRjyBXF+rmDBl5xUXg/PmiXOb7kGG4g4kQuLYC+pqtyL0EMPfFQSnO 9tZodErJNSH/IK1Qg72v24BywKMJPikimm3NdAfn4tu+XYENCax6M049tp/unza93gDy +etx+AZznpfKPZ6s1Y8Th6YA0GhXXptUiMoc5mdNeTfViTKpYlyrAx3kg3WvsyBFgTt/ xYIbQtPorzsWq6IREDXUM4eLo2HrZ8kuKNKLSwW0fPCScWwIv2COs6ozokIrjc87Q 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-authentication-results:x-original-sender:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=6XtQIEbItq1XCkR1Xp5+gfiKcBIrZ3phBEkCKvrJZT8=; b=Gk3lfaatflyL9aMbi0j2+IVq0iBuoNGJ08zDgTUnMwtPrpD7QDptN18Niaao7g2o3T KB4QuVpHDy5DCCKa5ThPSbh8hOduqR5Cljx4b8CzqoynvffcQtml8b67r6oQpzpkO7+N mHVZPXPkzOOvILJTEko9iXEXHb0a0yRfWcmhD35ExLvD+MvX9TXUBO+xTUtnkKjooFe1 BjRkFPUlSMjFDvuahH+PJhnJa1lKFmZn1yCMt4rc/OpwFFDtY4OZMjaPXEbt68H4lk+v dKCxWK7bCj9XyXNjHjEr3CyT0ucTkBJCxM/t7R8F45lT2ST+aviC6516kFqFqOmw4Y5m I 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:message-id :in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:sender:from:to:cc :subject:date:message-id:reply-to; bh=6XtQIEbItq1XCkR1Xp5+gfiKcBIrZ3phBEkCKvrJZT8=; b=JyZAxqwp/MgZE97hjJQbF5y9AMCZOh/2jlCLkAkIRKFEFZ/oYJzsnRhjqxKuPmuOaM KLQTS1q8dqurSPMe3HV3jEgU3UlZhuqs//HVPFmuiSz4AsGCL9OiO8LJB8IcaRannjjc rm15O1K8vPlPQEfR6xL6yAfcMON/CZ/tvDVPe2KrohOkAoy3XtCDcYHHiJGNcu+hKpgg bkNIV67Ic46+/apsCG9iPH+BiPjkuRfc+kI/C7NikbrB8gg4uqo/9QdPCfLw/pfhWt3w Ktlvmx5dTitrYYm9sJys Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AFqh2krHMs+JkRPANtH8453SKYt/fOeKQj4ct4q+h3mJQ7fLIbGvfH1T mUroITPzDx71Cd5Cl0drHW0= X-Google-Smtp-Source: AMrXdXuOK+0JHjajzE6KPAPlWYhzvuL5tgYQV/KOqv0HofCfvJbyiGxl+otn3z3FWRxLM5pIJjNQzQ== X-Received: by 2002:a17:90b:3102:b0:229:4384:9e35 with SMTP id gc2-20020a17090b310200b0022943849e35mr1836391pjb.180.1674237891614; Fri, 20 Jan 2023 10:04:51 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a17:90a:c392:b0:22b:b65d:b10d with SMTP id h18-20020a17090ac39200b0022bb65db10dls1639115pjt.0.-pod-control-gmail; Fri, 20 Jan 2023 10:04:48 -0800 (PST) X-Received: by 2002:a17:90a:950c:b0:228:d353:9612 with SMTP id t12-20020a17090a950c00b00228d3539612mr16546537pjo.31.1674237888199; Fri, 20 Jan 2023 10:04:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674237888; cv=none; d=google.com; s=arc-20160816; b=AR4N/wfdz16nrjBHtdCySDftLYj7W0wdSAbG8LX/2gg1WIibxn7SpvjZewB6S4iXMM cAcBSWp/J1HFi1FmXN/Cm7GJECTJe/x7EmRC6Wm/sYrbxoSKQcbIWMR+YfcKm5rMBo8H RcOaKbTRGoWmtZRLl9O+ptiJb9tsXY5K2ggPgomd0Cua8H1KO17Pw8BkRGspmk9aXEYw Fc3NFD1vEsSvuwgw15PnUxFgKfiF5ISX4Yun/n6du9z+gx4CTYMoCyWx5h+h6LHe/h6m bF9YGZNitYA9xQfSmXob5p4woXHuG1Eehmag3MTPlKXXfORrapY5xwaRFJZaXECVEAPS oCqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:in-reply-to:to:references:date:subject:mime-version :content-transfer-encoding:from:dkim-signature; bh=KO7rTCkGUv2zrmylUWDXi11wSC2PREQmaUgLthWx9rg=; b=BnGUA1HHwofFGu5VL+sdwLxI3XmCEbtNLGa1tj06DOdkk8je5YAXHC0t12n5lI5zCz QcnoBJseiizlB+ubqSlzVBW3wvHVKxprL8lS6liZOUodfeCKSXnzd5N36yt/dhA8Ctw5 /XIzm94OkiCKw0m3wbd1SeCAl2SETdGZUIy0Wd44JFk4ajZbdZLL1HJeQwAc06EDDoNZ 6TMXgQBKsI5f47S82zIW/WLcBg0VIy04OPDU+2zZW9u06wuBttL0damyiLilxONZ1wiW HIl8PCFF0Uj27Kq2WJ8Lz1gJVHxx3podXM01CyqU3zMtsKznyOC/q1rv0aEE5dNMROd6 NcLA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hc1c4UYQ; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com. [2607:f8b0:4864:20::102a]) by gmr-mx.google.com with ESMTPS id o15-20020a17090a4b4f00b0022975f69761si270290pjl.0.2023.01.20.10.04.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Jan 2023 10:04:48 -0800 (PST) Received-SPF: pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) client-ip=2607:f8b0:4864:20::102a; Original-Received: by mail-pj1-x102a.google.com with SMTP id lp10so2916215pjb.4 for ; Fri, 20 Jan 2023 10:04:48 -0800 (PST) X-Received: by 2002:a17:903:200a:b0:188:640f:f41e with SMTP id s10-20020a170903200a00b00188640ff41emr14021187pla.4.1674237887551; Fri, 20 Jan 2023 10:04:47 -0800 (PST) Original-Received: from smtpclient.apple ([2601:644:4780:3350:7414:c5b:a55e:f54b]) by smtp.gmail.com with ESMTPSA id x4-20020a1709029a4400b00192aa53a7d5sm27294025plv.8.2023.01.20.10.04.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2023 10:04:46 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Original-Sender: fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hc1c4UYQ; spf=pass (google.com: domain of fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::102a as permitted sender) smtp.mailfrom=fiddlosopher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:32051 Archived-At: OK, now I see that in runPandocWithLua we simply carry over the common stat= e that had already been established. So that's why we don't get this messa= ge in normal conversions -- but we get it when we run the lua engine withou= t going through convertWithOpts, which sets up common state for us. Albert, how about exporting configureCommonState from T.P.App and then usin= g it to configure the common state when pandoc is used as a Lua interpreter= ? (I guess this would be in runLuaInterpreter in pandoc-cli.) > On Jan 19, 2023, at 4:45 PM, John MacFarlane wro= te: >=20 > I think I see what is happening. HTML writer has: >=20 > abstractTitle <- translateTerm Abstract >=20 > And apparently the term isn=E2=80=99t defined. Why not? Well, normally i= t would be defined by configureCommonState, whic his run at the beginning o= f convertWithOpts=E2=80=99. This sets the user data directory, tracing opti= ons, verbosity, the resource path, the input and output file variables, req= uest headers, and translations (based on `lang` in metadata). >=20 > I=E2=80=99m not sure how we should deal with this is a Lua context. Perh= aps Lua initialization should include running configureCommonState? There = seems to be no way to load the translations manually from Lua. >=20 >=20 >=20 >> On Jan 19, 2023, at 10:08 AM, Albert Krewinkel wrote: >>=20 >>=20 >> John MacFarlane writes: >>=20 >>> Pandoc 3.0 can be used as a lua interpreter, with full access to the Lu= a API: >>>=20 >>> $ cat test.lua >>> local formats =3D {"latex", "html5", "docbook", "ms"} >>> local doc =3D (pandoc.read("> *hello* world!", "markdown")) >>> for _,format in ipairs(formats) do >>> print(string.format("%s:\n%s\n\n", format, pandoc.write(doc, format))) >>> end >>>=20 >>> [...] >>>=20 >>> latex: >>> [WARNING] The term Abstract has no translation defined. >>>=20 >>> Albert: do you know why we get that warning? >>=20 >> No clue, sorry >>=20 >>=20 >> --=20 >> Albert Krewinkel >> GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 >>=20 >> --=20 >> You received this message because you are subscribed to the Google Group= s "pandoc-discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send a= n email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To view this discussion on the web visit https://groups.google.com/d/msg= id/pandoc-discuss/875yd2mm3i.fsf%40zeitkraut.de. >=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/6C24F328-997C-4853-880B-244E701F222F%40gmail.com.