From 89e0669692eaf597596f1da36e8c385330c594ff Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 4 May 2010 16:39:50 +0100 Subject: split two graphviz bugs from one page; undo one of them --- ...Problems_with_graphviz.pm_plug-in_previews.mdwn | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn (limited to 'doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn') diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn new file mode 100644 index 000000000..3b77a48bb --- /dev/null +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -0,0 +1,46 @@ +(split from [[Problems_with_graphviz.pm_plug-in]]) + +[graphviz] generates image URLs relative to the page being rendered, which means the URLs wont work when previewing a graph from the CGI script. + +>> Here is an updated patch againt ikiwiki-2.5: + +>>> Applied, thanks. --[[Joey]] + + --- IkiWiki/Plugin/graphviz.pm.orig 2007-07-27 11:35:05.000000000 +0200 + +++ IkiWiki/Plugin/graphviz.pm 2007-07-27 11:36:02.000000000 +0200 + @@ -69,7 +69,12 @@ sub render_graph (\%) { + } + } + + - return "\n"; + + if ($params{preview}) { + + return "\n"; + + } + + else { + + return "\n"; + + } + } + + sub graph (@) { + + +>> --[[HenrikBrixAndersen]] + +>>> Despite this patch I am still experiencing the problem. Normal page source for a graph contains: + + <div id="content"> + <p><img src="./graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + + </div> + +>>> preview contains + + <div id="preview"> + <p><img src="./demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> + + </div> + +>>> I don't quite understand why, this makes sense from the CGI path (in my +>>> case from the root of the site). The browsers appear to be trying to fetch +>>> `/demo/diagrams/demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png` +>>> (i.e., prepending the required relpath twice). -- [[Jon]] -- cgit v1.2.3 From 7060a818c108de5b5e2b1c2aa617f5e926bd5f86 Mon Sep 17 00:00:00 2001 From: Jon Dowland Date: Tue, 4 May 2010 16:43:22 +0100 Subject: un-escape escaped chevrons --- doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn') diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn index 3b77a48bb..283a6ef08 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -28,17 +28,17 @@ >>> Despite this patch I am still experiencing the problem. Normal page source for a graph contains: - <div id="content"> - <p><img src="./graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> +
+

- </div> +
>>> preview contains - <div id="preview"> - <p><img src="./demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png" /></p> +
+

- </div> +
>>> I don't quite understand why, this makes sense from the CGI path (in my >>> case from the root of the site). The browsers appear to be trying to fetch -- cgit v1.2.3 From ab575a4b6985d38969069757bb374aa8f1013019 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 4 May 2010 16:54:58 -0400 Subject: graphviz: Fix display of preexisting images in preview mode. --- IkiWiki/Plugin/graphviz.pm | 7 +------ debian/changelog | 1 + doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn | 8 ++++++++ 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn') diff --git a/IkiWiki/Plugin/graphviz.pm b/IkiWiki/Plugin/graphviz.pm index bec122076..c91c92fec 100644 --- a/IkiWiki/Plugin/graphviz.pm +++ b/IkiWiki/Plugin/graphviz.pm @@ -79,12 +79,7 @@ sub render_graph (\%) { } } - if ($params{preview}) { - return "\n"; - } - else { - return "\n"; - } + return "\n"; } sub graph (@) { diff --git a/debian/changelog b/debian/changelog index 9fb9607a3..31deaf9aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ikiwiki (3.20100502) UNRELEASED; urgency=low (COMMENTSLINK and DISCUSSIONLINK could be folded into this, but are kept separate for now to avoid breaking modified templates.) * websetup: Only display Setup button on admins' preferences page. + * graphviz: Fix display of preexisting images in preview mode. -- Joey Hess Sun, 02 May 2010 13:22:50 -0400 diff --git a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn index 283a6ef08..c77bbeeaf 100644 --- a/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn +++ b/doc/bugs/Problems_with_graphviz.pm_plug-in_previews.mdwn @@ -44,3 +44,11 @@ >>> case from the root of the site). The browsers appear to be trying to fetch >>> `/demo/diagrams/demo/diagrams/graph-c9fd2a197322feb417bdedbca5e99f5aa65b3f06.png` >>> (i.e., prepending the required relpath twice). -- [[Jon]] + +>>>> Yeah, that patch may have been right once, but it's wrong now; +>>>> preview mode uses `` to make urls work the same as they would +>>>> when viewing the html page. +>>>> +>>>> Perhaps this was not noticed for a while while because it only +>>>> shows up if previewing an *unchanged* graph on a page that has already +>>>> been built before. Fixed now. [[done]] --[[Joey]] -- cgit v1.2.3