Hi Federico,
What I need is the ability to generate score in two view modes: each page individually, or all pages together.
Imagine the use case. A user works page scan by page scan to make the lilypond engraving look exactly like it was originally published (possible already). Then they want to visualize all pages together (possible but only as images, one after the other), and finally they want to download a single .ly file or to render a typeset pdf, or generate a midi file from all the pages together (not possible).
Yes, with the mediawiki extension we already can put all pages together (see [1], if you hover your mouse over the small number on the left you will see that is composed of two pages "100", "101"). When you click on that number you go to the page view of either one, and if you click edit you will see the lilypond source of the corresponding page. But to associate several independent pages as a bundle (for rendering, download, or midi generation), that doesn't work.
From our side we are considering each page as an individual independent file. It was suggested by Urs to use one variable for each page, and then render them either individually (when the user is in page view) or all together (when the user request a download of the whole book/score). However, lilypond is running in safe mode, thus variables are not supported...
I hope I have better explained the problem now... any ideas about how to proceed?
If you want to dig deeper you can take a look to our Extension:Proofread Page [2] which manages transclusion. And if you'd like to go even a step further and have a test environment, it is easy to set up a virtual machine with Vagrant [3].
Cheers,
Micru