tools
tools copied to clipboard
godoc/server: allow customized menu and navigation
This feature enables to create a template file named navmenu.html optionally.
If this exists, it will be included into the menu div and allows to extend the navigation for some custom stativ pages.
Also, if that file exists, there is no default redirect from "/" to "/pkg/" anymore. If you have "enabled" custom navigation it is also possible to create a custom index page.
This patch enables the godoc server to be a full customizable documentation site of go projects.
PR #309 should be applied in addition so that only partial overload of templates is necessary.
Example:
file: templates/navmenu.html
<a id="docButton" href="/doc/" title="General documentation">Documentation</a>
<a id="cmdButton" href="/cmd/" title="Show commands">Commands</a>
<a id="pkgButton" href="/pkg/" title="Show packages">Packages</a>
<a id="srcButton" href="/src/" title="Show sources">Sources</a>
<a id="aboutGoButton" href="/about-go/" title="About go">Go</a>
<a id="helpButton" href="/help/" title="Show general help">Help</a>
file: doc/help.html
<!--{
"Title": "Help",
"Path": "/help/"
}-->
<div id="manual-nav"></div>
<h2 id="home">Project information</h2>
<p>
Find out more about the project at <a href="/">root home</a>.
</p>
<h2 id="help">Get help</h2>
<p>
Put in some more help.
</p>
This will look like:

This PR (HEAD: 9a3b682c9bbbc9ed983d0c6ef016bf7f8c608934) has been imported to Gerrit for code review.
Please visit https://go-review.googlesource.com/c/tools/+/313095 to see it.
Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info
Message from Dmitri Shuralyov:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Thomas Freudenberg:
Patch Set 3:
(2 comments)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Dmitri Shuralyov:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Thomas Freudenberg:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Freudenberg:
Patch Set 3:
(2 comments)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Freudenberg:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
This PR (HEAD: 42f38a8e42bb65ef725e6ba5ab7b1466d4eee750) has been imported to Gerrit for code review.
Please visit https://go-review.googlesource.com/c/tools/+/313095 to see it.
Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info
Message from Dmitri Shuralyov:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Freudenberg:
Patch Set 3:
(2 comments)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Dmitri Shuralyov:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!
Message from Tom Freudenberg:
Patch Set 3:
(1 comment)
Please don’t reply on this GitHub thread. Visit golang.org/cl/313095. After addressing review feedback, remember to publish your drafts!