Comments (4)
I've just looked at the code. ox-reveal derives from ox-html which declares (inline-src-block . org-html-inline-src-block)
and
(defun org-html-inline-src-block (inline-src-block contents info)
"Transcode an INLINE-SRC-BLOCK element from Org to HTML.
CONTENTS holds the contents of the item. INFO is a plist holding
contextual information."
(let* ((org-lang (org-element-property :language inline-src-block))
(code (org-element-property :value inline-src-block)))
(error "Cannot export inline src block")))
ox-reveal should therefore provide a custom function.
Below is a patch that implements that. Unfortunately, the function is never called. That also explains why there's no error which the ox-html function signals. So there's something wrong with org's export framework...
I think my patch does the right thing anyway.
From bf5c6a5fa01cef223162d6ef70d402ce12bbf819 Mon Sep 17 00:00:00 2001
From: Tassilo Horn <[email protected]>
Date: Wed, 12 Jun 2013 17:06:08 +0200
Subject: [PATCH] Support inline src code
---
ox-reveal.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ox-reveal.el b/ox-reveal.el
index 016d839..86c2458 100644
--- a/ox-reveal.el
+++ b/ox-reveal.el
@@ -59,6 +59,7 @@
:translate-alist
'((headline . org-reveal-headline)
(inner-template . org-reveal-inner-template)
+ (inline-src-block . org-reveal-inline-src-block)
(item . org-reveal-item)
(keyword . org-reveal-keyword)
(paragraph . org-reveal-paragraph)
@@ -517,6 +518,14 @@ the plist used as a communication channel."
(org-export-read-attribute :attr_reveal paragraph :frag))
contents)))))
+(defun org-reveal-inline-src-block (inline-src-block contents info)
+ "Transcode an INLINE-SRC-BLOCK element from Org to HTML.
+CONTENTS holds the contents of the item. INFO is a plist holding
+contextual information."
+ (let* ((org-lang (org-element-property :language inline-src-block))
+ (code (org-element-property :value inline-src-block)))
+ (format "<code class=\"src src-%s\">%s</code>" org-lang code)))
+
(defun org-reveal-section (section contents info)
"Transcode a SECTION element from Org to HTML.
CONTENTS holds the contents of the section. INFO is a plist
--
1.8.2.1
from org-reveal.
It seems like inline code blocks cannot be exported (intentionally), although I don't understand the reasons...
See
http://lists.gnu.org/archive/html/emacs-orgmode/2013-06/msg00531.html
http://lists.gnu.org/archive/html/emacs-orgmode/2013-06/msg00534.html
from org-reveal.
Hello, Tassilo,
Sorry for a late response. I was recently too busy to take a look on Org-Reveal.
I checked your mail discussion and the Babel documents, it seems like the inline source codes are used for evaluation, rather than showing source codes.
With the default setting, Babel will evaluate the inline source codes and put the evaluation result into context. For example, exporting the following contents to HTML will result in a page showing "1 + 1 = 2".
-
Inline Code Evaluation
1 + 1 = src_python{ return 1 + 1 }
Also, to enable Python evaluation, you need to add Python to Babel's do-load list by adding the following codes to your .emacs . Similar precess for other languages.
(add-hook 'org-mode-hook
(lambda ()
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)))))
According to the Babel's document, you should be able to export inline source codes themselves instead of the evaluation result by setting header argument :export code, like below
-
Inline Code Evaluation
1 + 1 = src_python[:exports code]{ return 1 + 1 }
But actually, such inline codes will result in a "+BEGIN_SRC" text that are not parsed. I think it is a bug of Babel and the export engine.
Regards,
Yujie
from org-reveal.
Yeah, I've just found that out, too, thanks to Eric Schulte's reply on the org-mode list. We'll see what he says...
from org-reveal.
Related Issues (20)
- Using plugins seems broken with current reveal.js HOT 3
- Unable to set theme HOT 2
- Left-alignment broken by comment/note HOT 2
- multiplex confusion HOT 10
- feature request: REVEAL_PROLOGUE_HTML REVEAL_EPILOGUE_HTML HOT 2
- How to tell org-reveal to use latex package HOT 5
- disable the center behavior HOT 1
- 94c43ff36a47f6fa3d865e67f0b99bf0de146db2
- Font color in tables HOT 3
- Image path after export HOT 2
- org-reveal-export-to-html does not respect ordered list start-number with the [@n] trick
- Support request: configure ORGFILE_client.html multiplex output filename
- Adding multiple stylesheets with EXPORT_REVEAL_EXTRA_CSS property does not work as expected
- No dot after section number when using split:t
- Please document minimum supported reveal.js version
- Please provide minimal test document
- Wrong docstring for org-reveal-single-file
- Possible to fragment lists by default?
- org-element-at-point error
- How to translate this using org-reveal
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-reveal.