From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.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 SDovEgVwsmZ32QAAe85BDQ:P1 (envelope-from ) for ; Tue, 06 Aug 2024 18:48:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id SDovEgVwsmZ32QAAe85BDQ (envelope-from ) for ; Tue, 06 Aug 2024 20:48:37 +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=1722970117; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=fSBX3d9xDNJ3k+TIuEYgSwqFCHUDMfpNI04Yy8efAZc=; b=RZ6dhYytyHplznhUyk+SaJj4KkfbwuV9J6Nvvo8J1tecz8KLAa13Arsn6mqOYeMG8BWOUY JBOXhtBwM+fd7vcIVQ28SX7Plo25DCigWRo4sfS1mXMtSRBa2y5rfaXg4hPBTwjYJTiNes TQ6P4ZuARj1pLlxE3s/UetIsapoXABju+6JETCDOAHIH8xICrNatFOUWhapq1VsZShc+zq 2g6xRyAR9JzX9siUMGquzhiIao8uI/1Ez+RDQchdmM77qAYQ5ElCVoKMZdDAG6WIymJsk/ llnopTZA8/tpn+OuOyxOdCUxfLI7tMfbXRQ9MVb+4cS1bcTds7iIkn4N1s2xLA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722970117; a=rsa-sha256; cv=none; b=HVL8wyNIpPb2+obLl6YS4qAw4aqiRrsni2A1JBopIzD1nxCl4HaUBIWAfe9LfZVXOorAGN ppf8tvi7/yhkUlv4Lji+5fUXQJK0uGVGETC4299LfRTsh3uAwoUzL+xnZSdV23V1XPzgvU hg7XxJVfZPuKM/t0QYAXLisX28lD4BafMF4K1mpytLEJ9yVJ4nkxQ5PQZhK0ZdzhGPkV6B 2p5DgG7LmkQpxdNYV1rItGavF0slSv1dCrA0PkA0/I0BIwtLnvf2DJbAyDLhuzFpL2rthE +alj5Kir+RrwgGq9Hjt6FyqtuyXBRT7mxOhvvbo4ogQzEwhqiUshlnqneNKCrw== 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 1E1A5351B7 for ; Tue, 6 Aug 2024 20:48:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbPDa-00034Y-PG; Tue, 06 Aug 2024 14:47:34 -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 1sbPDX-00034D-VL for emacs-orgmode@gnu.org; Tue, 06 Aug 2024 14:47:32 -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 1sbPDV-0000Ws-Ih for emacs-orgmode@gnu.org; Tue, 06 Aug 2024 14:47:31 -0400 Received: by mail.selma.hfmdk-frankfurt.de (Postfix, from userid 113) id 908B1F60E60; Tue, 6 Aug 2024 20:47:25 +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 6865BF60E60; Tue, 6 Aug 2024 20:47:23 +0200 (CEST) Received: by selma.hfmdk-frankfurt.de (Postfix, from userid 1000) id C0A8239605E2; Tue, 06 Aug 2024 20:47:22 +0200 (CEST) Date: Tue, 6 Aug 2024 20:47:22 +0200 From: Orm Finnendahl To: Ihor Radchenko Cc: Org mailing list Subject: Re: multipage html output Message-ID: Mail-Followup-To: Ihor Radchenko , Org mailing list References: <87sew011c6.fsf@localhost> <87frrzdrbz.fsf@localhost> <87plr14wka.fsf@localhost> <87bk2i8w07.fsf@localhost> <87r0b2kext.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87r0b2kext.fsf@localhost> 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: 1E1A5351B7 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.84 X-Spam-Score: -5.84 X-TUID: F2TiFrWaWUah Hi Ihor, it was easier than I thought, although still nasty: https://github.com/ormf/org-mode/tree/org-html-multipage Maybe you can check whether this is along the lines of what you had in mind. Am Montag, den 05. August 2024 um 18:22:22 Uhr (+0000) schrieb Ihor Radchenko: > I am also a bit surprised that you went as far as adding documentation > to the manual. We are a bit early into the review, so things are still > going to change. Let's focus on the code first. Don't be, it was just an exercise, not much work and I expect there are probably changes. I just thought to present it for commentary. > > + (setq tmp-info info) > > ... > > + (setq global-prop org-export-filters-alist) > > I noticed temporary debug statements and some (message ...) statements > sprinkled around. They are ok for the time being, but will need to be > removed before merging upstream. of course. I removed most of them now. > > +(defvar org-export-multipage-split-functions nil > > + "List of functions applied when multipage output has to be split.") > > Please be a bit more specific about what these functions are. Here is an > example of a complete docstring: > > (defvar org-export-filter-parse-tree-functions nil > "List of functions applied to the parsed tree. > Each filter is called with three arguments: the parse tree, as > returned by `org-element-parse-buffer', the backend, as > a symbol, and the communication channel, as a plist. It must > return the modified parse tree to transcode.") done. > Also, please mention that `org-export-multipage-split-functions' are > called _only_ when multipage output is requested. This means that > `org-html-multipage-split' does not need to check :multipage property. done. > > +(defun org-html-transcode-org-data (data content info) > > + "Transcode the top org-data node of the org file to export. > > ... > > > +(defun org-html-transcode-multipage (info &optional body-only) > > + "Central routine transcoding to multipage output called by > > +`org-html-transcode-org-data' called from `org-export-as'. > > ... > > I see nothing specific to HTML in these two functions. Please, factor > them out into ox.el. I think that they can be all merged into the > default `org-export-transcode-org-data'. I factored out org-html-transcode-multipage to org-export-transcode-multipage and got rid of org-html-transcode-multipage. > > +(defun org-html-multipage-split (data _backend info) > > ... > > + (if (not (file-writable-p dir)) (error "Output dir not writable") > > + (let* ((encoding (or org-export-coding-system buffer-file-coding-system)) > > Checking output dir does not belong here. That was a leftover, I had already fixed but forgot to delete the condition statement, thanks. > > This is awkward. Why not modifying DATA directly? Say, you can > transform it into (org-data (...) (org-page ...) (org-page ...) ...). I implemented it now by making org-page elements full citizens, adopting their contents so that you can org-export-data on them. It was quite nasty concerning link resolution but I found a reasonable way to solve this. This is just a proposal to check whether this architecture is the way to go. I got the idea that it might be feasible to integrate all page related properties directly into the properties of each org-page element rather than annotating info with this information. I will look into that in the following days as it might simplify the code somewhat, but it won't be a drastic change (just again probably a chasing of many nasty details ;-). -- Orm