From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mJvCGEeAvmRGewAASxT56A (envelope-from ) for ; Mon, 24 Jul 2023 15:44:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yC+pGEeAvmQ8dgEA9RJhRA (envelope-from ) for ; Mon, 24 Jul 2023 15:44:39 +0200 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 131C540116 for ; Mon, 24 Jul 2023 15:44:39 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690206279; 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; bh=iv52OiPf0gqceWy6UpGmi7utwuZe3myxj3LyuLaRvZw=; b=s8y+lq+GDHzrjYStxxw8I7CIa6LH+TWtB1MlOYxytUhjuLcRkqvyT1mGfecYaBd1+t0avD ltdKtf7j4Mt1goRLepLO5apEz7UP2JbeVYltwZzh+zybYFfjXdpWmR9Fm/St+PFjAY5e4A Rq+lEy0vN16zzXsekIa4ARL9Wc4h2iTgdUNNdauRDtxDeoseRkcqqDEEOQFlphSo21K0bC jK//SaqYTfv9weTMnK45sqPzAy7Kc4slkHHTCH/5SeNic+ygg1hu5xvMcqIzoUJTrPllGm ATsWYZSC7qLQdKbn9Sz/M/D+PdkjNlNBwfrcvGeJOmKXgj5oR2IexHbAiYDA+w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690206279; a=rsa-sha256; cv=none; b=Z+iY+fa2A4LkSe8O6W2APNEwRv36wS13QrHjeLZH5I57q3u8O01AqN28NVDnvMXZzgPCgu AlrgsF3FV0NjFakfU2501zw0mBvP+wLCoLROMh5DV/0GSES4A/E2XJfv6PJNirSS2Ff+f5 vjbU8ZHiiQP4iTJtD9C9BYZGcw0n5DjLxJDiIkFgWU5pZP6kkojbwEQAnguQJVyGsyUw8K H/wvlQaxyrJAFpGhbOHLEJqFgsw6K+IRL04gSJA96UkVyxoEVF/IWxFCnTNeRvEaRW4DBw besyvgV6IxM+wW+OJLB4s4JqM5csQADq6q+uKw4mgs6yasU5JHKYIADlL5X/RA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qNvql-0003Mk-0f; Mon, 24 Jul 2023 09:43:47 -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 1qNvqi-0003MX-SW for emacs-orgmode@gnu.org; Mon, 24 Jul 2023 09:43:44 -0400 Received: from relay9-d.mail.gandi.net ([2001:4b98:dc4:8::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qNvqf-0002hZ-KA for emacs-orgmode@gnu.org; Mon, 24 Jul 2023 09:43:44 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id C9C79FF805 for ; Mon, 24 Jul 2023 13:43:35 +0000 (UTC) User-agent: mu4e 1.10.4; emacs 28.2 From: Britt Anderson To: emacs-orgmode@gnu.org Subject: ox-publish index allows alternative formats? Date: Mon, 24 Jul 2023 09:28:16 -0400 Message-ID: <87mszlctmn.fsf@b3l.xyz> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: britt@b3l.xyz Received-SPF: pass client-ip=2001:4b98:dc4:8::229; envelope-from=britt@b3l.xyz; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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+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-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -3.74 X-Spam-Score: -3.74 X-Migadu-Queue-Id: 131C540116 X-TUID: Gzcq93j/GQix Question: Could ~:makeindex~ (in the ~org-publish-project-alist~) be expanded to accept a user provided function for formatting the output differently? Background: I am using org for a static website (brittanderson.github.io). I wanted to make a list of blog posts subdivided by topic and I decided to use ~:makeindex~. I add ~#+Index: keyword~ lines to the preamble of the posts and the list is generated, however I did not like the formatting. It gave me a list of keywords as links (often repeated) with no context (like title or date). So I hacked this alternative: https://brittanderson.github.io/posts/theindex.html It seems like it would be nice to allow users to provide their own formatting functions to ~org-publish-index-generate-theindex~. Similar to the way that ~:sitemap-function~ allows a user controlled sitemap. I altered a few lines to do this for myself (as seen in the diff below), but am unsure whether there is any more general interest in expanding the index functionality or where in the org hierarchy would be the best place to try and code such that ~:makeindex~ can be nil, 'default or the name of a user provided function that expects one argument (to become ~target~). My question is whether this is something that is worth doing, and if it is worth doing how hard should it be for a novice to attempt, and does anyone have any pointers for how to tackle it? -- Britt Anderson My example of minor edits: diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el index 3c7311b56..d04c15fd5 100644 --- a/lisp/ox-publish.el +++ b/lisp/ox-publish.el @@ -1109,15 +1109,16 @@ publishing directory." ;; Last term: Link it to TARGET, if possible. (let ((target (nth 2 idx))) (format - "[[%s][%s]]" - ;; Destination. + "*%s* [[%s]]" + (car (last entry)) + ;; Destination. (pcase (car target) (`nil (format "file:%s" file)) (`id (format "id:%s" (cdr target))) (`custom-id (format "file:%s::#%s" file (cdr target))) (_ (format "file:%s::*%s" file (cdr target)))) ;; Description. - (car (last entry))))) + ))) "\n")))) (setq current-letter letter last-entry entry)))) ;; Create "theindex.org", if it doesn't exist yet, and provide