Version 43 (modified by osimons, 4 years ago) (diff)

It's 0.12 compatible.

Table of Contents

  1. The Trac User and Administration Guide
    1. Introduction
    2. User Guide
    3. Administrator Guide
    4. Support and Other Sources of Information
  2. Trac Installation Guide for 1.0
    1. Dependencies
      1. Mandatory Dependencies
        1. For the SQLite database
        2. For the PostgreSQL database
        3. For the MySQL database
      2. Optional Dependencies
        1. Version Control System
          1. Subversion
          2. Others
        2. Web Server
        3. Other Python Packages
    2. Installing Trac
      1. Using easy_install
      2. Using pip
      3. From source
      4. Advanced Options
    3. Creating a Project Environment
    4. Deploying Trac
      1. Running the Standalone Server
      2. Running Trac on a Web Server
        1. Generating the Trac cgi-bin directory
        2. Mapping Static Resources
          1. Example: Apache and ScriptAlias
        3. Setting up the Plugin Cache
    5. Configuring Authentication
    6. Granting admin rights to the admin user
    7. Finishing the install
      1. Automatic reference to the SVN changesets in Trac tickets
      2. Using Trac
  3. Upgrade Instructions
    1. Instructions
      1. 1. Bring your server off-line
      2. 2. Update the Trac Code
      3. 3. Upgrade the Trac Environment
      4. 4. Update the Trac Documentation
      5. 5. Refresh static resources
      6. 6. Steps specific to a given Trac version
        1. Upgrading from Trac 0.12 to Trac 1.0
        2. Upgrading from Trac 0.11 to Trac 0.12
          1. Python 2.3 no longer supported
          2. SQLite v3.x required
          3. PySqlite 2 required
          4. Multiple Repository Support
          5. Resynchronize the Trac Environment Against the Source Code Repository
          6. Improved repository synchronization
          7. Authz permission checking
          8. Microsecond timestamps
        3. Upgrading from Trac 0.10 to Trac 0.11
          1. Site Templates and Styles
          2. Trac Macros, Plugins
          3. For FCGI/WSGI/CGI users
          4. Web Admin plugin integrated
      7. 7. Restart the Web Server
    2. Known Issues
      1. Customized Templates
      2. ZipImportError
      3. Wiki Upgrade
      4. Trac database upgrade
      5. parent dir
    3. Related topics
      1. Upgrading Python
        1. Windows and Python 2.6
      2. Changing Database Backend
        1. SQLite to PostgreSQL
      3. Upgrading from older versions of Trac
  4. The Trac Configuration File
    1. Global Configuration
    2. Reference for settings
  5. TracAdmin
    1. Usage
      1. trac-admin <targetdir> initenv
    2. Interactive Mode
    3. Full Command Reference
  6. Trac Backup
    1. Creating a Backup
      1. Restoring a Backup
  7. Trac Logging
    1. Supported Logging Methods
    2. Log Levels
    3. Log Format
  8. Trac Permissions
    1. Graphical Admin Tab
    2. Available Privileges
      1. Repository Browser
      2. Ticket System
      3. Roadmap
      4. Reports
      5. Wiki System
      6. Permissions
      7. Others
    3. Creating New Privileges
    4. Granting Privileges
    5. Permission Groups
    6. Adding a New Group and Permissions
    7. Removing Permissions
    8. Default Permissions
  9. The Trac Wiki System
  10. WikiFormatting
    1. Cheat sheet
    2. Font Styles
    3. Headings
    4. Paragraphs
    5. Lists
    6. Definition Lists
    7. Preformatted Text
    8. Blockquotes
    9. Discussion Citations
    10. Tables
      1. Simple Tables
      2. Complex Tables
    11. Links
    12. Trac Links
    13. Setting Anchors
    14. Escaping Links, WikiPageNames and other Markup
    15. Images
    16. Macros
    17. Processors
    19. Miscellaneous
  11. The Trac Repository Browser
  12. The Trac Roadmap
    1. The Roadmap View
    2. The Milestone View
    3. Roadmap Administration
    4. iCalendar Support
  13. Trac Changeset Module
    1. Changeset Header
    2. Diff Views
    3. The Different Ways to Get a Diff
      1. Examining a Changeset
      2. Examining Differences Between Revisions
      3. Examining Differences Between Branches
      4. Checking the Last Change
  14. The Trac Ticket System
    1. Ticket Fields
    2. Changing and Commenting Tickets
    3. Default Values for Drop-Down Fields
    4. Hiding Fields and Adding Custom Fields
    5. Assign-to as Drop-Down List
    6. Preset Values for New Tickets
  15. Trac Reports
    1. Changing Sort Order
    2. Changing Report Numbering
    3. Navigating Tickets
    4. Alternative Download Formats
      1. Comma-delimited - CSV (Comma Separated Values)
      2. Tab-delimited
      3. RSS - XML Content Syndication
    5. Creating Custom Reports
    6. Ticket columns
    7. Advanced Reports: Dynamic Variables
      1. Using Variables in a Query
      2. Special/Constant Variables
    8. Advanced Reports: Custom Formatting
      1. Special Columns
      2. Automatically formatted columns
      3. Custom formatting columns
      4. Changing layout of report rows
      5. Reporting on custom fields
      6. A note about SQL rewriting
  16. Trac Ticket Queries
    1. Filters
    2. Navigating Tickets
    3. Saving Queries
      1. Using TracLinks
      2. Using the [[TicketQuery]] Macro
      3. Customizing the table format
        1. Full rows
      4. Query Language
  17. The Trac Timeline
    1. RSS Support
  18. Using RSS with Trac
    1. How to access RSS data
    2. Links
  19. Email Notification of Ticket Changes
    1. Receiving Notification Mails
      1. How to use your username to receive notification mails
    2. Configuring SMTP Notification
      1. Configuration Options
      2. Example Configuration (SMTP)
      3. Example Configuration (sendmail)
      4. Customizing the e-mail subject
      5. Customizing the e-mail content
    3. Sample Email
    4. Customizing e-mail content for MS Outlook
    5. Using GMail as the SMTP relay host
    6. Filtering notifications for one's own changes
    7. Troubleshooting
      1. Permission denied error
      2. Suspected spam error
      3. 501, 5.5.4 Invalid Address error

