From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 4G/UCHEYsWZl/AAAe85BDQ:P1 (envelope-from ) for ; Mon, 05 Aug 2024 18:22:41 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 4G/UCHEYsWZl/AAAe85BDQ (envelope-from ) for ; Mon, 05 Aug 2024 20:22:41 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=m708BuSr; 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=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1722882160; 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:dkim-signature; bh=X8GisCW6nJI55pR8a7+GOjbJ4Oa89qJzBBMCrLAsGXI=; b=Ta09Tge1Ng00t70aP/Xyxbdh3RX5wwk5XoafXEQnuzQ7vMCm+yZ3IibzqJJ1WkF8H334pq 3g0zWnSezowANRUly9uLLfwAd5UdZTuBvQHGhvTMeZz6Jvlpak0XUWNFJbtWJa5OFK/SVC jIctjiW5bTkoA2GI63aRfn+M+if+c+WfmrNZzSWisxeMxEhJEeZlhVQKxNZsAI3Q6yCq6J h3I+Aj/Z14RhkXbBWGKVXHWYBjoZLEvcEj5T66IfiQs9mb6LV+LJGQ9QN7G0B2aTyYdcgx pvUJqEL2f4PnXOGfGOQsvpjH7PVHRRmp4Tgx1ia7coKAwSLvlYKTmNlV++ToXg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=m708BuSr; 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=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722882160; a=rsa-sha256; cv=none; b=Wv+gAcjqyFF4ppv8eIZIZ6D+WciMj7ij2I/GI/5JqSjWtL8TdJypLykmokrP7hd9UP8ReK bwVfu9QpBIeJMQrN5voLMA8y3UZBRx3gFJTuI2f1tMTKkBblPjf7r5RkAXxJTZEknIRGe5 D08V/tdzkUxgMkEBx0stOTSzSjebT4EkPoR+ot2OJORgI9uO2bNDTQROgnc0tdit+FNr/v KnbLWeFyVdcOxLZwuqbmzf2qESbKrb8mFBDNe6JHOjt8ydh/1NBzzTi1DX0KahE+1PgiKn lBxugSYplncvzEFgAP919RScN2+7RStjPhilVMy8QVTTF0uBfNT3Ybt+Qzsdbw== 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 CD26D22CA9 for ; Mon, 5 Aug 2024 20:22:40 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sb2Kr-0004GR-Ay; Mon, 05 Aug 2024 14:21:33 -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 1sb2KX-00032S-8L for emacs-orgmode@gnu.org; Mon, 05 Aug 2024 14:21:20 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sb2KT-0000Du-U6 for emacs-orgmode@gnu.org; Mon, 05 Aug 2024 14:21:12 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9ADC3240028 for ; Mon, 5 Aug 2024 20:21:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722882067; bh=slnExtfZ+7QSClyD2lpMLYB1qGRJEzanxu03wAVANU8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=m708BuSr6ATzPMFa6tmI297iDaapJ3df3+S6g6anckOHWMVU1wHhGSDE8WvRzRuYF 8AZhBI5QyUzHqLETJBV99WUvABSXmO+SL7ANQ7BYs3NZGmzJB8Q32hbbaGRL3S/c5y H4lfAgEYFy+wmRPcvQaJiyfyLDfqdIyRMSKTxpZ1+vlm+2nOElMTDA6FOS0ab1bxNy 92lcJWXPV2JsoZTSn6YpGsONEMRbdgKIQn9VMqwxkR/ghdZRj+vMElTfZeptMBSkc2 R/5baJOQMNBxjF2Epmjz6443SPwhABh+0+sC/4UcKd1xFGZdzyEU3AhBzewn8p8Tor 5cDnU9L953q+g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wd4WQ6sVVz9rxL; Mon, 5 Aug 2024 20:21:06 +0200 (CEST) From: Ihor Radchenko To: Orm Finnendahl Cc: emacs-orgmode@gnu.org Subject: Re: multipage html output In-Reply-To: References: <87bk2o2o2m.fsf@localhost> <87sew011c6.fsf@localhost> <87frrzdrbz.fsf@localhost> <87plr14wka.fsf@localhost> <87bk2i8w07.fsf@localhost> Date: Mon, 05 Aug 2024 18:22:22 +0000 Message-ID: <87r0b2kext.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -9.65 X-Migadu-Queue-Id: CD26D22CA9 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -9.65 X-TUID: BJkEV7biHRTD Orm Finnendahl writes: > attached are the patches for the multipage html export proposal. The > tgz file contains all commits after branching from the main branch to > the org-html-multipage branch (see: > https://github.com/ormf/org-mode/tree/org-html-multipage) Thanks! Although creating patches is not necessary in your case - remote git repo is good enough for me to check things. 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. > + (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. > +(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.") 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. > +(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'. > +(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. You should probably do it in `org-html-export-to-multipage' instead. Ideally, split function should do splitting, but not other things. > + ;; collect all org-pages to be exported. > + (plist-put info :multipage-org-pages > + (cl-loop > + for file in section-filenames > + for tl-headline in section-trees > + collect > + (list 'org-page > + (list :output-file (format "%s/%s" dir file) > + :tl-headline tl-headline > + :tl-headline-number > + (alist-get > + tl-headline > + stripped-section-headline-numbering)) > + nil)))))))) This is awkward. Why not modifying DATA directly? Say, you can transform it into (org-data (...) (org-page ...) (org-page ...) ...). -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at