From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6F+RCJOJN2FgDwAAgWs5BA (envelope-from ) for ; Tue, 07 Sep 2021 17:47:31 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6NgDBJOJN2GDXQAAB5/wlQ (envelope-from ) for ; Tue, 07 Sep 2021 15:47:31 +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 6C476845F for ; Tue, 7 Sep 2021 17:47:30 +0200 (CEST) Received: from localhost ([::1]:42206 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNdJn-0007Qj-LT for larch@yhetil.org; Tue, 07 Sep 2021 11:47:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNdIh-0007Kh-AX for emacs-orgmode@gnu.org; Tue, 07 Sep 2021 11:46:20 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:52068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNdIf-0007Ca-4d for emacs-orgmode@gnu.org; Tue, 07 Sep 2021 11:46:18 -0400 Received: by mail-wm1-x331.google.com with SMTP id y132so1560488wmc.1 for ; Tue, 07 Sep 2021 08:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=rZhjSDSEUqRQ7qGxMgZM2AVzsLIl25mHVoPpZQw2K/w=; b=Ow0TGmWc1FKN97Rvsu+wWGbAVBbH8sOLr1SsPbrPjhMeyYf6HF85gjts9eOpCLpyzZ 8HqEE09vVq+HDbrTA1L7jnd8u3W6EIt8ev9o9olzk8wcKOqOcJKEMn4Ekoh+VBqs0czk Nk5Vkh7l5+T6xjbRHkMgVtVhPesbueMB6Cr8AxxTCmyzayc4LqvNIIzjRkfGX5TLmcIy +urPRkMFU8WKxZuq9WjwOCRUezc4XvDuwenrf1RNZIfeBr3lqEEepriVNgrLjCUH+OsA SxISYe+CKtGj/iDYI+qTx1jnGErA12OefuF1b7dLK/cV4Hn08LiDMRKxc3M88TLAmeb6 mNcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZhjSDSEUqRQ7qGxMgZM2AVzsLIl25mHVoPpZQw2K/w=; b=AXr16f0wfRy/eg5Lboize/zOTj3SBCviJVVcFA0+c8gZCLOgeRcSSytO5KXYsYenhK CfrjWbTw7A4WkzzF7JftTuavjS6U8dXZNuGczyESP1uHqNYuWbfr2o/96utsGy0ejHnN b1bLkOVK5HjzQddESSmP5X+g7KxONdfOzICLBSrtfLAmbeP+HhoXiFsDrn/m/mT4rbCa VZ7DrXVTvCB9C2U50ODl8HLY66fV8NkoyNBohL34EPPVFK+nlVw6tOObdAzJEKUyiU78 cSmq56ncZEF3o4DSN10zkwKWNJ26hU1NFK6IqtNBfZjWL7vyOvRn4JZf5jBUiWRek8VI j6Nw== X-Gm-Message-State: AOAM532PIuXguRhtCqP92VhYDuNuE26j4R2c02ptgfx55f+Pgv9+RDtF jshBWFDDSRrk7AkbBaJjjgbR5Wt3BZY= X-Google-Smtp-Source: ABdhPJzZYM0HcLj65muVE5hb5KaaKN483hCNDjFzh7TRLInVSxxQl3FBWpjvu3xkRFB3/ZzRAH7uVw== X-Received: by 2002:a7b:c246:: with SMTP id b6mr4685539wmj.37.1631029573716; Tue, 07 Sep 2021 08:46:13 -0700 (PDT) Received: from pluto.localnet (aaubervilliers-654-1-86-117.w86-212.abo.wanadoo.fr. [86.212.174.117]) by smtp.gmail.com with ESMTPSA id p9sm11637827wrg.14.2021.09.07.08.46.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 08:46:13 -0700 (PDT) From: chris To: emacs-orgmode@gnu.org Subject: Re: Internal link broken when publishing (was org-id with ox-html) Date: Tue, 07 Sep 2021 17:46:12 +0200 Message-ID: <4827285.5yCLvEFndJ@pluto> In-Reply-To: References: <4617246.m1MCmUpgFQ@pluto> <1640082.E36kBsiRYQ@pluto> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=inkbottle007@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) 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: , 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=1631029650; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=rZhjSDSEUqRQ7qGxMgZM2AVzsLIl25mHVoPpZQw2K/w=; b=LvGuF6soOpbHZAa7MVy7d6GeC4viDk4Sxo2S5+X0sp/Bx+xF3JDZO2xb50i+/rfZ2mfrSC Ic60hpM/sFdkkOz12ygPFr95ADNBPzqdzTCK9lGdS7RdGJFpEGqE1ItMWsndVZtwEdN9LD Qb09EGxQLvmVMpDH0GqW2r+NBG84dth/n2js1XN2mu6ZPU6UXuaJETdP9DG++HmftZARrv Rmri3U6slDdTiBLoJJmPyySwK2i+V+JLD2OJmSkIbduACoITv7h4uqhV9/ubiwplQSGYKh skO7AMvJMQd2AvkbzfUl1NwT5ooSHHBFnjiMsPmO2MZ923boHaheye2XdT9xIg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631029650; a=rsa-sha256; cv=none; b=q6ZbMwSHsAwNLmF5SKXPk3gOsU9UrLnjG9+M5RGeegjFS8rPYlUDHlwuloJ1c1Jvl9OTVX H8QGq87uDelgAFSGpZH4FUghun5u7FFmY9aWr6/gpt0o8G4BgHE/cNsZ4FR8QkyyveZVeE tatWWWqyhM47Uzi5DkJ4mfAkpI0tfazpRsAshRe0kBWma5MlA36Nymsny1vxBTGbopbkbr sL9pmB+JBPR+ByBLmU1ywA3Bs7176n4wudoJOOThkEMrrEdwoevmiq+7LN1QBQO8Nv5jsD 5XPB0QUmRJC+SJFbS2rMr9CZLspmPTrT2ALLd82BoAGhMaHdybwB3cZWMaOaZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ow0TGmWc; 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: -0.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ow0TGmWc; 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: 6C476845F X-Spam-Score: -0.61 X-Migadu-Scanner: scn1.migadu.com X-TUID: OZ3LLJAG5dst On Tuesday, 24 August 2021 17:23:24 CEST Maxim Nikulin wrote: > On 23/08/2021 03:42, inkbottle wrote: > > Links between two different files, like > > `[[id:e54113f9-2ad7-4a86-94be-68ffc696de0b][hello]]`, get broken when > > publishing. (whatever the settings). > > > > I haven't found any workaround. > > > > Being able to move around entries, functionality provided by > > `org-id-link-to- org-use-id`, is pivotal, IMO. > > From my point of view it looks like a bug. > https://code.orgmode.org/bzg/org-mode/src/master/lisp/ox.el#L4381 Thanks a lot for your help, I'm really struggling on this one. Sorry, I was afk for a few days. I believe it's a bug, plain and simple. With a unique org file, the `:ID: e54113f9-2ad7-4a86-94be-68ffc696de0b` are resolved to `orgfa9c151` consistently. Which is the expected behavior: the translation table is consistent. When there are multiple org files, in every example I've tried, every `org-id` based links was broken. There is a patch here: https://gist.github.com/jethrokuan/d6f80caaec7f49dedffac7c4fe41d132 but, as I understand it, the workaround consists in treating `:ID:` similarly as `:CUSTOM_ID:`, that is, exporting them "verbatim". That method, would be different from the *upstream* way, consisting in creating a "translation table". IMO the "patch" is more like a temporary workaround which can make the code confusing and difficult to maintain. Because a unique question is solved in different ways by different developers in different files. I think that the fix should happen in https://github.com/emacsmirror/org/blob/master/lisp/ox.el where the translation table is created and used, but I failed to grasp how it works due to my insufficient understanding of emacs-lisp. > checks for ID property. > https://code.orgmode.org/bzg/org-mode/src/master/lisp/ox-html.el#L1659 > queries CUSTOM_ID only. I suppose, ID should be here as well. A subtle > point is which one (ID or CUSTOM_ID) should be used if both are defined > for some headers. Yes, "ID should be here as well" => No. That is the point I'm advocating above. `:CUSTOM_ID:` are meant to be treated in a so-called "stable" way. That is to say, the `CUSTOM_ID` you see in your org-file, is what you get in your HTML file (also I've done some tests with that method, and I recall it wasn't working at all in a multiple org files setting). On the other hand, `:ID:` are meant to be treated through a *translation table*, and should result in some `orgfa9c151` thing, on the HTML side. Weaving the two methods together doesn't seem like "road to success". > Maybe it is possible to create workaround as a custom config without > touching of Org code. I guess, "nicer" ids may be replaced by values of > ID property. Examples (I tried none of them): > - > https://tecosaur.github.io/emacs-config/config.html#nicer-generated-heading > https://orgmode.org/list/E1jxAjq-0004Dk-LH@lists.gnu.org/ (TEC. > [Interest] Determanistic Org IDs. Sun, 19 Jul 2020 22:27:31 +0800) > - > https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchor > s > https://orgmode.org/list/CA+G3_POCYTKR6M1K8XUPzUsg5EHd5Tv4FE4X-6MvadCSjSkHi > A@mail.gmail.com/ (Tom Gillespie. Tue, 8 Dec 2020 20:39:08 -0500, Re: > stability of toc links) - > https://github.com/zzamboni/dot-doom/blob/master/doom.org#capturing-and-crea > ting-internal-org-links > https://orgmode.org/list/CAGY83EcFExvco6TuTOQiywgdDO0cXE+db828LeiDdimxBroVs > g@mail.gmail.com/ (Diego Zamboni. Wed, 9 Dec 2020 09:45:52 +0100. Re: > stability of toc links) - > http://ivanmalison.github.io/dotfiles/#usemyowndefaultnamingschemefororghead > ings > https://orgmode.org/list/4698cfeb2e415f88bd25e71267f29168@isnotmyreal.name/ > (TRS-80. Sat, 12 Dec 2020 20:25:15 -0500. Re: Better heading links in > org-mode exports) > - https://writequit.org/articles/emacs-org-mode-generate-ids.html The methods above are, as I understand it, all about making more beautiful links to export to HTML. Not about the "translation table" devised in `ox.el` being broken when working with multiple org-files. org-id is creating a neat framework for navigating between multiple org-files. Also, if I remember correctly, when using `CUSTOM_ID` with several org-files, you have to specify the file, contrary to how org-id work, using a database to find all by itself, the correct file to jump to.