[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add org-md-src-block for src-block formater
From: |
Berry, Charles |
Subject: |
Re: [PATCH] Add org-md-src-block for src-block formater |
Date: |
Thu, 27 Aug 2020 16:53:29 +0000 |
You might want to browse the ox-ravel repository[1].
It provides a collection of exporters that support reformatting src blocks and
inline src blocks for a variety of output formats (including markdown).
Basically, it will produce a derived backend that adds source block
reformatting to whatever the parent backend provides.
It is aimed at R flavored exports (knitr, Rmarkdown, Sweave), but customizable.
One can, for example, allow emacs-lisp and shell src blocks to execute during
export, but format python, C++ and R blocks for markdown and subsequent
processing. It is easy to apply to any markdown exporter
See ox-ravel.org for details on customization.
It has plenty of stops and whistles even without customization. Check out the
examples, such as demos.org and markdown.org.
HTH,
Chuck
[1]
https://github.com/chasberry/orgmode-accessories/blob/org-9-plus/markdown.org
> On Aug 26, 2020, at 10:26 PM, Naoya Yamashita <conao3@gmail.com> wrote:
>
> Hi,
> I found `ox-md` exporter drop src-block language information.
> My patch fixes the behavior; to embed src-block language information
> using markdown src block grammar.
>
> 1. Open some buffer
> 2. Tnsert below code
> 3. Turn on `org-mode`
> 4. `C-c C-e m M` (export as markdown in temp buffer)
>
> ## org source
> ```org
> #+begin_src python
> print(1 + 2)
> #+end_src
>
> #+begin_src emacs-lisp
> (print "hello")
> #+end_src
>
> #+begin_src
> something source code
> #+end_src
> ```
>
> ## before
> ```markdown
>
> # Table of Contents
>
>
>
> print(1 + 2)
>
> (print "hello")
>
> something source code
>
> ```
>
> ## after
> ```markdown
>
> # Table of Contents
>
>
>
> ```python
> print(1 + 2)
> ```
>
> ```emacs-lisp
> (print "hello")
> ```
>
> ```
> something source code
> ```
>
> ```
> <0001-Add-org-md-src-block-for-src-block-formater.patch>