Question

Hi guys : Is there a way to improve trac wiki quality using a plugin that deals with artifacts like for obsolete pages, or pages that refer to code which doesn't exist anymore, pages that are unlinked, or pages which have a low update-rate ? I think there might be several heuristics which could be used to prevent wiki-rot :

  • Number of recent edits
  • Number of recent views
  • Wether or not a page links to a source file
  • Wether or not a wiki page's last update is < or > the source files it links to
  • Wether entire directories in the wiki have been used/edited/ignored over the last "n" days

etc. etc. etc.

If nothing else, just these metrics alone would be useful for each page and each directory from an administrative standpoint.

Was it helpful?

Solution

I don't know of an existing plugin that does this, but everything you mentioned certainly sounds do-able in one way or another.

You can use the trac-admin CLI command to get a list of wiki pages and to dump the contents of a particular wiki page (as plain text) to a file or stdout. Using this, you can write a script that reads in all of the wiki pages, parses the content for links, and generates a graph of which pages link to what. This should pinpoint "orphans" (pages that aren't linked to), pages that link to source files, and pages that link to external resources. Running external links through something like wget can help you identify broken links.

To access last-edited dates, you'll want to query Trac's database. The query you'll need will depend on the particular database type that you're using. For playing with the database in a (relatively) safe and easy manner, I find the WikiTableMacro and TracSql plugins quite useful.

The hardest feature in your question to implement would be the one regarding page views. I don't think that Trac keeps track of page views, you'll probably have to parse your web server's log for that sort of information.

OTHER TIPS

How about these:

BadLinksPlugin: This plugin logs bad local links found in wiki content. It's a quite new one, just deals with dangling links, but any bad links as I see from source code. This is at least one building block to your solution request.

VisitCounterMacro: Macro displays how many times was wiki page displayed. This is a rather old one. You'll get just the statistic per page while an administrative view is missing, but this could be built rather easily, i.e. like a custom PageIndex.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top