From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Canonical way to strip off all markup from an element in Org exporter backend? Date: Thu, 21 Dec 2017 15:22:18 +0100 Message-ID: <87y3lwjh45.fsf@nicolasgoaziou.fr> References: <87wp1hhx9b.fsf@nicolasgoaziou.fr> <87o9mthw6t.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eS1jt-0001yc-A8 for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 09:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eS1jq-000188-0V for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 09:22:25 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:53855) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eS1jp-000173-Qi for emacs-orgmode@gnu.org; Thu, 21 Dec 2017 09:22:21 -0500 In-Reply-To: (Kaushal Modi's message of "Wed, 20 Dec 2017 22:41:34 +0000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Kaushal Modi Cc: emacs-org list Hello, Kaushal Modi 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