From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iPgpGRTix2NobQEAbAwnHQ (envelope-from ) for ; Wed, 18 Jan 2023 13:12:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4JwoGRTix2NkYwAA9RJhRA (envelope-from ) for ; Wed, 18 Jan 2023 13:12:04 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ECA792DCAB for ; Wed, 18 Jan 2023 13:12:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pI7Ho-0002OB-Jo; Wed, 18 Jan 2023 07:11:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7Hj-0002Ik-Id for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 07:11:19 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pI7Hh-0000O8-3A for emacs-orgmode@gnu.org; Wed, 18 Jan 2023 07:11:18 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 3760C240293 for ; Wed, 18 Jan 2023 13:11:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674043874; bh=Zv1EnnmPyo2Eao3743+kYZ7A0MEVTsEmHND0kP0kG2I=; h=From:To:Cc:Subject:Date:From; b=LFael6aAT/ZP51LuIJ2v+VteZxBKcp8jdmzD4qVDhq4D43F4P92UBhJVWRj8niSUK UoJ8oLm3c7wyP28OCZbI4bs3K7HMnVl/EDmB19LsxI25rgbHTwfkZGGDShfDXLwt3p +YrAUtb3VpZ2yvyBkhVXuJKREspwfnREBC2mYi8hB1R+tnQ5T99D8C1FrmRdDY6Y5Y Ct0QjMyoew63UHBXGw3O6n+NM4zRP+Zb8DXLv0CGxYXE3S1lk4bXpitFBEk2HPlADz R4xrLr9aPqwr8Mxov7yYUF5czd8/Xvyg3Snh91gJWHDn5TMDtyWJRo0ZzS47PWrID6 4bMat7zCdsFKA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Nxl3N2jXzz6tlh; Wed, 18 Jan 2023 13:11:12 +0100 (CET) From: Ihor Radchenko To: gmauer@gmail.com Cc: emacs-orgmode Subject: Re: Thoughts on this ob language generator In-Reply-To: References: Date: Wed, 18 Jan 2023 12:11:44 +0000 Message-ID: <874jso6nzz.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674043924; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YvPZf1DzN7pRnEvAEY8lgnQdKGi4yvROVL4p9QZQMDc=; b=Hu7v0xGCeI1+eZhxo0am3r4acLd7s3gIYVKVR1oZLaIKuJg3cvM5YPuVOWjKzPOQ7IRHJD iBcVH3VM/YxFAPaFXVNcwl+33Ms0IJeCQ8NncfP88Ruv1eWtPpwDeccnKPqd3NwzAV0wJB FcK8AGi77WEZaXzwfr8K+DffZJmiahyeUVQ499fDRElUlKR0FCVBFs6weCCb2qlJrsgufY Jc53XmNWuWLHWSmtAoBUd0C09E+TjnvwJMixA+aKdTiZV54jcnVm990QfTP+GlYAbS3zxV iX+xCkOI2foLHokST6INa/32p7sWIDop8rWhX+cHUpjUvJUeI1LMGVBtnaNb5g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LFael6aA; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674043924; a=rsa-sha256; cv=none; b=cXd5pCk17ZmGT9vubQWIoGq/P2qT1LizZyaw+xqOMigCKWFdl/V0Awq9Hj4hKrJX1GDe7d +VzHwqtXhbuGA7MGur/dCVjeH+DYvfe3a6Gj2mDIWs/1RBtZjcGuE1gbaiAO3AVEGA6JzL aa95RmZH+3qtd2OwXbX3DB9b9DA0RkG/Z14gYSjm08ngTPsnR1ToR1x/DSLX0NpOJ0bTe5 YkjXm2J1NpoQDkw6A8E6lqQHZ7k6pN6R/Fjjaj8xWKkRqt5hoL5/KW7IyzzwiLC79fLh3p fgGgHgf8EXc/AI4y9xP2wjAcwa4T+RWALEHzABFbTGs/yhOSBIWvc5tllgFmMQ== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.58 X-Spam-Score: -4.58 X-Migadu-Queue-Id: ECA792DCAB Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=LFael6aA; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-TUID: feMleIfd58J5 George Mauer writes: > I had a need the other day to execute some typescript in an org document. > Now I know that there's an ob-typescript package but that doesn't quite > work the way I want and expects typescript to be installed globally (which > runs into a variety of versioning issues). > > There is a better option available with the `npx` program (installed > alongside `npm`) which can install a package along with its dependencies > into a temporary sandbox and run its binaries. > > I rewrote the typescript babel plugin to do this and then realized that > there was relatively little in it beyond variable and function names that > was typescript-specific. The exact same process can be used for anything > that has an interpreter up on npm. Coffeescript, mermaidjs, all sorts of > things. > > So I made a macro. I'm interested what people here think: > https://github.com/togakangaroo/create-ob-npx I'd say that the problem you are trying to solve is similar to what ob-shell.el does. And it does it similarly, modulo common shell syntax. More generally, generic backends like ob-shell or what you are proposing are a subset of "take the code block, save it to file, and pass the file to be executed by a CLI command". -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at