include "Pydj.inc.php"; // Pydj // Generates HTML documents $sTitle = "My first Pydj 0.2 document 0.2"; $pydj = new Pydj($sTitle, "en", $oHead); $pydj->Head()->Style("@import 'test.css';"); $pydj->Head()->ScriptFile("test.js"); $sScript = <<<SCRIPT window.onload = function () { \talert("I'm Script()"); \twithinOnLoad(); } SCRIPT; $pydj->Head()->Script($sScript); $sStyle = <<<STYLE \tcolor:#666; \ttext-decoration:underline; STYLE; $pydj->Tag("h1")->Attr("style", $sStyle)->Content("Hello World!"); $pydj->Tag("a")->Attr("href", "http://www.github.com")->Content("github.com"); $sStyle = <<<STYLE \tborder:1px solid #000; \tmargin:10px; \tpadding:10px; STYLE; $pydj->Tag("div")->Tag("p")->Attr("style", $sStyle)->Content("This is a paragraph in a div."); $pydj->Tag("code")->Content("This is code"); $pydj->Flush();
include "lib/PHPMarkdownExtra1.2.4/markdown.php"; ob_start(); include "mds/index.md"; $sMd = ob_get_contents(); ob_end_clean(); $sTitle = "Cyb3r Web | General Coding Conventions"; $oPydj = new Pydj($sTitle); $sStyle = <<<STYLE body { \tfont-family:Georgia, serif; } h2 { \tborder:0px solid #CCC; \tborder-top-width:4px; } code { \tfont-famyly:courrier; \tbackground-color:#EEE; \tcolor:#666; \tborder:1px solid #666; \tpadding:2px; \tmargin:2px; } STYLE; $oPydj->Head()->Style($sStyle); $oPydj->Tag("div")->HTML(Markdown($sMd)); $oPydj->Flush();