[O] sequence of tangles

2013-04-14 Thread Johan Sandblom
Hi, all. I have a problem, most likely due to ignorance. For a project 
I am construction a web page as a single page. This page contains html, 
php, css and javascript. I have collected the project in an org file, 
with source code chunks in the various languages. So I have


#+BEGIN_SRC nxml :tangle file.php
!!DOCTYPE html
!-- header and stuff --
#+END_SRC

#+BEGIN_SRC css :tangle file.php
/* inline CSS */
#+END_SRC

#+BEGIN_SRC javascript :tangle file.php
// javascript
#+END_SRC

#+BEGIN_SRC nxml :tangle file.php
!-- more html --
#+END_SRC

#+BEGIN_SRC php :tangle file.php
#+END_SRC

#+BEGIN_SRC nxml :tangle file.php
!-- even more html --
#+END_SRC

However, tangling this apparently first sorts the chunks according to 
mode, so the resulting file first contains all the html, then the css, 
javascript and php in order


html
more html
even more html
css
js
php

resulting in an unusable file. I am sure I am overlooking something 
simple but I am unable to find it.


Johan

--
Johan Sandblom, MD PhD
m +46735521477
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
--Bertrand Russell



Re: [O] sequence of tangles

2013-04-14 Thread Christian Moe

Johan Sandblom writes:
 However, tangling this apparently first sorts the chunks according to 
 mode, so the resulting file first contains all the html, then the css, 
 javascript and php in order

Hi,

Try naming the chunks (any name will do), and add a block pulling them
all together with noweb syntax.

#+NAME: header
#+BEGIN_SRC nxml
!!DOCTYPE html
!-- header and stuff --
#+END_SRC

#+NAME: styles
#+BEGIN_SRC css
/* inline CSS */
#+END_SRC

#+NAME: scripts
#+BEGIN_SRC javascript
// javascript
#+END_SRC

#+NAME: body1
#+BEGIN_SRC nxml
!-- more html --
#+END_SRC

#+NAME: body2
#+BEGIN_SRC nxml
!-- even more html --
#+END_SRC

#+NAME: fulldoc
#+BEGIN_SRC nxml :tangle test-tangle.php :noweb yes
  header
  styles
  scripts
  body1
  body2
#+end_src

Yours,
Christian