wiki:TracNav/Install
Last modified 7 years ago Last modified on 03/24/06 20:15:02

TracNav installation

Note: This information is outdated. See TracNav/DownloadAndInstall.

TracNav can be installed either globally by copying TracNav.py to the wiki-macros subdir of your trac installation (typically called /usr/share/trac/wiki-macros) or on a per-project basis, by copying it to the wiki-macros subdirectory of your project.

Additionally, you should append the following CSS rules either to the global style file (typically /usr/share/trac/htdocs/css/wiki.css) or to the file templates/site_css.cs within your project.

/* Styles for TracNav */
.wiki-toc.trac-nav h2 {
 margin-left: 2px;
 margin-right: 4ex;
 margin-top: 0;
 margin-bottom: 5px;
 paddint-top: 0;
}
@media screen {
 .wiki-toc.trac-nav h2 {
  display: none;
 }
}
@media print {
 .wiki-toc.trac-nav {
  display: none;
 }
}
.wiki-toc.trac-nav h4 { margin: 0; padding: 0; }
.wiki-toc.trac-nav ul > li:first-child { margin-right: 4ex; }
.wiki-toc.trac-nav .edit {
 position: absolute;
 top: 2px;
 right: 3px;
 margin-left: 3px;
 border: 0;
}
.wiki-toc.trac-nav .edit a { color:blue; border-color:blue; }

The lines above define the styles for displaying the navigation bar. These styles build upon the styles for TracGuideToc that come with your Trac distribution. If you just install the macro but miss to extend the style file, TracNav will work but look somewhat strange.