[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Canonical way to strip off all markup from an element in Org exp
From: |
Nicolas Goaziou |
Subject: |
Re: [O] Canonical way to strip off all markup from an element in Org exporter backend? |
Date: |
Thu, 21 Dec 2017 15:22:18 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Kaushal Modi <address@hidden> writes:
> Thank you! That function is educational. I'll play more with that idea. It
> will be a lot more verbose than the 3 line solution I have right now..
(let ((no-thrill (lambda (o c _) (or c (org-element-property :value o)))))
(org-export-create-backend
:parent 'ascii ;or `hugo', depending on what you mean
:transcoders (mapcar (lambda (type) (cons type no-thrill))
'(bold code italic strike-through underline
verbatim))))
Five locs. Not bad either.
> It can be used wherever just the element content is needed without
> formatting properties, like in my case where the element title is needed to
> be extracted without any formatting.
So far, no major back-end needs this. Also, it is very simple to provide
the back-end above.
> I haven't yet invested any time into serious development of this "base
> class" backend. The idea of this exporter is to give formatting-free output
> (like when you select plain text option in an email client).. so at whim,
> entities will be translated to the correct unicode chars, footnotes
> behavior could be the same as ox-ascii, and latex-snippets can stay in the
> raw ascii form.
You're basically describing `ox-ascii' with stripped emphasis markers.
At this point, I'm not convinced we need this in Org proper.
Regards,
--
Nicolas Goaziou 0x80A93738