emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* fixing level in md export
@ 2017-05-15 13:29 John Kitchin
  0 siblings, 0 replies; only message in thread
From: John Kitchin @ 2017-05-15 13:29 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-15 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-15 13:29 fixing level in md export John Kitchin

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