all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* sequence of tangles
@ 2013-04-14  8:39 Johan Sandblom
  2013-04-14 10:02 ` Christian Moe
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Sandblom @ 2013-04-14  8:39 UTC (permalink / raw)
  To: Emacs orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sequence of tangles
  2013-04-14  8:39 sequence of tangles Johan Sandblom
@ 2013-04-14 10:02 ` Christian Moe
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Moe @ 2013-04-14 10:02 UTC (permalink / raw)
  To: Johan Sandblom; +Cc: Emacs orgmode


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-14  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14  8:39 sequence of tangles Johan Sandblom
2013-04-14 10:02 ` Christian Moe

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.