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 :

<?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.