From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SBhNB8hak2KqswAAbAwnHQ (envelope-from ) for ; Sun, 29 May 2022 13:36:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6MdiBshak2LctQAAG6o9tA (envelope-from ) for ; Sun, 29 May 2022 13:36:40 +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 68E252653C for ; Sun, 29 May 2022 13:36:39 +0200 (CEST) Received: from localhost ([::1]:40796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvHDp-0000bY-W8 for larch@yhetil.org; Sun, 29 May 2022 07:36:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvHBO-0000FD-2R for emacs-orgmode@gnu.org; Sun, 29 May 2022 07:34:07 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:33330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nvHBL-0008L2-Lq for emacs-orgmode@gnu.org; Sun, 29 May 2022 07:34:04 -0400 Received: by mail-wr1-x434.google.com with SMTP id h5so3218517wrb.0 for ; Sun, 29 May 2022 04:34:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=Pb/OMgfMfqoSHGc5CL+IHGHIGKSo4PnedY26f0FVt9g=; b=QlnFksVxy+aQpmEPOElFTFyj1m3m7KhojSxT5ecl73I0Dsq6p/lKkWNW8vN9FhLqgz 7PegIx5TyFmG7AmmwY2Q2CHDsU497xU25PDXx6pHz/kmOxoKmJC9jmTsHouwGO5d4toh cut1DhsFxPL/OMS01AdNO+c6Syh+p0P6J9DFM0CrHKASUMZ5twJeNXo9emZeOj1riuEX yRU5RneksMBN5hM74lqMLFSQPNPfjHsBp9mVi5rNDKEKOYWmPUo3L+LY9H+Hj1Pn4csv UhkdJJk7CqqeK7xeJZXcN5VcUN4wQp5Ob2xeGf45dz8uoAKar3IlwrzqgWeB+GXCPHQy HBVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=Pb/OMgfMfqoSHGc5CL+IHGHIGKSo4PnedY26f0FVt9g=; b=58/Q2LE7gwHaLddl9kvVUJc4SX5XxTOIH4bj+c8g3UtiuGIHFV680WU4qjEDGN9v0g 57uBolk2OGusvL94yfTy9uP8Ln1Wpo5Wo+JzCeoZRHcCVyxflZnwUq9mmKTpOvdDdcfx 7HIbLBwrbTntNA9NRgjmQ67L71VvHRoHbuH7wjIfPoRlOytAZ4aCLnqOdRfM0dasM4K1 V3vyOzaCPrHANaiOZOG3R9pwtB0sBpD44aAtHP2M75SLuiSfw7UOWXvmxQnqMmh0VXLb KGqXZaDdJfRgOGlDvBGi5PdtSgpB6ddU3a1ZZyt5k2Pw5XvGgFG94yKjoNRWGkiNLU+8 16IQ== X-Gm-Message-State: AOAM53020bPRen8b4gJNNgDsZEFK20pGuEMtBXfAj7zLcOWgGB2tuZfn FfifX1qIXUtgwT9PSdu3CaaTapWm4ak= X-Google-Smtp-Source: ABdhPJxq14F3Vod5e1UMbk1REcGPfUyyQjRwSjO+3jsJV4FSpyiSNtwXorp/xqIvvVoeZTJWgIuETw== X-Received: by 2002:a5d:40c7:0:b0:210:3135:e662 with SMTP id b7-20020a5d40c7000000b002103135e662mr1441042wrq.280.1653824042183; Sun, 29 May 2022 04:34:02 -0700 (PDT) Received: from [192.168.0.97] ([47.61.54.59]) by smtp.gmail.com with ESMTPSA id w15-20020a5d680f000000b0021033ba8b15sm303660wru.44.2022.05.29.04.34.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 May 2022 04:34:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------Jpfqp090W0EZsysSwDN41fZ5" Message-ID: Date: Sun, 29 May 2022 13:33:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: # Comments export Content-Language: en-GB To: Ihor Radchenko Cc: emacs-orgmode@gnu.org References: <875ylpzmoh.fsf@gmail.com> <63167d83-ce29-f7d9-eeaf-38573b2b4205@gmail.com> <874k19zloo.fsf@gmail.com> <871qwd879z.fsf@localhost> From: Ypo In-Reply-To: <871qwd879z.fsf@localhost> Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=ypuntot@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653824199; 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=Pb/OMgfMfqoSHGc5CL+IHGHIGKSo4PnedY26f0FVt9g=; b=dJnmZLzgwfI+LhDnJEu0SKKa7AUnm9f2ddKORJpUSaEE2PM/93mIu0PxfgRWVfogZ5Atkx H87n9w/Zlm6PF5wRS/OZ/UixHzjszYxlKgqes0yuffvTVls+QdvyVR7xKZc1RFOfOMfFQ1 A/wXd7yo10zvuisJJQiEp/zKdqI8QsmEx9m45JXZS3lfzN6YaUbe9Jos0c+2gKk6WNA/6W ncKTL2RGAMCp5Nib8VingcHnsILUVD9la5DAelmDE+1KwnayVDKqn9UVMJgegUIe0v3Yw+ xU9zFglEhxuX2LqE6DkyC+96dgWJwIcLJ22rVwfDFFuDKPi3fmtzDInNEWyHFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653824199; a=rsa-sha256; cv=none; b=Z09M4+94vtISs/KvjcwJWFmvAmQw05kVMDTX8n8n/519XszCOE2PZ/whDMh5A1D34RmgVU SipzmQbTnCx4v7CBXvlcg9UwI2GNkXKmsraztlNpkjwZ4dnV0x3EdLxPPY5/D3HvBbOQXx bjwHRkqG01qFie8zg1VCGWZ1XNUlkrU0hh7kBa/aFt1fi22KncQu/+3ZQlAxY2brY1o+Hv to061RhobKLk0L39y9F+Qff+BgK0d/JC2mqpc1XNVHDCPWpzkoIIA/egzehOGsEX4Nt1vK 2WJA2CpGWohJCBlbAUtJjyh9BigGW6GwaVMHf7Pp3ebZgxcN93fUlKiv6kgNfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QlnFksVx; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -8.84 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QlnFksVx; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 68E252653C X-Spam-Score: -8.84 X-Migadu-Scanner: scn0.migadu.com X-TUID: mb3iEvlfvgm5 This is a multi-part message in MIME format. --------------Jpfqp090W0EZsysSwDN41fZ5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks for your effort, Ihor But that code is so difficult for me, that I can barely understand it. El 29/05/2022 a las 3:19, Ihor Radchenko escribió: > Ypo writes: > >> I wanted to export my # comments so I could share my notes with more people, using HTML export. I would export all of them. >> >> But, as it seems not possible, I think I will use footnotes. I liked # comments more, because their face can be customized and because they are nearer to the commented text (although footnotes can be moved manually wherever user wants to), # comments are like more "natural". > It is actually possible, but you will need to write an > org-export-before-parsing-hook that will convert all the comments into > exportable elements. > > Not tested, but the hook might be something like > > (defun org-export-replace-comments (_) > "Replace all the comments with note blocks." > (org-element-cache-map > (lambda (comment) > (setf (buffer-substring (org-element-property :begin comment) (org-element-property :end comment)) > (format "#+begin_note\n%s\n#+end_node\n" (org-element-property :value comment)))) > :granularity 'element > :restrict-elements '(comment))) > > Best, > Ihor --------------Jpfqp090W0EZsysSwDN41fZ5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks for your effort, Ihor

But that code is so difficult for me, that I can barely understand it.

El 29/05/2022 a las 3:19, Ihor Radchenko escribió:
Ypo <ypuntot@gmail.com> writes:

I wanted to export my # comments so I could share my notes with more people, using HTML export. I would export all of them.

But, as it seems not possible, I think I will use footnotes. I liked # comments more, because their face can be customized and because they are nearer to the commented text (although footnotes can be moved manually wherever user wants to), # comments are like more "natural".
It is actually possible, but you will need to write an
org-export-before-parsing-hook that will convert all the comments into
exportable elements.

Not tested, but the hook might be something like

(defun org-export-replace-comments (_)
"Replace all the comments with note blocks."
  (org-element-cache-map
   (lambda (comment)
     (setf (buffer-substring (org-element-property :begin comment) (org-element-property :end comment))
	   (format "#+begin_note\n%s\n#+end_node\n" (org-element-property :value comment))))
   :granularity 'element
   :restrict-elements '(comment)))

Best,
Ihor
--------------Jpfqp090W0EZsysSwDN41fZ5--