]> git.ozlabs.org Git - ccan/blob - web/staticmoduleinfo.php
aga: Remove unused state defines
[ccan] / web / staticmoduleinfo.php
1 <?php
2 session_start();
3 include('logo.html');
4 include('menulist.html');
5 include('static-configuration');
6 $module_path=$argv[1];
7 $module=$argv[2];
8 $maintainer=extract_field('maintainer',$module_path);
9 $author=extract_field('author',$module_path);
10 $summary=extract_field('summary',$module_path);
11 $see_also=extract_field('see_also',$module_path);
12 $description=htmlize_field('description',$module_path);
13 $example=extract_field('example',$module_path);
14 $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module_path));
15 $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module_path));
16 $licence=extract_field('licence',$module_path);
17 $license=extract_field('license',$module_path);
18 $url_prefix = getenv("URLPREFIX");
19 ?>
20 <div class='content moduleinfo'>
21
22 <p><a href="<?=$repo_base.$module?>">Browse Source</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></p>
23
24 <h3>Module:</h3>
25 <p><?=$module?></p>
26
27 <h3>Summary:</h3>
28 <p><?=$summary?></p>
29
30 <?php
31 if ($maintainer) {
32 ?>
33 <h3>Maintainer:</h3>
34 <p><?=$maintainer?></p>
35 <?php
36 }
37
38 if ($author) {
39 ?>
40 <h3>Author:</h3>
41 <p><?=$author?></p>
42 <?php
43 }
44
45 if ($dependencies) {
46 ?>
47 <h3>Dependencies:</h3>
48 <ul class='dependencies'>
49 <?php
50         foreach (preg_split("/\s+/", $dependencies) as $dep) {
51                 if ($dep) {
52                         echo '<li><a href="'.substr($dep, 5).'.html">'.$dep.'</a></li>';
53                 }
54         }
55 ?>
56 </ul>
57
58 <?php 
59 }
60
61 if ($extdepends) {
62 ?>
63 <h3>External dependencies:</h3>
64 <ul class='external-dependencies'>
65 <?php
66         foreach (split("\n", $extdepends) as $dep) {
67                 $fields=preg_split("/\s+/", $dep);
68                 echo "<li>" . $fields[0].' ';
69                 if (count($fields) > 1)
70                         echo '(version '.$fields[1].') ';
71                 echo '</li>';
72         }
73 ?>
74 </ul>
75 <?php 
76 }
77 ?>
78
79 <h3>Description:</h3>
80 <p><?=$description;?></p>
81
82 <?php 
83 if ($see_also) {
84 ?>
85 <h3>See Also:</h3>
86 <ul class='see-also'>
87 <?php
88         foreach (preg_split("/[\s,]+/", trim($see_also)) as $see) {
89                 echo '<li><a href="'.substr($see, 5).'.html">'.$see.'</a></li>';
90         }
91 ?>
92 </ul>
93 <?php
94 }
95
96 if ($example) {
97 ?>
98 <h3>Example:</h3>
99 <pre class="prettyprint">
100 <code class="language-c"><?=$example?></code>
101 </pre>
102 <?php
103 }
104
105 if ($license) {
106 ?>
107 <h3>License:</h3>
108 <p><?=$license?></p>
109 <?php
110 }
111 ?>
112 </div>
113 </body></html>