From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30143 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Albert Krewinkel Newsgroups: gmane.text.pandoc Subject: Re: Converting org to ipynb Date: Mon, 07 Feb 2022 16:56:11 +0100 Message-ID: <87y22mbre8.fsf@zeitkraut.de> References: <87mtj3ivnl.fsf@fastmail.fm> <8735kvccth.fsf@zeitkraut.de> <4da9a418-d853-4d3f-85a5-955d8118c918@www.fastmail.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14215"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBCZJF7XJTILRBFMDQWIAMGQEYD3TIFY-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Feb 07 16:58:20 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-lj1-f186.google.com ([209.85.208.186]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nH6PD-0003Ox-0S for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 07 Feb 2022 16:58:19 +0100 Original-Received: by mail-lj1-f186.google.com with SMTP id p10-20020a2ea4ca000000b0023c8545494fsf4589904ljm.2 for ; Mon, 07 Feb 2022 07:58:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644249498; cv=pass; d=google.com; s=arc-20160816; b=ljDMnXWCjsqMnLsSJ/y9AGYcC4qEvW/z8q9daBazcuAgAFGbOI3fP5P/D7UsWlb4G1 +aIABmvlJQx2bLhtwk0nRe0UaF+lISvwdEB0r9Bngck5977kCbdQ846WNd2jB4hrtpME r6Yu3xqGvxFQ5Ulp4Y2Tna4O+Kn3R+Ny3EwxktHzINhrnQw/cBcTpOrbykKdlwPVbyk5 uP/yB4BRnhD07Jt6ceOCftyXAwtH7lpfOdWtcXIKfHa3rquJSak6H6tBwoLCI4k3gb0S 8+9ZtfGyLplJbwVytfr0e6fqOw0xCw1pQKD9VvUMDYlaj1fmWcoLNkQr9im1xzqaTH6w 0csg== 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:mime-version:message-id :in-reply-to:date:subject:to:from:references:sender:dkim-signature; bh=01KARURyvQ2z1fjOg3Op5LjotIYzb5Y1WmDoXkR6yEM=; b=cQ7GpzqJ9ampCIj+jYBbWMLCDMEslbo/kYPPVvqhrbc5OaR9pV/6/WJwVZPJTyYFQC d4B7zX/bfJZzPJNhpIM0l/qyAyVOQs1iFbrdXVPqNQpRSxti/OySAuEn5u5OmGFN4jdv pwBuF8dbXY6/Sv0zIwSFJUoWW/2STxoq2BViKBtrk+mwaF4GBw5bybQ9EeZ12SUrLK6P fifmoN5xYeCFYVXgF2eS379ViGlAfUuG4/2j66cqyZV61Pa5il1ZedVZPN/Hrxj+Gp1j 76krFy0wFvFRUIxLjfWW4r6k4JAHotigCnNxr7ulsgCzKZ4Hw+LoUwkp5WpDXMaUnkmH pl8g== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:references:from:to:subject:date:in-reply-to:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=01KARURyvQ2z1fjOg3Op5LjotIYzb5Y1WmDoXkR6yEM=; b=hyTFiqk+9ziDun75so6/E89XGF9zi8AgfVRUhxhWcb4no9Mp3CGuSfXyrN5gow44DS y6lLKbpEkUqRP3LMQhfIMIQqhmKX3upJswXmSI3dtueO8W3eIPxMY9v06nh1VqY3TE5d Bn7aQBbpMAT1B6x6sT2WI/gUjYux8mu4pi+tv16NOjbZGYDAoVjZijZnYSvC1qmlh0/g Zfqq16XIOjDDYYdYLjlj9VIN9/86n09cEIh5Fwffn5MQs47vBZ0VxWBP9Yx+2uPvendI NueK9FVJ2gZXeDx+QV5FVT3213uEppVvJOBWj0eo9TdLxHNw48OE4fkv9fgOjTFzv36O LLHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:references:from:to:subject:date :in-reply-to:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=01KARURyvQ2z1fjOg3Op5LjotIYzb5Y1WmDoXkR6yEM=; b=zYnhNBdXr4erRpp+s1Da0Ep6zpQR1fXm6RKf6Y0rWwrjUblCocSrYIFSPqD5TiDmr7 NQvSNJcWnrVajUo4K4GYxAmFQe40lEn3sF/Pe9bsqUAjh2/jb2X1uxhvL0KJ9ZatoYXg KH5pmz+jkkW5x5ijw+x3rIteQVnYdhLx7Bo0uoLMZawLcZfKI2oH9eECw76LOCUCJEI6 3vFcDtfzNCcbdzki4cBTGaVNV2ZMX9zMLsckngpUG+y3GrNycanyvdsJJkJI35tlhNGK vL1WzKx3U11tYpPmvCc+OG8pAaG8XifktLCwObal7X2+1wIeHBHFBboW2Q5WQ/zZ6F/U xF+A== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530vaFYmYy7dbzMiqQ0kuNbdDlWDDmdxxI/wytRdc3PH+PACz9tf pQYvq2zv6vMe37h9uzIfD4w= X-Google-Smtp-Source: ABdhPJyykiaTGdiFWueitgnLu7llcZjmbC8oR4yZjZsq+FJaf0X9ENdYJ4d0X4TqM/s562SDmMZUrg== X-Received: by 2002:a05:6512:3b99:: with SMTP id g25mr138266lfv.532.1644249498370; Mon, 07 Feb 2022 07:58:18 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6512:3ba6:: with SMTP id g38ls5909811lfv.3.gmail; Mon, 07 Feb 2022 07:58:13 -0800 (PST) X-Received: by 2002:a05:6512:3b0a:: with SMTP id f10mr121996lfv.237.1644249493070; Mon, 07 Feb 2022 07:58:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644249493; cv=none; d=google.com; s=arc-20160816; b=N8SloUDaXmD5ltlmHODAp8mU52FIbtP8DIWYYr1TjOptAC7M3PgTRdey3mleFQKOWe gFXHYizhtJUhoUbPohMxsjfhumUYGbDQ1H1mN/4Wfc3XEPk/6qZApBL19g3/WmaeBYRO /BRWV1tRKPLwDVseiNPe0LlIaq+/nJiqDOQfbyOnXnGWyfyMFAA7uS9DAVh7hYLRvFzN Izvj2TsQLgrBdMQv0jLD5aWGk/y1q8Ru90Qlus8xvaD54YiB2LbykUyeT7Gj3g++qNm+ 4Dy9epHfGHFXTTX1Xkz5TXnsoTNDgvbWiqu7MJFl8RMRtbjecPl0KWN2gKHxW+nF+W8y bazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:in-reply-to:date:subject:to:from:references; bh=MVy2GF9bZYi14KntdTQWgEl2VE8aa3D0ql1zHXE5rgQ=; b=qnnnlRKaxLfPp9QBv+6t4v2RdbShvneCbHq3VkQ31BzdYFKpi3bLBs5A8Yg8PfZg49 vRi0g/5YpkD8D6NcgsTQd+BgNeoMa+mkiDUCwoGph/nC6IdgCifs0pNTx10LK9mTje6r HBdGXJHjC2JTjTASIq1z34Uu74sXUSt1zP+fHO8UV+OrFx5Vj35lM/VXgOfE37pi2vWn hS8j2ww959UcqMg0cZqnhPYHsO/anUNoJtKqVGGb8BIJYZT89we4nqziEfx3abxoG9cx CR8b6koTvSyfrC2QEQbfcALPzmgvyxyDuaCFjOh1lCCh5j+ypNDWBHZXzTsY5NzzTwu1 /e0A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org Original-Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org. [2001:67c:2050::465:101]) by gmr-mx.google.com with ESMTPS id d4si5678lfs.13.2022.02.07.07.58.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 07:58:13 -0800 (PST) Received-SPF: pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) client-ip=2001:67c:2050::465:101; Original-Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:105:465:1:4:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4JsrQX1TFKz9sQZ for ; Mon, 7 Feb 2022 16:58:12 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de In-reply-to: <4da9a418-d853-4d3f-85a5-955d8118c918-jFIJ+Wc5/Vo7lZ9V/NTDHw@public.gmane.org> X-Original-Sender: albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org designates 2001:67c:2050::465:101 as permitted sender) smtp.mailfrom=albert+pandoc-9EawChwDxG8hFhg+JK9F0w@public.gmane.org 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:30143 Archived-At: Joost writes: > On Mon, 7 Feb 2022, at 08:52, Albert Krewinkel wrote: >> Adding a `code` class to all code blocks is good use-case for a Lua >> filter. You probably won't want `#+result` blocks as code cells, so we >> won't add it to those blocks: >> >> function CodeBlock (cb) >> -- #+results blocks have class 'example', ignore those. >> if not cb.classes:includes 'example' >> cb.classes:insert 'code' >> end >> return cb >> end >> >> I believe that should be enough to produce acceptable results. > > Hi, thanks for the tip and the example code! I'd have to make sure > that `#+result:` code is always wrapped in an example block (by > default, that's not the case) but that would be fairly easy to do. I think pandoc does that by default (modeled after the ox-html exporter). > I just found out that there is an ipynb exporter for Org mode as well > at ,[1] which I'll be trying > out, too. It seems to have its own limitations, so I'll have to see > which option is better in my case. That will probably be the better option in this case. Please let us know how it goes! -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124