Add code block in Emacs Lisp

pull/2/head
Fabrice Niessen 2015-04-24 17:15:22 +02:00
parent c382847d30
commit 0d73a0fbcd
2 changed files with 23 additions and 7 deletions

View File

@ -11,13 +11,13 @@
<meta name="description" content="Org mode syntax example" />
<meta name="keywords" content="org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css" />
<link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css" />
<link rel="stylesheet" type="text/css" href="d:/Users/fni/src/org-html-themes/styles/readtheorg/css/htmlize.css" />
<link rel="stylesheet" type="text/css" href="d:/Users/fni/src/org-html-themes/styles/readtheorg/css/readtheorg.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js" type="text/javascript">
</script>
<script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js">
<script type="text/javascript" src="d:/Users/fni/src/org-html-themes/styles/readtheorg/js/readtheorg.js">
</script>
<script type="text/x-mathjax-config">
<![CDATA[
@ -1991,6 +1991,13 @@ Reference code like <span class="org-org-code">variables</span> or <span class="
<span class="org-keyword">return</span> 0;
}
</pre></div>
<div class="org-src-container">
<pre class="src src-emacs-lisp">
(<span class="org-keyword">defvar</span> <span class="org-variable-name">hello</span> <span class="org-string">"Hello"</span>)
(<span class="org-keyword">defun</span> <span class="org-function-name">hello</span> (name <span class="org-type">&amp;optional</span> greeting)
(message <span class="org-string">"%s %s"</span> (or greeting <span class="org-string">"Hello"</span>) name))
</pre></div>
</div>
</div>
<div id="outline-container-orgheadline68" class="outline-3">
@ -2022,7 +2029,7 @@ This block is in scriptsize
<div id="outline-container-orgheadline70" class="outline-3">
<h3 id="orgheadline70">Line numbers</h3>
<div class="outline-text-3" id="text-orgheadline70">
<p>Both in <code>example</code> and in <code>src</code> snippets, you can add a <code>-n</code> switch to the end of the <code>begin</code> line, to get the lines of the example numbered.</p>
<p>Both in <code>example</code> and in <code>src</code> snippets, you can add a <code>-n</code> switch to the end of the <code>begin</code> line to get the lines numbered:</p>
<div class="org-src-container">
<pre class="src src-emacs-lisp">
<span class="linenr">1: </span>(<span class="org-keyword">defun</span> <span class="org-function-name">org-xor</span> (a b)

View File

@ -9,8 +9,8 @@
#+HTML_LINK_HOME: http://www.google.com
#+HTML_LINK_UP: http://www.bing.com
# #+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg-local-abs.setup
#+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg.setup
#+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg-local-abs.setup
# #+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg.setup
#+PROPERTY: eval yes
#+PROPERTY: exports both
@ -1073,6 +1073,15 @@ int main(int arc, char **argv)
}
#+end_src
#+begin_src emacs-lisp :eval no
(defvar hello "Hello")
(defun hello (name &optional greeting)
(message "%s %s" (or greeting "Hello") name))
#+end_src
# See http://sphinxcontrib-emacs.readthedocs.org/en/latest/guide/domain.html
** Source mode
The following language strings are currently recognized:
@ -1118,7 +1127,7 @@ print("This block is in scriptsize")
** Line numbers
Both in ~example~ and in ~src~ snippets, you can add a ~-n~ switch to the end of the
~begin~ line, to get the lines of the example numbered.
~begin~ line to get the lines numbered:
#+header: :eval no
#+begin_src emacs-lisp -n