2009-06-27 16:24:49 -04:00
|
|
|
#+OPTIONS: toc:2 ^:nil
|
2009-07-17 15:09:42 -04:00
|
|
|
#+TITLE: Testing Org-Babel Tangling
|
2009-06-27 16:24:49 -04:00
|
|
|
|
2009-06-02 18:31:09 -04:00
|
|
|
* Some file
|
|
|
|
|
|
|
|
Some text here
|
|
|
|
|
2009-06-27 15:43:47 -04:00
|
|
|
#+BEGIN_SRC sh
|
2009-06-02 18:31:09 -04:00
|
|
|
echo "line 1"
|
|
|
|
echo "line 2"
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
more text
|
|
|
|
|
2009-06-27 16:24:49 -04:00
|
|
|
#+srcname: ruby-no-session
|
2009-07-31 19:01:40 -04:00
|
|
|
#+begin_src ruby
|
2009-06-27 16:24:49 -04:00
|
|
|
def hello
|
|
|
|
puts "hello world"
|
|
|
|
end
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+srcname: first-ruby-block
|
2009-07-30 22:14:35 -04:00
|
|
|
#+begin_src ruby :session special :tangle trivial-symbol
|
2009-06-27 16:24:49 -04:00
|
|
|
:block_the_first
|
|
|
|
#+end_src
|
|
|
|
|
2009-07-31 18:53:02 -04:00
|
|
|
#+srcname: ruby-with-noweb-references
|
2009-07-31 19:01:40 -04:00
|
|
|
#+begin_src ruby :tangle yes
|
2009-07-31 18:53:02 -04:00
|
|
|
# <<ruby-no-session>>
|
|
|
|
hello()
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
2009-06-27 16:24:49 -04:00
|
|
|
|
2009-06-02 18:31:09 -04:00
|
|
|
** Some subsection
|
|
|
|
|
2009-06-27 15:43:47 -04:00
|
|
|
#+BEGIN_SRC sh
|
|
|
|
echo "line 3"
|
|
|
|
echo "line 4"
|
2009-06-02 18:31:09 -04:00
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
blah blah blah
|
|
|
|
|
|
|
|
#+BEGIN_EXAMPLE
|
|
|
|
text line 1
|
|
|
|
text line 2
|
|
|
|
text line 3
|
|
|
|
#+END_EXAMPLE
|
|
|
|
|
2009-06-27 16:13:26 -04:00
|
|
|
more stuff
|
|
|
|
|
|
|
|
#+srcname: i-have-a-name
|
|
|
|
#+begin_src sh
|
|
|
|
echo "I have a name"
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
2009-06-02 18:31:09 -04:00
|
|
|
foo foo bar baz
|
|
|
|
|
2009-06-27 15:43:47 -04:00
|
|
|
#+BEGIN_SRC sh
|
|
|
|
echo "line 5"
|
|
|
|
echo "line 6"
|
2009-06-02 18:31:09 -04:00
|
|
|
#+END_SRC
|
2009-06-27 16:24:49 -04:00
|
|
|
|
|
|
|
|
|
|
|
** Ruby blocks
|
|
|
|
|
|
|
|
#+srcname: another-ruby-block
|
|
|
|
#+begin_src ruby :session special
|
|
|
|
holder = 98
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
|
|
#+srcname: ruby-plus-2
|
|
|
|
#+begin_src ruby :session special
|
|
|
|
def plus_two(n)
|
|
|
|
n + 2
|
|
|
|
end
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+srcname: final-ruby
|
|
|
|
#+begin_src ruby :session special
|
|
|
|
plus_two(holder)
|
|
|
|
#+end_src
|
2009-07-14 21:29:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
** Emacs Lisp initialization stuff
|
|
|
|
|
2009-07-17 15:09:42 -04:00
|
|
|
#+srcname: lets-set-some-variables()
|
2009-07-14 21:29:28 -04:00
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq test-tangle-loading "org-babel tangles")
|
|
|
|
(setq test-tangle-advert "use org-babel-tangle for all your emacs initialization files!!")
|
|
|
|
#+end_src
|
2009-07-22 20:30:30 -04:00
|
|
|
|
|
|
|
#+srcname: i-shouldnt-be-tangled
|
|
|
|
#+begin_src emacs-lisp :tangle no
|
|
|
|
(setq test-tangle-i-should-not-exist "hopefully I'm not included")
|
|
|
|
#+end_src
|
2009-08-01 17:43:37 -04:00
|
|
|
|
|
|
|
*** Emacs Lisp (not to be tangled)
|
|
|
|
:PROPERTIES:
|
|
|
|
:tangle: no
|
|
|
|
:END:
|
|
|
|
|
|
|
|
#+srcname: i-also-shouldnt-be-tangled
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(setq test-tangle-me-either "i also shouldn't be tangled")
|
|
|
|
#+end_src
|