From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.orgmode,gmane.emacs.devel Subject: Cusom special block export, similar org org-link :export parameter (was: Org mode and Emacs) Date: Wed, 15 Jun 2022 14:13:37 +0800 Message-ID: <87edzqv4ha.fsf@localhost> References: <87ee038ipt.fsf@gmx.de> <87o7z61v59.fsf@gmail.com> <87bkv527p5.fsf@gmail.com> <835yld93w7.fsf@gnu.org> <877d5t0yrn.fsf@gmail.com> <87r140yuof.fsf@gmail.com> <875yl9e7zm.fsf@gmail.com> <83czfh12kp.fsf@gnu.org> <87pmjhghu2.fsf@localhost> <835yl910gp.fsf@gnu.org> <87wndndbhq.fsf@gmail.com> <874k0qbrhe.fsf@localhost> <87v8t3wfgd.fsf@localhost> <87zgifxt48.fsf@gmail.com> 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="37190"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, theophilusx@gmail.com, eliz@gnu.org, monnier@iro.umontreal.ca, acm@muc.de, emacs-devel@gnu.org, emacs-orgmode@gnu.org To: Robert Pluim Original-X-From: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Wed Jun 15 08:15:29 2022 Return-path: Envelope-to: geo-emacs-orgmode@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o1MJM-0009X8-4f for geo-emacs-orgmode@m.gmane-mx.org; Wed, 15 Jun 2022 08:15:28 +0200 Original-Received: from localhost ([::1]:43180 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o1MJK-0006xx-JB for geo-emacs-orgmode@m.gmane-mx.org; Wed, 15 Jun 2022 02:15:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1MGZ-0006wx-Pu; Wed, 15 Jun 2022 02:12:41 -0400 Original-Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]:43742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o1MGW-0004jD-I2; Wed, 15 Jun 2022 02:12:34 -0400 Original-Received: by mail-pg1-x52c.google.com with SMTP id s135so10469857pgs.10; Tue, 14 Jun 2022 23:12:30 -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:content-transfer-encoding; bh=SoMOADIQYhSeGbKtTtZewLYuos+hM+xQrZkwqXjPeZ8=; b=fPipLXOwKcdl3qBU3k8N3Pp5rXMP5M5LN5FJkyTpTlGx0NDlwIX4+fB1DWhSQ2Pn2W XWZSi7iOX5bD7JyZ34ZuLenmLf8re6YKYoiUwWcUhSFB8D67PHE/VuetnYKXRt7X0Tpu 0Xv7lOr0Fmq8AR7Sh7bgGywBKGA6f1sfoiNWByHIl3xX9NSHgMyv7UwHn2XPDVszIWOe g2ghdhLpNK4Cg3xyhQ/8bfEHPrm6q737KGBFRXqT9bnSf902yUUdSWaM23pK5O/LiCCE 40TPlCNehtzc3rld2gQTgb5RtoZOML529nNke8oMfD/uvFeHWBGq6HnlDwNlHQmQ8j5P 33eQ== 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:content-transfer-encoding; bh=SoMOADIQYhSeGbKtTtZewLYuos+hM+xQrZkwqXjPeZ8=; b=EtB7xB9M3FUxuNavqkOGzL/n0qxFltB+IODeIsfczH0vb51jzhl9C0AnyqsKhAKr8f bFYtWBi8E50UcE4VdJlh/Bwz2lOOVB8SZdn2Yc5kyR2os7yVw7XtrqiosQXSQ+js4aXt iQqP20t8q74CSy5gckOOuVQ9Il7Ky8+biEd2hO6xYExuCGZm2Wg8ja8lisoMGdd2w2nB fjxEZjERiGBfPzO/YqPEcYikv/UEw/FYPLCoOQNhuGflx5CXxrRngTciuJBPsrhYWdU7 JJqU/TnDvoUkqwtW4pQoUQMZYOKLbQSf4B4U0E4IlkVrFH0SLy+eAUDjHuuh/yDj7ElR zrUA== X-Gm-Message-State: AOAM532RX7jxukQlWSWMNuvr0MVRXHAofXte0feFJjp1jfCZ8PuX5kvS /KyXfCojfnGlNTOTLhwsv54= X-Google-Smtp-Source: ABdhPJws7u9jsSZPUf7aYMMvAVJa3SRnyiq2piscUQuicj2zbBSHSQFPS+EOqp0H+FckcdbMJaLcVg== X-Received: by 2002:aa7:8ec6:0:b0:51b:c6ec:5ff5 with SMTP id b6-20020aa78ec6000000b0051bc6ec5ff5mr8177708pfr.5.1655273549796; Tue, 14 Jun 2022 23:12:29 -0700 (PDT) Original-Received: from localhost ([155.94.207.39]) by smtp.gmail.com with ESMTPSA id q18-20020a63bc12000000b004088f213f68sm5038453pge.56.2022.06.14.23.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jun 2022 23:12:28 -0700 (PDT) In-Reply-To: <87zgifxt48.fsf@gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=yantar92@gmail.com; helo=mail-pg1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, T_SCC_BODY_TEXT_LINE=-0.01 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+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-orgmode" Xref: news.gmane.io gmane.emacs.orgmode:146082 gmane.emacs.devel:291192 Archived-At: Robert Pluim writes: > Ihor> However, we have special blocks for this purpose. They are exte= ndable, > Ihor> as I descibed above. Though some improvements in Org core might= be > Ihor> needed if we have to use this extensibility more frequently. > > My first thought here was Org macros, but as far as I can tell they can= =CA=BCt > be multi-line, which would make them a bit cumbersome to use. Tell us > more about special blocks, the documentation on them is a bit sparse. Macros are meant to configure per-document level of export. Not global, usually. Special blocks are Org blocks with the following syntax: #+begin_environment [optional parameters] #+end_environment With "environment" being any word except "center", "quote", "comment", "example", "export", "src", and "verse". Currently, latex export directly translates such blocks into \begin{environment} \end{environment} plain text export supports special handling of environment=3Djustifyleft, justifyright. html export supports '("article" "aside" "audio" "canvas" "details" "figcaption" "figure" "footer" "header" "menu" "meter" "nav" "output" "progress" "section" "summary" "video") special blocks texinfo export translates special blocks into @environment [options] @end odt exprot supports "annotation" and "textbox" blocks. etc. Because "environment" can be pretty much anything, we can have a pre-processor in org-export-filter-parse-tree-functions that transforms different special blocks into appropriate form for a given export backend (texinfo, latex, ascii, html, etc). This way, we will not have to rely on backend-specific handling. Such pre-processor currently does not exist, but it would be fairly trivial to implement. We may even introduce an interface similar to org-link-set-parameters for easier configuration of various types of special blocks. WDYT? Best, Ihor