[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] org-babel-tangle xml text
From: |
Martin G. Skjæveland |
Subject: |
[Orgmode] org-babel-tangle xml text |
Date: |
Tue, 03 Nov 2009 16:16:14 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (X11/20090817) |
Hi all,
I am quite new to the wonderful world of org-mode and org-babel. Right
now I am using org-mode to make exercises for a semantic web programming
course. org-mode and its friends give me a efficient writing tool, a
presentation tool, export for web, export for print and a literate
programming tool. That's nice!
But I have a question. I would like to include many code snippets
written in RDF (XML/RDF, N3), which are languages not supported by
org-babel [1], in my document, and I would like to use the "Edit the
source code example at point in its native mode"-feature of org-mode and
the tangle-feature of org-babel. Now I'm specifying the language as css
(see below) since it is supported by org-babel and does not add any
comments to output. This works for "tangling", but not for native editing.
Is there a way I can add xml and n3 to the list of supported languages?
These languages does not need interpretation, so I'm thinking it should
be quite easy to add. I have fumblingly tried
(add-to-list 'org-babel-tangle-langs '("xml"))
and
(add-to-list 'org-babel-tangle-langs '("css" "xml"))
but it as no effect.
Below is a sample of what I am currently using. Running org-babel-tangle
gives me the correct foaf.rdf file. I would like to swap 'css' with
'xml' so that the code can be edited and understood as xml.
#+SRCNAME: foaf-main
#+BEGIN_SRC css :tangle foaf.rdf
<rdf:RDF>
<<foaf-rel>>
</rdf:RDF>
#+END_SRC
#+SRCNAME: foaf-rel
#+BEGIN_SRC css :tangle no
<foaf:knows>
<foaf:Person rdf:ID="timbl">
</foaf:knows>
#+END_SRC
I hope this was clear -- and that someone can help.
Thanks!
Martin
[1]
http://orgmode.org/worg/org-contrib/babel/org-babel.php#reference-and-documentation
- [Orgmode] org-babel-tangle xml text,
Martin G. Skjæveland <=