====== Create Graphs from Link Relations ====== This command line tool allows you to create graph representations of pages and media files in one or more given namespaces. Links between the pages and media files are represented as edges of the graph. Graphs are exported either in ''dot'' format as understood by [[http://www.graphviz.org/|Graphviz]] or in ''GEXF'' format as understood by [[http://gephi.org/|Gephi]]. ===== Download and Installation ===== Download the [[https://github.com/splitbrain/dokuwiki-grapher/raw/master/grapher.php|grapher.php]] file and place it in the ''bin'' directory of your DokuWiki installation. ===== Usage ===== Usage: grapher.php [] Creates a graph representation of pages and media files and how they are interlinked OPTIONS -h, --help show this help and exit -d, --depth recursion depth. 0 for all. default: 1 -f, --format (dot|gexf) output format, default: dot -m, --media (ns|all|none) how to handle media files. default: ns -o, --output where to store the output. default: STDOUT NAMESPACES Give all wiki namespaces you want to have graphed. If no namespace is given, the root namespace is assumed. ==== Recursion Handling (--depth) ==== By default the script will not recurse into deeper namespaces. Eg. if you say namespace ''foo'', namespace ''foo:bar'' will not be included. When setting ''--depth 0'' all lower namespaces will be included. Using a number will define the maximum recursion level. ==== Media Handling (--media) ==== There are three different ways how media files can be handled: * ''ns'' - This is the default. All media files in the given namespace(s) will be added as nodes. When pages use the images, an edge will be created. This is the best mode to spot orphaned images and files. * ''all'' - This will add all images that are linked from the pages found in the given namespaces. Images are added as nodes even if they are from different namespaces. But only linked images are added, no orphans. * ''none'' - No images will be added at all