Skip to content

Commit

Permalink
Handle the Right panel with the right class/method markup stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Arian committed May 10, 2010
1 parent fcf6c95 commit d8af456
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
2 changes: 1 addition & 1 deletion assets/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pre{
}

.methods ul li strong{
font-size: 1.2em;
font-size: 1.1em;
}

.methods ul ul{
Expand Down
20 changes: 17 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,23 @@

// Get the methods
$methods = array();
preg_match_all('/\{#(.*)\}/',$markdown,$methods);
if(isset($methods[1]) && is_array($methods[1])){
$tpl->methods = $methods[1];
preg_match_all('/\{#(.*)\}/',$markdown,$tmpMethods);
if(isset($tmpMethods[1]) && is_array($tmpMethods[1])){
$methods = array();

foreach($tmpMethods[1] as $method){
$tmp = explode(':',$method);
if(count($tmp) >= 2){
$groupName = $tmp[0];
unset($tmp[0]);
if(!isset($methods[$groupName])) $methods[$groupName] = array();
$methods[$groupName][] = implode(':',$tmp);
}else{
$methods[$method] = array();
}
}

$tpl->methods = $methods;
}


Expand Down
14 changes: 11 additions & 3 deletions templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<link href="<?php echo $basepath; ?>assets/docs.css" rel="stylesheet" type="text/css" media="screen" />
<title><?php echo htmlentities($title); ?></title>

</head>
<body>
Expand All @@ -18,7 +19,7 @@
<div id="menu">
<ul>
<?php foreach($menu as $category => $link): ?>
<li><strong><?php echo $category; ?></strong><ul>
<li><strong><?php echo $category; ?></strong><ul>
<?php foreach($link as $text): ?>
<li><a href="<?php echo $baseurl.'/core/'.$category.'/'.$text; ?>"><?php echo $text; ?></a></li>
<?php endforeach; ?>
Expand All @@ -30,8 +31,15 @@

<div class="methods">
<ul>
<?php foreach($methods as $method): ?>
<li><a href="<?php echo '#'.$method; ?>"><?php echo $method; ?></a></li>
<?php foreach($methods as $group => $submethods): ?>
<li>
<strong><a href="<?php echo '#'.$group; ?>"><?php echo str_replace('-','.',$group); ?></a></strong>
<ul>
<?php foreach($submethods as $method): ?>
<li><a href="<?php echo '#'.$group.':'.$method; ?>"><?php echo $method; ?></a></li>
<?php endforeach; ?>
</ul>
</li>
<?php endforeach; ?>
</ul>
</div>
Expand Down

0 comments on commit d8af456

Please sign in to comment.