GraphVizSitemap

Summary: Provide a GraphViz format for sitemap
Version: 2009-05-08
Prerequisites:
Status: alpha
Maintainer: Ed Wildgoose?

Questions answered by this recipe

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.

Description

Produce graphviz output for a site map. Based on an initial implementation by Peter Bowers

The output is currently just the raw graphviz commands and so you will need to run them through graphviz to generate something like a PDF and then stare at the PDF

Installation

include_once("$FarmD/cookbook/graphvizsitemap.php");

Notes

Go to the page you want to start the map from. Add ?action=graphviz to the URL in the address bar. Copy/paste the resulting output.

You can optionally set a ?timeout=120 or even a larger timeout if desired (append it to the URL in the address bar).

For instance, if I am starting my sitemap with Mygroup.Mypage with a 120-second timeout then my URL might look like this:

http://www.example.com/pmwiki/pmwiki.php?n=Mygroup.Mypage?action=graphviz?timeout=120

The output is currently just the raw graphviz commands and so you will need to run them through graphviz to generate something like a PDF and then stare at the PDF

I will suggest a PDF is probably the best output option (plus a good PDF viewer with a zoom button!) because likely your map will take a good bit of scrolling and zooming to get around...!

It's quite an interesting experience, but you might want to experiment with hacking the code to specifically exclude certain chunks of the site if this helps get a nice looking final output.

Ideas for improvement

This is just a skeleton solution at present and needs improving:

- Examine the recipe: PmGraphViz and specifically the last few lines of PHP run graphviz on the dot file and generate the result file - integrate these lines with this recipe and have the output actually return a downloadable PDF file - Perhaps revise this recipe to work on the output of a search query (ie it's a pmwiki search format function). This would allow more customisation of the pages to include in the output - Highlight internal/external/broken links - Add external links? Right now we use an optimisation to avoid parsing each page which only returns the internal page links. Could generate the HTML for each page and parse that for a more robust solution which gets internal AND external links? - Test for bugs due to the optimisation used in this recipe (we examine $page['targets'] which should be maintained by pmwiki...?)

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

  • 2009-05-08 Initial release.

See Also

PmGraphViz

eventually something like

(:pmgraphviz -- [=
(:include Group/Page?action=graphwiz:)
=]
:)

could be use to generate and render the map on the fly Utopiah

Contributors

Ed Wildgoose Peter Bowers

Comments

See discussion at GraphVizSitemap-Talk

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.