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 :
corpus/A corpus to publish.
corpus/index.phpWelcome page of the corpus, handling user requests.
corpus/src/corpus.xmlAn XML-TEI source file
corpus/transform/corpus_split.xslYour 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.