emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ypo <ypuntot@gmail.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: # Comments export
Date: Sun, 29 May 2022 13:33:38 +0200	[thread overview]
Message-ID: <f7a91e6b-9f13-04e0-483e-1dd875d50cd7@gmail.com> (raw)
In-Reply-To: <871qwd879z.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1881 bytes --]

  reply	other threads:[~2022-05-29 11:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28 14:58 # Comments export Ypo
2022-05-28 15:44 ` Timothy
2022-05-28 15:58   ` Ypo
2022-05-28 16:05     ` Timothy
2022-05-28 23:15       ` Samuel Wales
2022-05-29  0:46         ` Ypo
2022-05-29  1:19           ` Ihor Radchenko
2022-05-29 11:33             ` Ypo [this message]
2022-05-29 11:59               ` Ihor Radchenko
2022-05-30  7:35           ` Eric S Fraga
2022-05-30 10:46             ` Juan Manuel Macías
2022-05-30 21:49               ` Tim Cross
2022-06-02  6:24           ` Phil Estival

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7a91e6b-9f13-04e0-483e-1dd875d50cd7@gmail.com \
    --to=ypuntot@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).