Table of Contents Macro


The TocMacro generates a table of contents for the current page or a set of pages.

If no arguments are given, a table of contents is generated for the current page, with the top-level title stripped:


To generate a table of contents for a set of pages, simply pass them as comma separated arguments to the TOC macro. This is the macro call for the table of contents visible on the right side of this page:

[[TOC(TracGuide, TracInstall, TracUpgrade, TracIni, TracAdmin, TracBackup, TracLogging,
TracPermissions, TracWiki, WikiFormatting, TracBrowser, TracRoadmap, TracChangeset,
TracTickets, TracReports, TracQuery, TracTimeline, TracRss, TracNotification)]]

A wildcard '*' can be used to fetch a sorted list of all pages starting with the preceding pagename stub (Since [2801]):

[[TOC(Trac*, WikiFormatting, WikiMacros)]]

For 'titleindex' argument, an empty pagelist will evaluate to all pages (Since [2801]):

[[TOC(titleindex, notitle, heading=All pages)]]

'sectionindex' allows to generate a title index for all pages in a given section of the wiki. A section is defined by wiki page name, using '/' as a section level delimiter (like directories in a file system). Giving '/' or '*' as the page name produces the same result as 'titleindex' (title of all pages). If a page name ends with a '/', only children of this page will be processed. Else the page given in the argument is also included, if it exists. For 'sectionindex' argument, an empty pagelist will evaluate to all page below the same parent as the current page:

[[TOC(sectionindex, notitle, heading=This section pages)]]

The following control arguments change the default behaviour of the TOC macro (Since [22]):

Argument Meaning
heading=<x> Override the default heading of "Table of Contents" or "Page Index" for titleindex.
noheading Suppress display of the heading.
depth=<n> Display headings of subsequent pages to a maximum depth of <n>.
inline Display TOC inline rather than as a side-bar.
sectionindex Only display the page name and title of each page for all pages in a given section. (Since [3417]).
titleindex Only display the page name and title of each page, similar to TitleIndex. (Since [37]).
notitle Supress display of page title (Since [2801]).

Bugs/Feature Requests

Existing bugs and feature requests are here. If you have any issues, create a new ticket.


Both 0.10 and 0.11/0.12 entries at Python Package Index (pypi) are not up-to-date with latest versions and dependencies. To install the most recent versions, use direct installation from source:

easy_install   # 0.10
easy_install   # 0.11 and 0.12

...or download / check out the source from repository (see below) and install it in usual manner.

Do not forget to enable the macro in trac.ini:

tractoc.* = enabled


Download the zipped source from here.

TocMacro requires that AnchorPatch be applied to 0.8 Trac. Trac 0.9 already includes this patch.


You can check out TocMacro from here using Subversion, or browse the source with Trac.


[[TOC(inline, heading=Trac Table of Contents, TracGuide, TracInstall, depth=2,
 TracLogging, depth=99, TracPermissions)]]

On the right you can see the TOC macro version of the default TracGuideToc macro.


Trac 0.12 (maybe earlier?) has the PageOutline macro built-in which can produce output identical to the simpler use cases for the TOC macro. For example, this is equivalent to the no-argument form of TOC:

[[PageOutline(2-5, Table of Contents, floated)]]

Change Log

[13602] by rjollos on 2014-01-21 07:53:51 Indicate in documentation when reverse argument was added. Refs #11513.
[13594] by rjollos on 2014-01-21 06:29:24 Added parameter for reversing the order in which the pages are sorted. Fixes #11513.

Patch by mitja.jez.

[13593] by rjollos on 2014-01-21 06:29:17 Added setup.cfg file.


Authors: athomas, jouvin, coderanger, cboos, osimons
Maintainer: osimons