Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > d8544620e4ac7bee48ddb48c85d55709 > files > 318

ikiwiki-3.20190228-1.mga7.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>verboserpc (third party plugin)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />






<meta name="author" content="spalax" />



</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../plugins.html">plugins</a>/ 

<a href="../contrib.html">contrib</a>/ 

</span>
<span class="title">
verboserpc (third party plugin)

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p><span class="infobox">
Plugin: verboserpc<br />
Author: <span class="createlink">Louis</span><br />
Included in ikiwiki: no<br />
Enabled by default: no<br />
Included in <a href="../goodstuff.html">goodstuff</a>: no<br />
Currently enabled: no<br />
</span></p>

<p>Debugging <a href="//ikiwiki.info/plugins/write/external/">external plugins</a> is a pain, as soon as RPC is involved… This kind-of plugin tries to make it a little bit less painful.</p>

<p>It acts as a proxy between Ikiwiki and the plugin (which, for the record, is an executable program communicating with Ikiwiki using <a href="http://www.xmlrpc.com/">XML RPC</a> on standard input/output), and logs everithing on standard error.</p>

<div class="toc">
<ol>
	<li class="L1"><a href="#index1h1">Example</a>
	</li>
	<li class="L1"><a href="#index2h1">Enabling the plugin</a>
	</li>
	<li class="L1"><a href="#index3h1">Does it work?</a>
	</li>
	<li class="L1"><a href="#index4h1">Download and install</a>
	</li>
</ol>
</div>

<h1><a name="index1h1"></a>Example</h1>

<p>A sample output of a wiki compilation is shown below.</p>

<pre><code>&#036; ikiwiki --setup wiki.setup --refresh --verbose
-&gt; &lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;methodCall&gt;&lt;methodName&gt;import&lt;/methodName&gt;&lt;params&gt;&lt;/params&gt;&lt;/methodCall&gt;
&lt;- &lt;?xml version='1.0'?&gt;
&lt;- &lt;methodCall&gt;
&lt;- &lt;methodName&gt;hook&lt;/methodName&gt;
&lt;- &lt;params&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;call&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;getsetup&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;type&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;getsetup&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;id&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;foo&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;string&gt;last&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;boolean&gt;0&lt;/boolean&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;/params&gt;
&lt;- &lt;/methodCall&gt;
-&gt; &lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;methodResponse&gt;&lt;params&gt;&lt;param&gt;&lt;value&gt;&lt;string&gt;1&lt;/string&gt;&lt;/value&gt;&lt;/param&gt;&lt;/params&gt;&lt;/methodResponse&gt;
&lt;- &lt;?xml version='1.0'?&gt;
&lt;- &lt;methodResponse&gt;
&lt;- &lt;params&gt;
&lt;- &lt;param&gt;
&lt;- &lt;value&gt;&lt;struct&gt;
&lt;- &lt;member&gt;
&lt;- &lt;name&gt;null&lt;/name&gt;
&lt;- &lt;value&gt;&lt;string&gt;&lt;/string&gt;&lt;/value&gt;
&lt;- &lt;/member&gt;
&lt;- &lt;/struct&gt;&lt;/value&gt;
&lt;- &lt;/param&gt;
&lt;- &lt;/params&gt;
&lt;- &lt;/methodResponse&gt;
rebuilding wiki..
scanning index.mdwn
building index.mdwn
done
</code></pre>

<h1><a name="index2h1"></a>Enabling the plugin</h1>

<p>Let us say you want to debug a plugin <code>foo</code>, located somewhere in your <a href="https://ikiwiki.info/plugins/install/"><code>libdir</code></a>.</p>

<ol>
<li>Do not not enable plugin <code>foo</code> in the ikiwiki setup file.</li>
<li>Create a symbolic link named <code>foo.verboserpc</code> in one of your <code>libdir</code>, linking to the <code>verboserpc</code> plugin.</li>
<li>In your setup file, enable plugin <code>foo.verboserpc</code>.</li>
</ol>

<p>That's it. When called, the <code>verboserpc</code> plugin will be called as <code>foo.verboserpc</code>, and will run program <code>foo</code>, while transmitting (to Ikiwiki and <code>foo</code>) and logging (to standard error) any input/output.</p>

<h1><a name="index3h1"></a>Does it work?</h1>

<p>Well… External plugins are still a pain to debug, even with this tool. If your plugin is written using python, and you are using the <a href="http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD"><code>proxy</code></a>, it might be useless, since this proxy already have an option to log RPC calls (by giving <code>debug_fn=sys.stderr.write</code> as an option to the constructor of <a href="http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD#l217"><code>IkiWikiProcedureProxy</code></a>).</p>

<p>I am not sure that this plugin is the solution to the problem of debugging external plugins. I am still publishing it here, hoping that someone might improve it into something useful…</p>

<h1><a name="index4h1"></a>Download and install</h1>

<p>Code and documentation can be found here : <a href="https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/VerboseRPC">https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/VerboseRPC</a>.</p>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">











<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>