From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id eKF/DAhydWSUKAEASxT56A (envelope-from ) for ; Tue, 30 May 2023 05:48:24 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id sD9yDAhydWT4YQAA9RJhRA (envelope-from ) for ; Tue, 30 May 2023 05:48:24 +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 447621F8D4 for ; Tue, 30 May 2023 05:48:23 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3qKM-0003Py-2x; Mon, 29 May 2023 23:47:18 -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 1q3qKJ-0003P4-Vd for emacs-orgmode@gnu.org; Mon, 29 May 2023 23:47:16 -0400 Received: from mail.mojserwer.eu ([195.110.48.8]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3qKG-0002bl-Qr for emacs-orgmode@gnu.org; Mon, 29 May 2023 23:47:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 30BD7976E03 for ; Tue, 30 May 2023 05:47:07 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ANHHF1jm5jAF for ; Tue, 30 May 2023 05:47:04 +0200 (CEST) Received: from localhost (178235147087.dynamic-3-poz-k-0-1-0.vectranet.pl [178.235.147.87]) by mail.mojserwer.eu (Postfix) with ESMTPSA id AB12FBA222E for ; Tue, 30 May 2023 05:47:03 +0200 (CEST) User-agent: mu4e 1.1.0; emacs 30.0.50 From: Marcin Borkowski To: Org-Mode mailing list Subject: How to export to the simplest possible HTML? Date: Tue, 30 May 2023 05:47:00 +0200 Message-ID: <87353exyyz.fsf@mbork.pl> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=195.110.48.8; envelope-from=mbork@mbork.pl; helo=mail.mojserwer.eu 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1685418504; a=rsa-sha256; cv=none; b=sJo10qnNPfZfHoTMvC1hVRAAXmMzQzYCLub0l6sJ0VsEpV8UJkB1TnN33YEvjGq/cNOgYV aS6GlFoL862fq9xy331ST90c1ZFKgd+hdm55Jk0G52B7l7PjjlRgcV692ERYUk/NMpFGKG 1XzXPVIWMjCQUgcMDlMRo9dSlUKHCdbz10CPH8ZtBmoT1uc3dttmo49bOaHAdgWm5tgV7G 7UjzABCwX4cQJsv/MwJFXBNZMb782j+Df7RGnJXuOlWL1zv+65D7FgGRGN0AfN3BuGDOBy 2JXATcoQCCCKrFb0x2GJmjYfT6gAij5dsUwJ7vzrNcE28nHlUD8e4cEm7c67bA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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=1685418504; 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=jCcdIIaQ657Y9473UgzH+nYuP8clgi24RZZ/7ERnutY=; b=OmMEotfjwFRnnDsoZ1F9ZBMADnCg8kRx5hXK+rDzfbq0zA/4im8nMBMbNqdz1s78wEbgEb ddmE0qFfzddEWuS9ATPUXPK7N5O4nlB03NEeJno7YQCfFuykdrlWYeC0hlMHRG2jiRS/Mw W1Eeo0Ki6uRxaZTpy8gsgWL8MeC+pEdxD/fed3S/tt3NWceGWen5NS6Nt3siDcDA+CDgdL QrlbPoK+7VKVK/0ehVtpJ+72nW+n9Rmea7cagjSV2s4koA+FsP3SkK5bbWD8Dhlzubhxnk V/TnWCUvVTrOEDgcY0wOrqnDunHK9ur4RE6PkZlIcs7/aIlz7F1Rw2qXDy8uAA== X-Migadu-Spam-Score: -2.94 X-Spam-Score: -2.94 X-Migadu-Queue-Id: 447621F8D4 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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" X-TUID: ZkJTOcA+F4IT Hello everyone, I'd like to export an Org buffer (or portion of it) to the simplest HTML possible, prgrammatically. For example, I only want the body, I don't want any generated IDs, and I don't want the ToC. I tried this: (org-html-export-as-html nil nil nil t '(org-export-with-toc nil)) but the ToC still appears in the output. Also, I'd prefer to do it a bit "less interactively" - for example, setting the current buffer to the one with export results is unnecessary for me, since I'm going to call my exporting function in a loop over many elements. I tried (org-export-with-backend 'html (org-element-at-point (point))) but it errored out: Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) org-html-headline((headline (:raw-value ...)) ...) org-export-with-backend(html (headline (:raw-value ...))) I also want to supply my custom formatting for italics & friends, so that This is /italic/. can become e.g. This is italic. I'm considering writing a custom (derived) export backend, but maybe that is an overkill? Any ideas? TIA, -- Marcin Borkowski http://mbork.pl