emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Exporting markdown specific string
@ 2014-01-04 15:48 Ista Zahn
  2014-01-04 17:22 ` Bastien
  0 siblings, 1 reply; 12+ messages in thread
From: Ista Zahn @ 2014-01-04 15:48 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

Hi all,

I'm trying to figure out how to export a line (say "foo") only when
exporting to markdown.

For latex there is
'#+LATEX: foo'
and for html there is
'#+HTML: foo'
but neither
'#+MD: foo'
nor
'#+MARKDOWN: foo'
does the trick.

Of course
'#+HTML: foo'
exports foo to markdown since the markdown exporter is derived from
the html exporter. But I'd really like to include stuff in the
markdown export that does not also get included in the html export.

Suggestions? I'm using org-plus-contrib: Org-mode version 8.2.4
(8.2.4-18-g4ee7e6-elpaplus) installed using M-x install-packages.

Thanks,
Ista

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 15:48 Exporting markdown specific string Ista Zahn
@ 2014-01-04 17:22 ` Bastien
  2014-01-04 18:09   ` Charles Berry
  2014-01-04 19:24   ` Nicolas Goaziou
  0 siblings, 2 replies; 12+ messages in thread
From: Bastien @ 2014-01-04 17:22 UTC (permalink / raw)
  To: Ista Zahn; +Cc: emacs-orgmode Mailinglist

Hi Ista,

Ista Zahn <istazahn@gmail.com> writes:

> I'm trying to figure out how to export a line (say "foo") only when
> exporting to markdown.

#+BEGIN_MD
...
#+END_MD

will do.

#+HTML and the likes are special shortcuts for historical export
backends, we don't plan to add more.

HTH,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 17:22 ` Bastien
@ 2014-01-04 18:09   ` Charles Berry
  2014-01-04 18:21     ` Bastien
  2014-01-04 18:24     ` Charles Berry
  2014-01-04 19:24   ` Nicolas Goaziou
  1 sibling, 2 replies; 12+ messages in thread
From: Charles Berry @ 2014-01-04 18:09 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg <at> gnu.org> writes:

> 
> Hi Ista,
> 
> Ista Zahn <istazahn <at> gmail.com> writes:
> 
> > I'm trying to figure out how to export a line (say "foo") only when
> > exporting to markdown.
> 
> #+BEGIN_MD
> ...
> #+END_MD
> 
> will do.
> 
[snip]

No it won't. 

ox-md.el does not define a transcoder for keyword and falls back to its 
parent:

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp :exports both
(org-version)
#+END_SRC

#+RESULTS:
: 8.2.4

#+BEGIN_SRC emacs-lisp :exports both
(assoc 'keyword (org-export-get-all-transcoders 'md))
#+END_SRC

#+RESULTS:
: (keyword . org-html-keyword)
--8<---------------cut here---------------end--------------->8---

HTH,

Chuck

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 18:09   ` Charles Berry
@ 2014-01-04 18:21     ` Bastien
  2014-01-04 18:40       ` Charles Berry
  2014-01-04 18:24     ` Charles Berry
  1 sibling, 1 reply; 12+ messages in thread
From: Bastien @ 2014-01-04 18:21 UTC (permalink / raw)
  To: Charles Berry; +Cc: emacs-orgmode

Charles Berry <ccberry@ucsd.edu> writes:

> No it won't. 
>
> ox-md.el does not define a transcoder for keyword and falls back to its 
> parent:

Thanks.

I just added this transcoder to the master branch.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 18:09   ` Charles Berry
  2014-01-04 18:21     ` Bastien
@ 2014-01-04 18:24     ` Charles Berry
  1 sibling, 0 replies; 12+ messages in thread
From: Charles Berry @ 2014-01-04 18:24 UTC (permalink / raw)
  To: emacs-orgmode

Charles Berry <ccberry <at> ucsd.edu> writes:

> 
> Bastien <bzg <at> gnu.org> writes:
> 
> > 
> > Hi Ista,
> > 
> > Ista Zahn <istazahn <at> gmail.com> writes:
> > 
> > > I'm trying to figure out how to export a line (say "foo") only when
> > > exporting to markdown.
> > 
> > #+BEGIN_MD
> > ...
> > #+END_MD
> > 
> > will do.
> > 
> [snip]
> 
> No it won't. 
> 
> ox-md.el does not define a transcoder for keyword and falls back to its 
> parent:


OOPS!

I meant 'export-block'

--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp :exports both
(assoc 'export-block (org-export-get-all-transcoders 'md))
#+END_SRC

#+RESULTS:
: (export-block . org-html-export-block)
--8<---------------cut here---------------end--------------->8---


