From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: two simple derived backend questions Date: Fri, 23 Oct 2015 14:04:27 -0400 Message-ID: References: <87k2qphxh2.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141b3c646e50d0522c97145 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpghZ-00070D-PX for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 14:04:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpghY-0006zT-EB for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 14:04:29 -0400 Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]:36072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpghY-0006z5-8W for emacs-orgmode@gnu.org; Fri, 23 Oct 2015 14:04:28 -0400 Received: by ioll68 with SMTP id l68so132922289iol.3 for ; Fri, 23 Oct 2015 11:04:27 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Charles C. Berry" Cc: Org Mode , Rasmus --001a1141b3c646e50d0522c97145 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 wrote= : > On Wed, 14 Oct 2015, Matt Price wrote: > > On Wed, Oct 14, 2015 at 6:55 PM, Rasmus wrote: >> >> Hi Matt, >>> >>> Matt Price 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=E2=80=99s a hhr element? >>> >>>
, I meant >>> >> >> Can you just use something like >>> --------------------------- >>> >>> for a horizontal rule? AFAIK, it=E2=80=99s 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 n= ot >> 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: >>>> >>>> >>>> >>> >>> For me it=E2=80=99s inserted as >>> >>> >>>
>>> whatever I put here >>> >>>
>>> >>> >>> 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 modifyi= ng >> 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 "\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 > --001a1141b3c646e50d0522c97145 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi, I realize I never responded to say thank you= .=C2=A0

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 <= span dir=3D"ltr"><= ccberry@ucsd.edu> wrote:
On Wed, 14 Oct 2015, Matt Price wrote:

On Wed, Oct 14, 2015 at 6:55 PM, Rasmus <rasmus@gmx.us> wrote:

Hi Matt,

Matt Price <mopt= op99@gmail.com> writes:

a) add a horizontal rule

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

What=E2=80=99s a hhr element?

<hr>, I meant

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

for a horizontal rule?=C2=A0 AFAIK, it=E2=80=99s inserted as "---"= ;.

yes.=C2=A0 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<= br> 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=3D"speaker-notes">
whaever I put here
</aside>

For me it=E2=80=99s inserted as


<div class=3D"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<= br> 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
=C2=A0 (org-export-define-derived-backend
=C2=A0 =C2=A0'md-plus
=C2=A0 =C2=A0'md
=C2=A0 =C2=A0:translate-alist '(
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (export-block . org-md-plus-export-block))
=C2=A0 =C2=A0:export-block=C2=A0 =C2=A0 '("NOTES"))

=C2=A0 (defun org-md-plus-export-block
=C2=A0 =C2=A0 =C2=A0 (export-block contents info)
=C2=A0 =C2=A0 "Transcode a EXPORT-BLOCK NOTES element from Org to md-p= lus.
=C2=A0 =C2=A0 CONTENTS is nil.=C2=A0 INFO is a plist holding contextual inf= ormation."
=C2=A0 =C2=A0 (if (equal (org-element-property :type export-block) "NO= TES")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat "<aside class=3D\"speaker-= notes\">\n"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-element-proper= ty :value export-block)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "</aside>= ;\n")
=C2=A0 =C2=A0 =C2=A0 (let ((parent-backend (org-export-backend-parent backe= nd)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if parent-backend
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-export-with-backend
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0parent-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

--001a1141b3c646e50d0522c97145--