Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export to .md with code blocks if source is an .org file #736

Open
nbehrnd opened this issue Nov 29, 2022 · 0 comments
Open

export to .md with code blocks if source is an .org file #736

nbehrnd opened this issue Nov 29, 2022 · 0 comments

Comments

@nbehrnd
Copy link

nbehrnd commented Nov 29, 2022

Expected Behavior

After writing an .org file in orgmode, I anticipated the export by C-c C-e m m would fence snippets of code including a keyword to label the language the snippets are about. As an example of the pattern imagined

``` python
for i in range(5):
print(i)
```

The manual describes C-c C-s C as a chord within markdown mode to «insert[s] a GFM style backquote fenced code block.» which in this form is not compatible within orgmode.

Actual Behavior

Running Emacs orgmode, the export by C-c C-e m m only yields

    for i in range(5):
        print(i)

without fencing back ticks prior / after, and without a label about the language in question. So far, I obtained the pattern wanted with pandoc, e.g. by

pandoc test.org -o test_org2md_pandoc.md   # Pandoc's markdown format
pandoc test.org -o test_org2md_pandoc_gfm.md -t gfm # GitHub flavoured markdown

Question/feature suggest

Is there an option to permit export of fenced snippets of code e.g., by an additional line (similar to +#OPTIONS: in the file's header) in the .org file?

Steps to Reproduce

I prepared an .org file (attached in the .zip below), test.org. It contains some text, a labeled snippet of Python, an other about Fortran. While running orgmode, I exported this document by C-c C-e m m to write file test.md (equally provided).

Software Versions

Based on a thread on the orgmode discussion board org-mode code fence for markdown I amended Emacs 27.1 as provided by Linux Debian 12/bookworm by elpa-markdown-mode (2.5-1)and elpa-markdown-toc (0.1.5-1) via the synaptic package manager.

  • Markdown mode, version: 2.5
  • Markdown toc version: 0.1.5
  • Emacs, version: GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.16.0) of 2021-11-27, modified by Debian
  • pandoc, version: 2.17.1.1
  • OS: Linux Debian 12/bookworm, branch testing

2022-11-29_markdownmode_report.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant