]> sipb.mit.edu Git - ikiwiki.git/commitdiff
size limits
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 7 Sep 2006 06:58:27 +0000 (06:58 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 7 Sep 2006 06:58:27 +0000 (06:58 +0000)
IkiWiki/Plugin/linkmap.pm
doc/plugins/linkmap.mdwn

index 2c92784c2a5e05b1892daf041845a28cf5acc883..4ac11a10a4716dbc8233e1d45673d900d63b6ebf 100644 (file)
@@ -18,6 +18,7 @@ my %maps;
 
 sub preprocess (@) { #{{{
        my %params=@_;
 
 sub preprocess (@) { #{{{
        my %params=@_;
+
        $params{pages}="*" unless defined $params{pages};
        
        # Needs to update whenever a page is added or removed, so
        $params{pages}="*" unless defined $params{pages};
        
        # Needs to update whenever a page is added or removed, so
@@ -83,6 +84,8 @@ sub genmap ($) { #{{{
        print OUT "digraph linkmap$mapnum {\n";
        print OUT "concentrate=true;\n";
        print OUT "charset=\"utf-8\";\n";
        print OUT "digraph linkmap$mapnum {\n";
        print OUT "concentrate=true;\n";
        print OUT "charset=\"utf-8\";\n";
+       print OUT "ratio=compress;\nsize=\"".($params{width}+0).", ".($params{height}+0)."\";\n"
+               if defined $params{width} and defined $params{height};
        foreach my $item (keys %mapitems) {
                print OUT "\"$item\" [shape=box,href=\"$mapitems{$item}\"];\n";
                foreach my $link (map { IkiWiki::bestlink($item, $_) } @{$IkiWiki::links{$item}}) {
        foreach my $item (keys %mapitems) {
                print OUT "\"$item\" [shape=box,href=\"$mapitems{$item}\"];\n";
                foreach my $link (map { IkiWiki::bestlink($item, $_) } @{$IkiWiki::links{$item}}) {
index fc754f9fb9de09466ebc706bb5de4124fc2d66c8..e0eda92893a53a616f96a673666611525df38ab4 100644 (file)
@@ -14,6 +14,14 @@ the map can become very large, unweildy, and complicated. Also, the map is
 rebuilt whenever one of the mapped pages is changed, which can make the
 wiki a bit slow.
 
 rebuilt whenever one of the mapped pages is changed, which can make the
 wiki a bit slow.
 
+Here are descriptions of all the supported parameters to the `linkmap`
+directive:
+
+* `pages` - A [[PageSpec]] of the pages to map.
+* `height`, `width` - Limit the size of the map to a given height and width,
+  in inches. Both must be specified for the limiting to take effect, otherwise
+  the map's size is not limited.
+
 This plugin is included in ikiwiki, but is not enabled by default.
 
 If this plugin is enabled, here is a link map of the index page and all
 This plugin is included in ikiwiki, but is not enabled by default.
 
 If this plugin is enabled, here is a link map of the index page and all