From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id QBSYIjOsVWYrTgEAqHPOHw:P1 (envelope-from ) for ; Tue, 28 May 2024 12:04:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id QBSYIjOsVWYrTgEAqHPOHw (envelope-from ) for ; Tue, 28 May 2024 12:04:35 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ifi.uio.no header.s=key2309 header.b=zLFenYBv; 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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716890675; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=HVGrAprTOPbMOeqtNCgokHpnoAzfe+0zx+bSzFYVj1s=; b=uSXSbVdbklISU8jlg2djy8y1s/BOJGEOxf6euj6W8eDntaj91HJfH+Oe3TGX5mt+vv6AsM quNTE+afZ2IphlaTxYtRJQMXi0mL42uZhSXXJTGhWaV41H0A0i0YsyIrzndalt9RSmS9lp G8RJWloKr/hvMD0++7pAUpSYPnbRX+G92V/XjsAvVbvs5R9qToRwBuRyhfyxJmRt2wZrq1 qutGkXyI3+s+2JAUs7ZO+KqGfUoFXMlCUiTkFwuvmMgRhoiSmmFedCTmV277OO2FSdcDCs te4OtU4EfINGSGExb3xecAiYYnPmQpx3mojouxiCfE3R+/b3Q1Hn6SFxZgw0LA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ifi.uio.no header.s=key2309 header.b=zLFenYBv; 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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716890675; a=rsa-sha256; cv=none; b=hHCLaNxPjywxtoR9+nYBVWp+JvTYzDrMOCh3HkJBoDTlFNsHO43YeFfLY/g1l5mRUztDmB RSk7rNiN4eyn1Vx/a/y/BJTuM83dCT8r96V0Nu6NhOHPyo3MsYbKa2MkTU0I8+GIJ5t7Hb FJGJIZtc1TZUQ7k1XC4uX1Iy4UllFX13K+ZY+Ptn5N+uEwpR4gDVUszGdJI1ReUpwKcVbv zLIbv0aMvZRg9bKJE3QI7/S7oxn7vr7rFzSngMyfoctWYpOV8HwtVJD82rXXZGNiqT0SnE zp2zXHVZgLYgfGoKrNZJpPp93vcKlgtY5lQQdIWa2U83YwXn05E14ApK3cCVpg== 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 1EE5C76FB8 for ; Tue, 28 May 2024 12:04:35 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBtfp-0004uh-6I; Tue, 28 May 2024 06:03:17 -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 1sBtfl-0004tv-E5 for emacs-orgmode@gnu.org; Tue, 28 May 2024 06:03:13 -0400 Received: from mail-out02.uio.no ([2001:700:100:8210::71]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBtfi-0002Uy-9B for emacs-orgmode@gnu.org; Tue, 28 May 2024 06:03:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ifi.uio.no; s=key2309; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender :Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=HVGrAprTOPbMOeqtNCgokHpnoAzfe+0zx+bSzFYVj1s=; b=zLFenYBv01AYtaRGUfLvksrQV/ Z9LVSP3i4cOe2UiyZ4o9ywMA1Ib95T+QIPYkY1b2IEhAF576iqqGf5F4MaFyVHbsQb5p5YPHDwgbc 7rrCNDxoGTOC9QVbnGxeDzqPLoJGSk0wgHOz87/702Z2fkejXEA/GD1y2DiTVXt6s8uawi5A7RwWg d6W8pdg05jzmbeyyDB0+vNJS/cYMk8pnjaGD3KuVIjgh00ZmfrHBvJpipLXi3llwzfbUv4/1NBWUk xeS/ZQpb0ol64XQiVTSu9BvnK2fBzVw5m+/2Fl8mv3D44Mj3dY5VrvirReB3GRlQiFwjZ0ijaTt2L XUlUf9iA==; Received: from mail-mx10.uio.no ([129.240.10.27]) by mail-out02.uio.no with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1sBtfa-008tCi-0w for emacs-orgmode@gnu.org; Tue, 28 May 2024 12:03:02 +0200 Received: from galneryus.ifi.uio.no ([129.240.137.34] helo=galneryus.ifi.uio.no.shmi.ifi.uio.no) by mail-mx10.uio.no with esmtps (TLS1.2:ECDHE-ECDSA-AES256-GCM-SHA384:256) (Exim 4.96.2) (envelope-from ) id 1sBtfZ-0001ga-2k; Tue, 28 May 2024 12:03:02 +0200 From: Martin Steffen To: emacs-orgmode@gnu.org Subject: question about links, macros + org-publish and "parametrization" Date: Tue, 28 May 2024 12:02:56 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-UiO-SPF-Received: Received-SPF: neutral (mail-mx10.uio.no: 129.240.137.34 is neither permitted nor denied by domain of ifi.uio.no) client-ip=129.240.137.34; envelope-from=msteffen@ifi.uio.no; helo=galneryus.ifi.uio.no.shmi.ifi.uio.no; X-UiO-Spam-info: not spam, SpamAssassin (score=-4.8, required=5.0, autolearn=disabled, T_SCC_BODY_TEXT_LINE=-0.01, UIO_HTTP=0.2, UIO_MAIL_IS_INTERNAL=-5) X-UiO-Scanned: 4D78592E5E502DBFFE49A834950940F9936FCCB9 X-UiOonly: 6097666F09D62D5D6C859D92F9CF6261506DE340 Received-SPF: pass client-ip=2001:700:100:8210::71; envelope-from=msteffen@ifi.uio.no; helo=mail-out02.uio.no 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_CSS=0.1 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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -2.35 X-Migadu-Queue-Id: 1EE5C76FB8 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -2.35 X-TUID: s+t7pRN74cVB Hi, I got a question whether the following is possible, when using org-publish. Concretely I generate with org-publish markdown-files (that ultimately are turned to HTML), but I guess the question is not specific for this choice of a ``publication-process''.' The whole content consists of quite a number of files, and in particular has quite many html-links, and the links change (each year, each semester) and they change in ``systematic ways'' What has been for instance https://www.gitpages.io/somelecture/fall23/exercises will have to be changed for the next round to https://www.gitpages.io/somelecture/fall24/exercises (and there are links for many things beside exercises, and also they have to be changed analogously). The way I make that smooth is I define #LINK: exercises-web https://www.gitpages.io/somelecture/fall23/exercises and then, When the semester comes, replace all occurrences of fall23 to fall24. Even if there are quite a number of such link definitions (for all kind of information), it's straightforward. It's systematically organized, and if all the link definitions are centralized in some file collectionoflinks.org or similar that is #INCLUDE:-ed into all the other files that work with this links, then ``porting'' of the whole set-up to a new semester is quite easy and robust. So I am happy with that, but I wonder if I could make it even more parametrized. Like combining macros with links like that "fall23" is an argument to a macros, which then builds up a link. But that does not to work in a naive way, like #+MACRO: semester fall24 #+LINK: https://www.gitpages.io/somelecture/{{{semester}}}/exercises since macros do replacement in "text" (not in those #+-"meta-commands"). I tried parametrized macros_ #+MACRO: parametricexercizes https://www.gitpages.io/somelecture/$1/exercises and that half-way works. I.e., if I do parametricexercizes(fall24) (*) it works in that it results in a page with a correct link, but that's not quite what I want, for 2 reasons. Really useful would the parametrization if one could do parametricexercizes(semester) where semester is a macro, not a literal "fall24". The second reason is that the use as in (*) is not really useful, what I am really after is something like [[parametricexercizes(fall24)][the exercises are here]] and the combination of macros inside [[ .... ]] does not work either. Maybe there are other ways to achieve ``parametrization'' (or maybe not, I have not worked much with macros in Org), any ideas? best, Martin