emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>, Rasmus <rasmus@gmx.us>
Subject: Re: two simple derived backend questions
Date: Wed, 14 Oct 2015 20:35:50 -0700	[thread overview]
Message-ID: <alpine.OSX.2.20.1510142016190.901@charles-berrys-macbook.local> (raw)
In-Reply-To: <CAN_Dec93Qd7-1rvcW6bNzKFv70j075CFW_aYxVj8phAJBB7ifw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2787 bytes --]

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 <moptop99@gmail.com> 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	other threads:[~2015-10-15  3:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 18:22 two simple derived backend questions Matt Price
2015-10-14 22:55 ` Rasmus
2015-10-15  1:59   ` Matt Price
2015-10-15  3:35     ` Charles C. Berry [this message]
2015-10-23 18:04       ` Matt Price
2015-10-15  7:46     ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.1510142016190.901@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).