emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] fixing level in md export


From: John Kitchin
Subject: [O] fixing level in md export
Date: Mon, 15 May 2017 09:29:22 -0400

Hi,

I used to use a snippet like this to convert "** test" to "## test", but
recently this quit working:

#+BEGIN_SRC emacs-lisp
(cl-flet ((org-export-get-relative-level           
                        (headline info)
                        (org-element-property :level headline)))
               (s-trim
                (org-export-string-as
                 "** test"
                 'md t '(:with-toc nil :with-tags nil))))
#+END_SRC

#+RESULTS:
: # test

As far as I can tell, the cl-flet is not doing anything here. It works
in other places, e.g.

#+BEGIN_SRC emacs-lisp
(cl-flet ((print (args) (message "yoes: %s" args))) (print 6))
#+END_SRC

#+RESULTS:
: yoes: 6

I am using: GNU Emacs 25.1.1 (x86_64-apple-darwin16.4.0, NS appkit-1504.81 
Version 10.12.3 (Build 16D32)) of 2017-04-04
Org mode version 9.0.5 (9.0.5-elpa @ 
/Users/jkitchin/vc/jkitchin-github/scimax/elpa/org-20170210/)



The background on this is I am exporting "cells" to markdown to make a
jupyter notebook, and ox-md-headline uses org-export-get-relative-level
to figure out how many leading # to put in. For what I am doing this is
not correct. The cells get rendered out of context, so this ends up
making all levels be level 1.

Any ideas on how to remedy this? Or why it might have stopped working?

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]