From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GOE8AWJRnWabkgAA62LTzQ:P1 (envelope-from ) for ; Sun, 21 Jul 2024 18:20:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GOE8AWJRnWabkgAA62LTzQ (envelope-from ) for ; Sun, 21 Jul 2024 20:20:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=hfmdk-frankfurt.de (policy=none); 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721586017; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=df+aBL63+rxrLSD/wIzY6KOkFNc8IQ5EJHnlFG6ZOZU=; b=Tt9m1hb+YLetQi54uMJkQyYZGwsX83gick1miiVNx3XDmBaqK2ENew28HivAGdIAOGq182 cMZsTSEyiaX3pVmgGy1DQiCoc5RdGPLh8bGylHez2RaAum3wyO7C+bnirtrXmknqWM69mt wVpYw87/FGAruPQTN3QcY90VdrDBQ4woWvt5LZ4R0xveUS1lboJgDjV6xjDFbgRYFwo/D6 dXIH8r6v6cbSBDKc+o7tnkT8y2+tE0Jq+0bLNdXLkit/ik09VAQr30kSOW+uaX/JGGYign 3N1UM6XRCRT50BgTNF/HOuq2qkMlffGCSxuPbzw8PHjTA6idhxWwlt0AJfy2Mg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721586017; a=rsa-sha256; cv=none; b=cJEBBkFjzvfUDXhbEhI+zcjDpB3PszOXQJ2NNc/JJjWu03/rs/QH5RwgcJv7wj7B+FzLHR O19Jtxubpm1+NVMKWS1N1ymvnJvgeHLnTBRDiKTB+JeiDPXnVBQczh+JWUOuwGiFDbUDE4 2F3N7gES+HsVdxQyeT7G2jah5sZUIrwjULU1A4mt9X8GCBcw9+eoC25nIQ/G3NPlfwnIHF 8QnCZolh80a+ki0OLZyCJN0nzq0X/33t3HBLzwXNcnJk6DPtRWE9mIjyy6drDWJJ41J2fC SRQGGA83sDt4kQoFBcWzoMX/6TvQXusT+9Lkr5bBbwHk8O5zbIqGkU/39yi/nQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=hfmdk-frankfurt.de (policy=none); 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" 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 CF48464B74 for ; Sun, 21 Jul 2024 20:20:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVb9l-0004re-8M; Sun, 21 Jul 2024 14:19:37 -0400 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 1sVb9h-0004oN-Sq for emacs-orgmode@gnu.org; Sun, 21 Jul 2024 14:19:33 -0400 Received: from www.selma.hfmdk-frankfurt.de ([46.4.92.145] helo=mail.selma.hfmdk-frankfurt.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVb9e-0007de-Pb for emacs-orgmode@gnu.org; Sun, 21 Jul 2024 14:19:33 -0400 Received: by mail.selma.hfmdk-frankfurt.de (Postfix, from userid 113) id 40EFFF61C8A; Sun, 21 Jul 2024 20:19:21 +0200 (CEST) Received: from selma.hfmdk-frankfurt.de (ip-037-201-128-004.um10.pools.vodafone-ip.de [37.201.128.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (Client did not present a certificate) by mail.selma.hfmdk-frankfurt.de (Postfix) with ESMTPSA id 1B637F60715 for ; Sun, 21 Jul 2024 20:19:19 +0200 (CEST) Received: by selma.hfmdk-frankfurt.de (Postfix, from userid 1000) id 6E7C2396054B; Sun, 21 Jul 2024 20:19:18 +0200 (CEST) Date: Sun, 21 Jul 2024 20:19:18 +0200 From: Orm Finnendahl To: emacs-orgmode@gnu.org Subject: Re: How to fully control parsing of Org mode links during export Message-ID: Mail-Followup-To: emacs-orgmode@gnu.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Disclaimer: Why are you listening to me? X-Operating-System: GNU/Linux Organization: Hochschule =?utf-8?B?ZsO8?= =?utf-8?Q?r?= Musik und Darstellende Kunst Frankfurt, Frankfurt, Germany Received-SPF: pass client-ip=46.4.92.145; envelope-from=orm.finnendahl@selma.hfmdk-frankfurt.de; helo=mail.selma.hfmdk-frankfurt.de 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, 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 X-Migadu-Queue-Id: CF48464B74 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.51 X-Spam-Score: -5.51 X-TUID: G03tQtxU6dzT Hi, this is how I currently do the debugging of html-export (there may be more elegant ways, but it works well for me): - Copy (defun org-export-as ...) from ox.el into a local elisp buffer of your liking (any buffer with the name .el should do). - In that function add the line (setq info-debug info) just after the comment lines (Lines 2997/2998): ;; Eventually transcode TREE. Wrap the resulting string into ;; a template. (setq info-debug info) - Evaluate the new definition of org-export-as and run the export from your org file once. Now you can access the complete parse tree with (plist-get info-debug :parse-tree) (make sure just to use a small document, otherwise the output might be pretty nasty as the parents of all elements are recursively fully contained in the parse tree). You can extract all links of your document with: (setq all-links (org-element-map (plist-get info-debug :parse-tree) 'link 'identity)) And you can check the output string of html with this: (org-html-link (nth 0 all-links) "" info-debug) You can then check what you have to do to make org-html-link output the desired string, or redefine org-html-link to do what you need and later make a derived backend from the html backend replacing the org-html-link function or simply load the new definition of org-html-link using a mechanism like #+SETUPFILE: in your header. HTH, Orm Am Sonntag, den 21. Juli 2024 um 13:19:29 Uhr (-0400) schrieb Robert Weiner: > Hi Org developers: > > I could really use some help from Org export experts. I have > been trying to tweak export link parsing to do what I want > without any success. Here is a summary of the issues and related > questions I have. > > Usinf Org version "9.8-pre": > > 1. When exporting from an Org file to html, I want this > [[Emacs#Section-One]] or [[file:Emacs::Section-One]] > to be converted into this: > Emacs#Section-One > but instead Org export produces: > Emacs#Section-One > > 2. When exporting from an Org file to html, I want this > "[[One Testing]] Three" > to be converted into this: > "One Testing Three" > but instead Org export produces: > "One Testing Three" > > 3. When exporting from an Org file and I have defined the html export > syntax for mytype: to html, I want this: > [[mytype:MyLink]] > [[Testing]] > to be converted into this: > MyLink > Testing > but instead Org export produces: > MyLink.html">mytype: href="Testing.html">Testing > > My questions are: > > 1. How can I change `org-element-link-parser' in tandem with > ox-html.el to output simple HTML links without any of the text > within double brackets bleeding outside of the HTML link? > > 2. How can I get the exporter to run in my current Emacs process and > spawn a new Emacs so that I can easily debug in-process? I think I have > turned off the async export option but it still runs async and I can't > step through the exporter functions. > > Thanks very much for any help. > > -- rsw