support for command documentation:

- made package tree handler generic so it can work on any fs tree
- cleanups along the way

R=rsc
CC=r
http://go/go-review/1017020
This commit is contained in:
Robert Griesemer 2009-11-03 19:40:26 -08:00
parent dc62c66c73
commit 4818d346b6
6 changed files with 114 additions and 53 deletions

View file

@ -1,5 +1,5 @@
<table class="layout">
<tr><td colspan="2"><a href="/pkg/{Path|html}">{Name|html}</a></td></tr>
<tr><td colspan="2"><a href="{Path|path}">{Name|html}</a></td></tr>
{.repeated section Dirs}
<tr><td width="25em"></td><td>{@|dir}</td></tr>
{.end}

View file

@ -44,6 +44,7 @@
<li class="blank">&nbsp;</li>
<li class="navhead">Programming</li>
<li><a href="/cmd" class="noline">Command documentation</a></li>
<li><a href="/pkg" class="noline">Package documentation</a></li>
<li class="blank">&nbsp;</li>

View file

@ -6,17 +6,21 @@
{.section PDoc}
<!-- PackageName is printed as title by the top-level template -->
<p><code>import "{ImportPath|html}"</code></p>
{.section IsPkg}
<p><code>import "{ImportPath|html}"</code></p>
{.end}
{Doc|html-comment}
{.section Filenames}
<p>
<h4>Package files</h4>
<span style="font-size:90%">
{.repeated section @}
<a href="/{FilePath|html}/{@|html}">{@|html}</a>
{.section IsPkg}
{.section Filenames}
<p>
<h4>Package files</h4>
<span style="font-size:90%">
{.repeated section @}
<a href="/{FilePath|html}/{@|html}">{@|html}</a>
{.end}
</span>
</p>
{.end}
</span>
</p>
{.end}
{.section Consts}
<h2>Constants</h2>

View file

@ -1,8 +1,12 @@
{.section PDoc}
{.section IsPkg}
PACKAGE
package {PackageName}
import "{ImportPath}"
{.or}
COMMAND DOCUMENTATION
{.end}
{.section Doc}
{@}