From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8DZOIegvW2E0qAAAgWs5BA (envelope-from ) for ; Mon, 04 Oct 2021 18:46:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qMT9HOgvW2GgGQAA1q6Kng (envelope-from ) for ; Mon, 04 Oct 2021 16:46:32 +0000 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 A198F309C5 for ; Mon, 4 Oct 2021 18:46:31 +0200 (CEST) Received: from localhost ([::1]:51862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXR6k-00010f-80 for larch@yhetil.org; Mon, 04 Oct 2021 12:46:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXR5E-0000xj-AS for emacs-orgmode@gnu.org; Mon, 04 Oct 2021 12:44:56 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:40798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXR5D-0004kd-06 for emacs-orgmode@gnu.org; Mon, 04 Oct 2021 12:44:56 -0400 Received: by mail-lf1-x131.google.com with SMTP id y15so8537135lfk.7 for ; Mon, 04 Oct 2021 09:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=KhDh5iX6oYYMjUMB09zLZjC1TiWQgD0G7GTcf/pi8Qk=; b=ByUjCMWdIzeCR6pwjrvnNVsbPGhq2rdmUUJiQvmA4yMYB5G8/tDMGJ8dzed83vbZQw pElInqLqhbw1XzxdVKp91Z/SNur55mPkbf+wLJovCWmTRIu3DKfTNN/wtgYyF4TK3QZu wCg8M0mCPVA7fLanWgFj48xOZIaE5z4WRjfSWQ6n5qVzRBVwQGYJ81vrnIffFJ2uzinu eYzR2Zny8nqYPdmsqoSTRnq9BDbkFnDYtkSKthETrjX/G1QXZL33IeT4XZFWhJWI2oUZ guucl/vOWEkOPQbRVYZnF147pn7Zy15juZxQo/HDaykmYRZccWTrJKF7hB1I1V75oD2V bGPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=KhDh5iX6oYYMjUMB09zLZjC1TiWQgD0G7GTcf/pi8Qk=; b=ZfqF71iYTezGegKsfeQrvgJ4LlTIrWhQkhvvWmw1PzUYX4y2ENayHYopWh5u2BxZ/v A7W8Dq6JSJpxQ0YINlcnBP1XN4BqiOLks5YnUvhWH5fNxfJtQJFgzLcBJw60bOhV2NR1 N77hTHqk0mpfb6lDTzmziZc7n0IqAXdT1eCbqwf8uPXcbK6+Sk7lk/QEBO7MoJGC8AFL eMtfTMzsxFFlpiBwxldgp098BVCBJl3cdTc0g0YABxCpN4c6xff30bCIaQ6H+SxOf9D3 2h9wWqeW1ftNvgu40LJzYQhKEZrzqieykrmcYqtoie/o9/suTkVQC7XW9cDFryc8lmDD BgiQ== X-Gm-Message-State: AOAM532/QH1vXzN0DwoJbQyI1VdejpaP1fXUiIjIHe2/WDoS3VtVk2Xe 1twlEB0g6S50ZAWMedaI/GQ= X-Google-Smtp-Source: ABdhPJx9FuS5o35rsFVlE7IzBHlEoGif4A/owx4VU29jKTkWTrBH1JD92PFKpu7AVtxFEtK3a8N60g== X-Received: by 2002:a05:6512:3501:: with SMTP id h1mr15486439lfs.235.1633365891513; Mon, 04 Oct 2021 09:44:51 -0700 (PDT) Received: from localhost ([158.255.2.9]) by smtp.gmail.com with ESMTPSA id x15sm1366993lfe.129.2021.10.04.09.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 09:44:50 -0700 (PDT) From: Ihor Radchenko To: Jason Ross Subject: Re: Best way to include METAPOST in ConTeXt exporter In-Reply-To: References: <87wnmtb2sb.fsf@localhost> Date: Tue, 05 Oct 2021 00:46:08 +0800 Message-ID: <87o884buwf.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=yantar92@gmail.com; helo=mail-lf1-x131.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633365991; 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=KhDh5iX6oYYMjUMB09zLZjC1TiWQgD0G7GTcf/pi8Qk=; b=lLJmx+ueRjWT5BWb1ag3ZRN95ZHRcTTOb3PYSvu80ixahmUvHWVI9E6bIdZg2I2s1CKvsk nSLgOWLI+AdoH8TkC4/BgWkAFl+mitSCUhkYKdcCACUEpZqv/kR+ti+a8r3cWzSoTFg0lv ESST56DNxiVG40wlOa2lFtQuRijmrIOrj+mK5DmJ9uIrqcXUMWhOeZjjeuazM8ZO2E0rWm 810QRmhJl8GWC9Ym58jA3vVymj9E7cOglMY/QmYbmCizX31bYdwWVOxaPGqYxRPAE/mNNm 8A8z4CHpWeU3lIlPUvz0ouosdf/ihDjHuwpm4ot4X3X8KsTHhoi2wubITerzuQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633365991; a=rsa-sha256; cv=none; b=AclJeYb035vFHvVeMMfyOrsxScXJn8jebv2lqUKSgmUr9iL0LSDPE5HXwbAXPiGXr+capz s4NPv6XP389GFm+KgMKQFrsPpgGwGQvqWgLqJc5u0HGaVMi7Zpsjii90+4ZR1b/IC7imTR RmEyM2EzceVlb8vBer+3hyVgGi0w3uuHz1qggSR29V64HtIqanXQoOZmHcR6nIpjq9+iT1 4SOzBePdQJWlpoS2D9bcOhrE17Lz2ic2kRgQBA1lGwEUBrzYP0MYnTSAQgITdS3IR9udiB vdEnQ1jv1Xs/FLaPlDylCJOlbtoFwU3yocfvu6fKVnz64ZDfQHNY1GnzuyH0ww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ByUjCMWd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ByUjCMWd; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: A198F309C5 X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: Xoi6qKR6JaaK Jason Ross writes: > I had considered using special blocks; they match my mental model the best. > However, they don't provide any support for syntax highlighting or opening > the block in a new major mode buffer. I'm not sure if it's worth giving up > language features in order to use the block that's most intuitive to users. > > I'm also considering writing an Org Babel module for METAPOST. This could > allow METAPOST figures to be included with any export backend. However, > if I go this route, there are still some challenges: If you are in control of the export backend, you can directly process the metapost source blocks during export and ignore/filter their output as needed. > #+MACRO: conditional-header (eval (when (not (eq > org-export-current-backend 'context)) (concat "#+HEADER: :results > file :file " $1))) > #+BEGIN_SRC metapost :results drawer :post > wrap_metapost(name="my-name", caption="my-caption", data=*this*) Or you can use "raw" results by default and format everything as you wish in your Org Babel module programatically. If above is not sufficient, you can install global export filters that can transform the metapost blocks/source blocks/their results as you need in other export backends. Best, Ihor