tools icon indicating copy to clipboard operation
tools copied to clipboard

godoc/server: allow customized menu and navigation

Open TomFreudenberg opened this issue 4 years ago • 12 comments

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:

grafik

TomFreudenberg avatar Apr 25 '21 16:04 TomFreudenberg

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

gopherbot avatar Apr 25 '21 16:04 gopherbot

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!

gopherbot avatar Apr 30 '21 20:04 gopherbot

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!

gopherbot avatar May 01 '21 05:05 gopherbot

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!

gopherbot avatar May 07 '21 20:05 gopherbot

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!

gopherbot avatar May 08 '21 02:05 gopherbot

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!

gopherbot avatar May 08 '21 07:05 gopherbot

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!

gopherbot avatar May 08 '21 07:05 gopherbot

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

gopherbot avatar Oct 22 '21 16:10 gopherbot

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!

gopherbot avatar Nov 08 '21 11:11 gopherbot

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!

gopherbot avatar Nov 08 '21 11:11 gopherbot

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!

gopherbot avatar Nov 08 '21 11:11 gopherbot

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!

gopherbot avatar Nov 08 '21 11:11 gopherbot