DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:grapher

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 Graphviz or in GEXF format as understood by Gephi.

Download and Installation

Download the grapher.php file and place it in the bin directory of your DokuWiki installation.

Usage

Usage: grapher.php <options> [<namespaces>]

    Creates a graph representation of pages and media files and how they
    are interlinked

    OPTIONS
        -h, --help                show this help and exit
        -d, --depth <num>         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 <file>       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
tips/grapher.txt · Last modified: 2016-02-03 15:09 by Aleksandr

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki