diple/php/, Diple PHP Classes library
To publish a corpus, the idea is to separate a folder with at least, XML source, and an index.php
to serve it.
The Diple PHP code is available as a class library that you may use, or not, according to your editorial project,
or throw the Diple.php class (which uses a PHP autoload mechanism).
Code is usually written with the less dependencies
as possible, trying to follow Unix philosophy, especially :
Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams… (Doug McIlroy).
A typical install could be :
diple/
Diple modules.corpus/
A corpus to publish.corpus/index.php
Welcome page of the corpus, handling user requests.corpus/src/corpus.xml
An XML-TEI source filecorpus/transform/corpus_split.xsl
Your XSL driver, choosing the Diple XSL you want to import
<?php // corpus/index.php // include Diple driver class include("../diple/php/Diple.php"); // get a doc to display $doc=Diple::doc(); // include a theme require (Diple::$dipleDir."theme/bleu/Bleu.php"); // configure theme to point to Diple folder $theme = new Bleu(Diple::$dipleHref."theme/"); // start the theme output $theme->prolog(); ?> <!-- My CSS and scripts --> <?php $doc->meta(); // metas of included doc ?> </head> <body> My header <?php $doc->body() // body of included doc ?> My footer </body> </html> ?>
Real life corpora may require more complex interface. Diple committers are involved in electronic edition, providing new snippets and widgets to other Diple users, when it has been tested one more than two editions.