emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] two simple derived backend questions


From: Matt Price
Subject: Re: [O] two simple derived backend questions
Date: Fri, 23 Oct 2015 14:04:27 -0400

Hi, I realize I never responded to say thank you. 

This is a big help, and I now have things working the way I like!
matt


On Wed, Oct 14, 2015 at 11:35 PM, Charles C. Berry <address@hidden> wrote:
On Wed, 14 Oct 2015, Matt Price wrote:

On Wed, Oct 14, 2015 at 6:55 PM, Rasmus <address@hidden> wrote:

Hi Matt,

Matt Price <address@hidden> writes:

a) add a horizontal rule

pandoc expects a horizontal rule at each slide division.  So, if
possible,
I would like to add an hhr element at the end of every headline.

What’s a hhr element?

<hr>, I meant

Can you just use something like
---------------------------

for a horizontal rule?  AFAIK, it’s inserted as "---".

yes.  but then I will have to take out all the "---------------------"
elements if I want to go back to using my original org documents again.
The point is that I have lots of these lecture notes, and would prefer not
to alter them too severely if possible.


Err, what about



--8<---------------cut here---------------start------------->8---
#+MACRO: hhr #+MD: ---

* abc

first slide

{{{hhr}}}

* def

second slide

{{{hhr}}}

--8<---------------cut here---------------end--------------->8---


b) speaker notes

More importantly, org-reveal allows the use of speaker notes, thus:

#+BEGIN_NOTES

whatever I put here

#+ END_NOTES

is exported as:

<aside class="speaker-notes">
whaever I put here
</aside>

For me it’s inserted as


<div class="notes">
whatever I put here

</div>


yes, that's right, I was being hasty. In any case, what I would like to do
is reproduce this behaviour in the markdown export; I have tried modifying
the md export but I am doing something wrong, clearly, and had hoped to get
some hints from the list...



Ok here is a hint. You can add a menu item if you really need it.


--8<---------------cut here---------------start------------->8---
#+BEGIN_SRC emacs-lisp
  (org-export-define-derived-backend
   'md-plus
   'md
   :translate-alist '(
                      (export-block . org-md-plus-export-block))
   :export-block    '("NOTES"))

  (defun org-md-plus-export-block
      (export-block contents info)
    "Transcode a EXPORT-BLOCK NOTES element from Org to md-plus.
    CONTENTS is nil.  INFO is a plist holding contextual information."
    (if (equal (org-element-property :type export-block) "NOTES")
        (concat "<aside class=\"speaker-notes\">\n"
                (org-element-property :value export-block)
                "</aside>\n")
      (let ((parent-backend (org-export-backend-parent backend)))
        (if parent-backend
            (org-export-with-backend
             parent-backend export-block contents info)))))

#+END_SRC


#+BEGIN_NOTES
just for the note takers...
#+END_NOTES

: Run like this
: M-x (org-export-to-buffer 'md-plus "***md-plus-out***")
--8<---------------cut here---------------end--------------->8---


HTH,

Chuck


reply via email to

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