]> git.ozlabs.org Git - ccan/blobdiff - web/staticmoduleinfo.php
New page layout, font, background image. Replaced table tags with headers and paragra...
[ccan] / web / staticmoduleinfo.php
index 0d04d6686a9ab86373f451e02a24f86b878bd9bb..98edf9b52a746b209ac916fe3b410f00b6d16eb0 100644 (file)
@@ -4,43 +4,47 @@ include('logo.html');
 include('menulist.html');
 include('static-configuration');
 $module_path=$argv[1];
-$module=basename($module_path);
+$module=$argv[2];
 $maintainer=extract_field('maintainer',$module_path);
 $author=extract_field('author',$module_path);
 $summary=extract_field('summary',$module_path);
+$see_also=extract_field('see_also',$module_path);
 $description=htmlize_field('description',$module_path);
 $example=extract_field('example',$module_path);
 $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module_path));
 $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module_path));
 $licence=extract_field('licence',$module_path);
+$license=extract_field('license',$module_path);
+$url_prefix = getenv("URLPREFIX");
 ?>
-<table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
-<tr align="center" bgcolor="FFFFCC">
+<div class='content'>
+<table align="center" width="70%" border="0" cellpadding="3" cellspacing="1">
+<tr align="center">
 <td>
 <a href="<?=$repo_base.$module?>">Browse Source</a>
 </td>
 <td>
-<a href="../<?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
-<a href="../<?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
+<a href="<?=$url_prefix?><?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
+<a href="<?=$url_prefix?><?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
 </tr>
 </table>
 
 <p>
 </p>
 
-<table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="8" cellspacing="1">
-<tr align="left" bgcolor="FFFFCC">
+<table align="center" width="70%" border="0" cellpadding="8" cellspacing="1">
+<tr align="left">
 <td><h3>Module: </h3> <?=$module?> </td>
 </tr>
 
-<tr align="left" bgcolor="FFFFCC">
+<tr align="left">
 <td><h3>Summary: </h3> <?=$summary?></td>
 </tr>
 
 <?php
 if ($maintainer) {
 ?>
-<tr align="left" bgcolor="FFFFCC"
+<tr align="left"> 
 <td><h3>Maintainer: </h3> <?=$maintainer?></td>
 </tr>
 <?php
@@ -48,7 +52,7 @@ if ($maintainer) {
 
 if ($author) {
 ?>
-<tr align="left" bgcolor="FFFFCC"
+<tr align="left"> 
 <td><h3>Author: </h3> <?=$author?></td>
 </tr>
 <?php
@@ -56,7 +60,7 @@ if ($author) {
 
 if ($dependencies) {
 ?>
-<tr align="left" bgcolor="FFFFCC">
+<tr align="left">
 <td><h3>Dependencies: </h3> <pre> <?php
        foreach (preg_split("/\s+/", $dependencies) as $dep) {
                echo '<a href="'.substr($dep, 5).'.html">'.$dep.'</a> ';
@@ -68,7 +72,7 @@ if ($dependencies) {
 
 if ($extdepends) {
 ?>
-<tr align="left" bgcolor="FFFFCC">
+<tr align="left">
 <td><h3>External dependencies: </h3> <?php
        foreach (split("\n", $extdepends) as $dep) {
                $fields=preg_split("/\s+/", $dep);
@@ -82,13 +86,26 @@ if ($extdepends) {
 <?php 
 }
 ?>
-<tr align="left" bgcolor="FFFFCC">
+<tr align="left">
 <td><h3>Description: </h3> <?=$description;?> </td>
 </tr>
+
 <?php 
+if ($see_also) {
+?>
+<tr align="left">
+<td><h3>See Also: </h3> <pre> <?php
+       foreach (preg_split("/[\s,]+/", trim($see_also)) as $see) {
+               echo '<a href="'.substr($see, 5).'.html">'.$see.'</a> ';
+        }
+?></pre></td>
+</tr>
+<?php
+}
+
 if ($example) {
 ?>
-<tr align="left" bgcolor="FFFFCC"
+<tr align="left"> 
 <td><h3>Example: </h3> <pre><?=$example?></pre></td>
 </tr>
 <?php
@@ -96,11 +113,20 @@ if ($example) {
 
 if ($licence) {
 ?>
-<tr align="left" bgcolor="FFFFCC"
-<td><h3>Licence: </h3> <?=$licence?></td>
+<tr align="left"> 
+<td><h3>License: </h3> <?=$licence?></td>
 </tr>
 <?php
 }
+
+if ($license) {
 ?>
-</table><hr>
+<tr align="left"> 
+<td><h3>License: </h3> <?=$license?></td>
+</tr>
+<?php
+}
+?>
+</table>
+</div>
 </body></html>