Re: [O] Exporting markdown specific string

2014-01-06 Thread Nicolas Goaziou
Hello,

Bastien b...@gnu.org writes:

 Nicolas Goaziou n.goaz...@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



[O] Exporting markdown specific string

2014-01-04 Thread Ista Zahn
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



Re: [O] Exporting markdown specific string

2014-01-04 Thread Bastien
Hi Ista,

Ista Zahn istaz...@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



Re: [O] Exporting markdown specific string

2014-01-04 Thread Charles Berry
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





Re: [O] Exporting markdown specific string

2014-01-04 Thread Bastien
Charles Berry ccbe...@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



Re: [O] Exporting markdown specific string

2014-01-04 Thread Charles Berry
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







Re: [O] Exporting markdown specific string

2014-01-04 Thread Charles Berry
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




Re: [O] Exporting markdown specific string

2014-01-04 Thread Ista Zahn
On Sat, Jan 4, 2014 at 1:40 PM, Charles Berry ccbe...@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





Re: [O] Exporting markdown specific string

2014-01-04 Thread Nicolas Goaziou
Hello,

Bastien b...@gnu.org writes:

 Ista Zahn istaz...@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



Re: [O] Exporting markdown specific string

2014-01-04 Thread Charles Berry
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




Re: [O] Exporting markdown specific string

2014-01-04 Thread Nicolas Goaziou
Hello,

Charles Berry ccbe...@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



Re: [O] Exporting markdown specific string

2014-01-04 Thread Bastien
Nicolas Goaziou n.goaz...@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