emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <87y3lwjh45.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAFyQvY1NnSoPe-74_sxb3uZmam53TO35y_P-bvFCrWdDWFzBCg@mail.gmail.com> (Kaushal Modi's message of "Wed, 20 Dec 2017 22:41:34 +0000")

Hello,

Kaushal Modi <kaushal.modi@gmail.com> 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

  reply	other threads:[~2017-12-21 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 18:30 Canonical way to strip off all markup from an element in Org exporter backend? Kaushal Modi
2017-12-20 22:04 ` Nicolas Goaziou
2017-12-20 22:11   ` Kaushal Modi
2017-12-20 22:27     ` Nicolas Goaziou
2017-12-20 22:41       ` Kaushal Modi
2017-12-21 14:22         ` Nicolas Goaziou [this message]
2017-12-22 20:31           ` Kaushal Modi

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=87y3lwjh45.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@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).