changed image citation and quote
[org-mode.git] / test-tangle.org
blobfcd6574f43e641f9db54eed5ffc24477263946a6
1 #+OPTIONS: toc:2 ^:nil
2 #+TITLE: Testing Org-Babel Tangling
4 * Some file
6 Some text here
8 #+BEGIN_SRC sh
9 echo "line 1"
10 echo "line 2"
11 #+END_SRC
13 more text
15 #+srcname: ruby-no-session
16 #+begin_src ruby
17   def hello
18     puts "hello world"
19   end
20 #+end_src
22 #+srcname: first-ruby-block
23 #+begin_src ruby :session special :tangle trivial-symbol
24 :block_the_first
25 #+end_src
27 #+srcname: ruby-with-noweb-references
28 #+begin_src ruby :tangle yes
29   # <<ruby-no-session>>
30   hello()
31 #+end_src
35 ** Some subsection
37 #+BEGIN_SRC sh
38 echo "line 3"
39 echo "line 4"
40 #+END_SRC
42 blah blah blah
44 #+BEGIN_EXAMPLE
45 text line 1
46 text line 2
47 text line 3
48 #+END_EXAMPLE
50 more stuff
52 #+srcname: i-have-a-name
53 #+begin_src sh 
54 echo "I have a name"
55 #+end_src
58 foo foo bar baz
60 #+BEGIN_SRC sh
61 echo "line 5"
62 echo "line 6"
63 #+END_SRC
66 ** Ruby blocks
68 #+srcname: another-ruby-block
69 #+begin_src ruby :session special
70 holder = 98
71 #+end_src
74 #+srcname: ruby-plus-2
75 #+begin_src ruby :session special
76 def plus_two(n)
77   n + 2
78 end
79 #+end_src
81 #+srcname: final-ruby
82 #+begin_src ruby :session special
83 plus_two(holder)
84 #+end_src
87 ** Emacs Lisp initialization stuff
89 #+srcname: lets-set-some-variables()
90 #+begin_src emacs-lisp 
91   (setq test-tangle-loading "org-babel tangles")
92   (setq test-tangle-advert "use org-babel-tangle for all your emacs initialization files!!")
93 #+end_src
95 #+srcname: i-shouldnt-be-tangled
96 #+begin_src emacs-lisp :tangle no
97   (setq test-tangle-i-should-not-exist "hopefully I'm not included")
98 #+end_src
100 *** Emacs Lisp (not to be tangled)
101     :PROPERTIES:
102     :tangle:   no
103     :END:
105 #+srcname: i-also-shouldnt-be-tangled
106 #+begin_src emacs-lisp 
107   (setq test-tangle-me-either "i also shouldn't be tangled")
108 #+end_src