Chuck

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 18:21     ` Bastien
@ 2014-01-04 18:40       ` Charles Berry
  2014-01-04 18:50         ` Ista Zahn
  0 siblings, 1 reply; 12+ messages in thread
From: Charles Berry @ 2014-01-04 18:40 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg <at> gnu.org> writes:

> 
> Charles Berry <ccberry <at> ucsd.edu> writes:
> 
> > No it won't. 
> >
> > ox-md.el does not define a transcoder for keyword and falls back to its 
> > parent:
> 
> Thanks.
> 
> I just added this transcoder to the master branch.
> 

Looking at org-md-export-block shouldn't it export HTML export blocks as 
well, since markdown allows literal html?

HTH,

Chuck

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 18:40       ` Charles Berry
@ 2014-01-04 18:50         ` Ista Zahn
  0 siblings, 0 replies; 12+ messages in thread
From: Ista Zahn @ 2014-01-04 18:50 UTC (permalink / raw)
  To: Charles Berry; +Cc: emacs-orgmode Mailinglist

On Sat, Jan 4, 2014 at 1:40 PM, Charles Berry <ccberry@ucsd.edu> wrote:
> Bastien <bzg <at> gnu.org> writes:
>
>>
>> Charles Berry <ccberry <at> ucsd.edu> writes:
>>
>> > No it won't.
>> >
>> > ox-md.el does not define a transcoder for keyword and falls back to its
>> > parent:
>>
>> Thanks.
>>
>> I just added this transcoder to the master branch.
>>
>
> Looking at org-md-export-block shouldn't it export HTML export blocks as
> well, since markdown allows literal html?

Yes, and as far as I can tell it does. But as I explained in my
original question I want certain text exported to markdown but not to
html.

Best,
Ista

>
> HTH,
>
> Chuck
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 17:22 ` Bastien
  2014-01-04 18:09   ` Charles Berry
@ 2014-01-04 19:24   ` Nicolas Goaziou
  2014-01-04 20:55     ` Charles Berry
  2014-01-05  6:39     ` Bastien
  1 sibling, 2 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2014-01-04 19:24 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode Mailinglist, Ista Zahn

Hello,

Bastien <bzg@gnu.org> writes:

> Ista Zahn <istazahn@gmail.com> writes:
>
>> I'm trying to figure out how to export a line (say "foo") only when
>> exporting to markdown.
>
> #+BEGIN_MD
> ...
> #+END_MD
>
> will do.

I added #+begin_markdown...#+end_markdown too, as defined by the
back-end.
>
> #+HTML and the likes are special shortcuts for historical export
> backends, we don't plan to add more.

What? Every back-end introduces its own specific keyword
(#+beamer: #+ascii ...). I just added them (#+md: and #+markdown:) for
md back-end.

Should we remove all of them?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 19:24   ` Nicolas Goaziou
@ 2014-01-04 20:55     ` Charles Berry
  2014-01-04 23:50       ` Nicolas Goaziou
  2014-01-05  6:39     ` Bastien
  1 sibling, 1 reply; 12+ messages in thread
From: Charles Berry @ 2014-01-04 20:55 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:

> 
> Hello,
> 
> Bastien <bzg <at> gnu.org> writes:
> 
> > Ista Zahn <istazahn <at> gmail.com> writes:
> >
> >> I'm trying to figure out how to export a line (say "foo") only when
> >> exporting to markdown.
> >
> > #+BEGIN_MD
> > ...
> > #+END_MD
> >
> > will do.
> 
> I added #+begin_markdown...#+end_markdown too, as defined by the
> back-end.

Doesn't org-md-export-block want

 (org-export-with-backend 'html export-block contents info)

at its end?

Chuck

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 20:55     ` Charles Berry
@ 2014-01-04 23:50       ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2014-01-04 23:50 UTC (permalink / raw)
  To: Charles Berry; +Cc: emacs-orgmode

Hello,

Charles Berry <ccberry@ucsd.edu> writes:

> Doesn't org-md-export-block want
>
>  (org-export-with-backend 'html export-block contents info)
>
> at its end?

Done. Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-04 19:24   ` Nicolas Goaziou
  2014-01-04 20:55     ` Charles Berry
@ 2014-01-05  6:39     ` Bastien
  2014-01-06 11:30       ` Nicolas Goaziou
  1 sibling, 1 reply; 12+ messages in thread
From: Bastien @ 2014-01-05  6:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode Mailinglist, Ista Zahn

Nicolas Goaziou <n.goaziou@gmail.com> writes:

>> #+HTML and the likes are special shortcuts for historical export
>> backends, we don't plan to add more.
>
> What? Every back-end introduces its own specific keyword
> (#+beamer: #+ascii ...). I just added them (#+md: and #+markdown:) for
> md back-end.

Ah, my mistake.

(I had a memory of a conversation about #+HTML looked too ad hoc,
and in my memories you convinced me that we should not add more of
these keywords.  But maybe you didn't convince me then!)

> Should we remove all of them?

No, no.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Exporting markdown specific string
  2014-01-05  6:39     ` Bastien
@ 2014-01-06 11:30       ` Nicolas Goaziou
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Goaziou @ 2014-01-06 11:30 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode Mailinglist, Ista Zahn

Hello,

Bastien <bzg@gnu.org> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>>> #+HTML and the likes are special shortcuts for historical export
>>> backends, we don't plan to add more.
>>
>> What? Every back-end introduces its own specific keyword
>> (#+beamer: #+ascii ...). I just added them (#+md: and #+markdown:) for
>> md back-end.
>
> Ah, my mistake.
>
> (I had a memory of a conversation about #+HTML looked too ad hoc,
> and in my memories you convinced me that we should not add more of
> these keywords.  But maybe you didn't convince me then!)

I don't like them much (as they are redundant) so it's well possible we
had this conversation. For some reason they now exist, for the worse or
the better, in every core back-end.

Though, they are not mandatory for new back-ends. Only documentation can
tell if such a keyword exists for a given back-end (which reminds me
that the recently introduced keywords are not documented yet).


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-01-06 11:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-04 15:48 Exporting markdown specific string Ista Zahn
2014-01-04 17:22 ` Bastien
2014-01-04 18:09   ` Charles Berry
2014-01-04 18:21     ` Bastien
2014-01-04 18:40       ` Charles Berry
2014-01-04 18:50         ` Ista Zahn
2014-01-04 18:24     ` Charles Berry
2014-01-04 19:24   ` Nicolas Goaziou
2014-01-04 20:55     ` Charles Berry
2014-01-04 23:50       ` Nicolas Goaziou
2014-01-05  6:39     ` Bastien
2014-01-06 11:30       ` Nicolas Goaziou

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).