This commit is contained in:
parent
83677290e8
commit
7de3e31a32
@ -112,16 +112,17 @@
|
||||
while($count--) {
|
||||
array_shift($p);
|
||||
}
|
||||
|
||||
print "<div class=level" . $l . '><font class=level' . $l . '>';
|
||||
?>
|
||||
|
||||
<a href=documentation2.php?chapter=<?php print urlencode($i[$x]['name']) . '>' . end($p); ?></a>
|
||||
</font></div>
|
||||
<?php
|
||||
|
||||
if (strncmp($i[$x]['name'], $_GET['chapter'], strlen($_GET['chapter'])) !== 0) {
|
||||
break;
|
||||
if ( ! empty($p)) {
|
||||
print "<div class=level" . $l . '><font class=level' . $l . '>' . $i[$x]['index'];
|
||||
?>
|
||||
|
||||
<a href=documentation2.php?chapter=<?php print urlencode($i[$x]['name']) . '>' . end($p); ?></a>
|
||||
</font></div>
|
||||
<?php
|
||||
|
||||
if (strncmp($i[$x]['name'], $_GET['chapter'], strlen($_GET['chapter'])) !== 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,37 @@ function render($title,$t,$e) {
|
||||
}
|
||||
print "<br>";
|
||||
}
|
||||
/**
|
||||
public function parseIndex($index, $path = array(), $counters = array())
|
||||
{
|
||||
$ret = array();
|
||||
|
||||
foreach ($index as $k => $v) {
|
||||
$i = count($path) - 1;
|
||||
|
||||
$counters[$i]++;
|
||||
|
||||
if (is_array($v)) {
|
||||
if ( ! is_numeric($k)) {
|
||||
$tmp = $path;
|
||||
$tmp[] = $k;
|
||||
|
||||
$chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $k : $k;
|
||||
|
||||
$ret[] = array('index' => implode('.', $counters),
|
||||
'name' => $chapterName);
|
||||
}
|
||||
|
||||
$ret = array_merge($ret, $this->parseIndex($v, $tmp, $counters));
|
||||
} else {
|
||||
$chapterName = ( ! empty($path)) ? implode(' - ', $path) . ' - ' . $v : $v;
|
||||
|
||||
$ret[] = array('index' => implode('.', $counters),
|
||||
'name' => $chapterName);
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
}*/
|
||||
function render_block($name) {
|
||||
|
||||
if(file_exists("docs/$name.php")) {
|
||||
|
@ -1,22 +1,32 @@
|
||||
<?php
|
||||
include("top.php");
|
||||
require_once("highlight.php");
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
error_reporting(E_ALL);
|
||||
set_include_path(dirname(__FILE__) . '/../vendor/');
|
||||
|
||||
$f = file_get_contents('menu.php');
|
||||
$a = explode(PHP_EOL, $f);
|
||||
$res = array();
|
||||
$curr = false;
|
||||
|
||||
require_once('Text/Wiki.php');
|
||||
require_once('Text/Wiki/MediaWiki.php');
|
||||
|
||||
|
||||
|
||||
|
||||
class DocTool
|
||||
{
|
||||
private $index;
|
||||
|
||||
protected $highlighter;
|
||||
|
||||
protected $wiki;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->highlighter = new PHP_Highlight;
|
||||
$this->wiki = new Text_Wiki;
|
||||
}
|
||||
public function parseIndex2($index)
|
||||
{
|
||||
@ -74,7 +84,7 @@ class DocTool
|
||||
if(substr($c, 0, 5) == "<?php") {
|
||||
include("docs/$name.php");
|
||||
} else {
|
||||
print $c."<br><br>";
|
||||
print $this->wiki->transform($c) . "<br><br>";
|
||||
}
|
||||
}
|
||||
if(file_exists("codes/$name.php")) {
|
||||
|
@ -339,7 +339,7 @@ class PHP_Highlight
|
||||
|
||||
// Format code
|
||||
$source = $this->toArray($funcref);
|
||||
$out = "<div class='code'>\n";
|
||||
$out = "<div class='code'>";
|
||||
foreach ($source as $i => $line) {
|
||||
$out .= ' ';
|
||||
|
||||
@ -350,7 +350,7 @@ class PHP_Highlight
|
||||
$out .= empty($line) ? ' ' : $line;
|
||||
$out .= "<br />\n";
|
||||
}
|
||||
$out .= "</div>\n";
|
||||
$out .= "</div>";
|
||||
|
||||
if ($return === true) {
|
||||
return $out;
|
||||
|
@ -106,6 +106,9 @@ font-size: 14 px;
|
||||
i {
|
||||
color: #367FAC;
|
||||
}
|
||||
em {
|
||||
color: #367FAC;
|
||||
}
|
||||
a {
|
||||
color: #367FAC;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user