]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'master' of git://ikiwiki.branchable.com
authorLouis <spalax@gresille.org>
Sat, 18 Feb 2017 21:56:06 +0000 (22:56 +0100)
committerLouis <spalax@gresille.org>
Sat, 18 Feb 2017 21:56:06 +0000 (22:56 +0100)
doc/forum/Questions_about_a_new_plugin/comment_5_1ea0be887d7490e0a9b4dc1c2fe886bd._comment [new file with mode: 0644]
doc/ikiwikiusers.mdwn
doc/plugins/contrib/pageversion.mdwn [new file with mode: 0644]
doc/plugins/contrib/redirect.mdwn [new file with mode: 0644]
doc/plugins/contrib/sidebar2/discussion.mdwn [new file with mode: 0644]
doc/plugins/contrib/verboserpc.mdwn [new file with mode: 0644]
doc/users/spalax.mdwn

diff --git a/doc/forum/Questions_about_a_new_plugin/comment_5_1ea0be887d7490e0a9b4dc1c2fe886bd._comment b/doc/forum/Questions_about_a_new_plugin/comment_5_1ea0be887d7490e0a9b4dc1c2fe886bd._comment
new file mode 100644 (file)
index 0000000..afd0aa4
--- /dev/null
@@ -0,0 +1,11 @@
+[[!comment format=mdwn
+ username="spalax"
+ subject="""Done!"""
+ date="2017-02-18T19:53:15Z"
+ content="""
+At last, I wrote this plugin. It was not on the top of my priority list, but I eventually did it.
+
+It is called [[plugins/contrib/pageversion]].
+
+Thank you very much for your advice: it is far better than what I had in mind before discussing it with you! :)
+"""]]
index 49e3442c0bcf8411998f9c66be1637cab45a9d2c..9f453f79af6d0d625adcddb578ff1751c316fc9e 100644 (file)
@@ -211,7 +211,7 @@ Personal sites and blogs
 * Kalle Söderman: [Seen Architecture](http://img.kalleswork.net), [Stockholm Project](http://stockholm.kalleswork.net) - Mainly -image galleries using the album and osm plugins with a customized html5 theme.
 * James Richardson's [wiki](https://jamestechnotes.com), [blog](https://jamesrichardson.name), and online [resume](https://resume.jamesrichardson.name).
 * [Amitai Schleier's site](https://schmonz.com/)
-* My ([[spalax]]) [professional website](http://paternault.fr)
+* [[spalax]]'s [professional website](http://paternault.fr)
 * [Aloodo Blog](http://blog.aloodo.org/)
 * Ninguém tem blog! - Restricted ikiwiki hosting
   * [Dissertos radicais](http://dissertosradicais.tem.blog.br)
diff --git a/doc/plugins/contrib/pageversion.mdwn b/doc/plugins/contrib/pageversion.mdwn
new file mode 100644 (file)
index 0000000..9793801
--- /dev/null
@@ -0,0 +1,89 @@
+[[!meta author="spalax"]]
+[[!template id=plugin name=pageversion author="[[Louis|spalax]]"]]
+
+This plugin makes it possible to manage different versions of the same page, allowing to:
+
+- make older/newer versions available;
+- highlight the latest version.
+
+[[!toc]]
+
+# Rationale
+
+On my personal website/blog, I publish articles which I sometimes update. Sometimes, I add a few lines of text with a ``Updated on DATE.`` message; other times, I rewrite the whole article. In this latter case, I want:
+
+- the main version of the article to be the latest one;
+- oldest versions still to be available;
+- the main list of my articles to list only the latest version of each article.
+
+# Example
+
+For instance, on my personal website, article [one](//paternault.fr/pedago/sismologie/20150110/) has been updated to [two](//paternault.fr/pedago/sismologie/20150819/).
+
+- They both contain the directive `\[[!versionof parent]]`, marking them as a version of the [main article](//paternault.fr/pedago/sismologie) (which happens to be their parent page).
+- On the [old article](//paternault.fr/pedago/sismologie/20150819/), links to the other articles (only one here) are available.
+- On the [page listing my articles](//paternault.fr/pedago), only the latest article appears.
+- The [main page](//paternault.fr/pedago/sismologie) lists all versions of this article, and redirects to the latest one.
+
+# List of directives and pagespecs
+
+Pages are marked as versions as other pages using tags (subtags of `_pageversion/*`). Directive ``\[[!versionof]]`` simply add the appropriate tag to the current page (thus, one can ignore this directive, but it makes things easier).
+
+Pages can be marked as versions of another page (e.g. ``foo/version1`` and ``foo/version2`` are versions of page ``foo``), or versions of an arbitrary abstract page (called *label* later). There is no conflict between them (that is, pages marked as a version of page ``foo`` and as a version of label ``foo`` are not a version of the same page).
+
+## Directive `versionof`
+
+Marks current page as a version of another page. Its main forms are:
+
+- `\[[!versionof name=foo]]` Mark current page as a version of page ``foo`` (page ``foo`` is searched using the same [[linking rules|ikiwiki/SubPage/LinkingRules]] as a [[ikiwiki/WikiLink]]).
+- `\[[!versionof label=bar]]` Mark current page as a version of some abstract object labelled ``bar``.
+
+It may be convenient to refer to some particular page. Thus, those alternative forms are also available:
+
+- `\[[!versionof name]]` Mark current page as a version of itself.
+- `\[[!versionof parent]]` Mark current page as a version of its parent page.
+
+## Template `otherversions`
+
+To add a list to the other versions of a page (both older and newer), a template is provided. It is called with:
+
+    \[[!template id=otherversions version=VERSION template=INLINETEMPLATE]]
+
+Where:
+
+- *(Required)* Pages that are a version of `VERSION` are listed (for instance ``\[[!template id=otherversions version=name=foo]]``).
+- *(Optional)* Template `INLINETEMPLATE` is used (instead of the default `otherversionpage` template) in the [[ikiwiki/directive/inline]] directive listing the other pages.
+
+## Pagespec `versionof`
+
+A pagespec can match pages marked as a version of something using the pagespec `versionof`. It accepts the same arguments as the arguments as the ``versionof`` directive, that is:
+
+- `versionof(name=foo)`: Match pages which are a version of page ``foo``.
+- `versionof(name)`: Match pages which are a version of the current page.
+- `versionof(parent)`: Match pages which are a version of the parent page.
+- `versionof(label=bar)`: Match pages which are a version of some abstract object labelled ``bar``.
+
+Moreover, it takes one additional argument:
+
+- `versionof(any)`: Match pages which are a version of anything.
+
+## Pagespec `latestversion`
+
+An additional pagespec `latestversion` is provided. It accepts the same arguments as the `versionof` pagespec (that is:
+`latestversion(name=foo)`,
+`latestversion(name)`,
+`latestversion(parent)`,
+`latestversion(label=bar)`,
+`latestversion(any)`) but only the most recent page is matched.
+
+## Pagespec `latest_tagged`
+
+As a side effect, this plugin also provides the `latest_tagged(TAG)` pagespec. It matches one single page: the most recent page tagged with the given tag.
+
+## Directive `redirect`
+
+Directive ``\[[!redirect]]`` (from the [[redirect]] plugin) can be used together with this package. For instance, a page containing the directive ``\[[!redirect pages="versionof(page)"]]`` will redirect to the most recent page marked as a version of the current page.
+
+# Download and Install
+
+Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/PageVersion]].
diff --git a/doc/plugins/contrib/redirect.mdwn b/doc/plugins/contrib/redirect.mdwn
new file mode 100644 (file)
index 0000000..4bf315a
--- /dev/null
@@ -0,0 +1,35 @@
+[[!meta author="spalax"]]
+[[!template id=plugin name=redirect author="[[Louis|spalax]]"]]
+
+This plugin provides a [[ikiwiki/directive/redirect]] [[ikiwiki/directive]].
+
+Using this, you can cause a page to redirect to another page (something similar to the ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta]] plugin.
+
+[[!toc]]
+
+# Directive
+
+It accepts options ``pages``, ``skip``, ``sort``, ``reverse``, which have the same meaning as they have in the [[inline|http://ikiwiki.info/ikiwiki/directive/inline/]] directive. It builds a list of pages using those arguments, and redirect the page to the first page of this list.
+
+It also renders a text *If you are not redirected automatically, follow \[[this link]].* This text can be customized by changing the template `redirect.tmpl`, which accepts a single variable ``TARGETPAGE``.
+
+# Example
+
+To have a page ``latest.html`` redirect to your latest blog post, have the following line into ``latest.mdwn``:
+
+    \[[!redirect pages="blog/* and !blog/*"]]
+
+# Setup
+
+This directive accepts no setup options.
+
+# Differences with the ``meta`` plugin
+
+* This directive is better than the ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta/]] plugin because it can redirect to (the first page of) a pagespec, meaning things like *"redirect to my latest blog post"*.
+* The ``redir`` option of the [[meta|http://ikiwiki.info/ikiwiki/directive/meta]] plugin is better than this directive because:
+  * it can redirect to an anchor ``\[[!meta redir="foo#bar"]]``;
+  * it can redirect to an external page ``\[[!meta redir="http://example.com"]]``.
+
+# Download and install
+
+Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/Redirect]].
diff --git a/doc/plugins/contrib/sidebar2/discussion.mdwn b/doc/plugins/contrib/sidebar2/discussion.mdwn
new file mode 100644 (file)
index 0000000..c3989e7
--- /dev/null
@@ -0,0 +1,5 @@
+More than four years after having written and published this plugin, I kind of regret its name. It should have been called `manybars`, `multibars` or anything like that, but by calling it `sidebar2`, I hijacked the [[plugins/sidebar]] name, preventing the original author to update its own plugin.
+
+Anyway, it is too late to change the name back. I hope I did not offend anyone by doing so… Sorry about this.
+
+-- [[Louis|spalax]]
diff --git a/doc/plugins/contrib/verboserpc.mdwn b/doc/plugins/contrib/verboserpc.mdwn
new file mode 100644 (file)
index 0000000..09446fe
--- /dev/null
@@ -0,0 +1,83 @@
+[[!meta author="spalax"]]
+[[!template id=plugin name=verboserpc author="[[Louis|spalax]]"]]
+
+Debugging [external plugins](//ikiwiki.info/plugins/write/external/) is a pain, as soon as RPC is involved… This kind-of plugin tries to make it a little bit less painful.
+
+It acts as a proxy between Ikiwiki and the plugin (which, for the record, is an executable program communicating with Ikiwiki using [XML RPC](http://www.xmlrpc.com/) on standard input/output), and logs everithing on standard error.
+
+[[!toc]]
+
+# Example
+
+A sample output of a wiki compilation is shown below.
+
+    $ ikiwiki --setup wiki.setup --refresh --verbose
+    -> <?xml version="1.0" encoding="utf-8"?><methodCall><methodName>import</methodName><params></params></methodCall>
+    <- <?xml version='1.0'?>
+    <- <methodCall>
+    <- <methodName>hook</methodName>
+    <- <params>
+    <- <param>
+    <- <value><string>call</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>getsetup</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>type</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>getsetup</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>id</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>foo</string></value>
+    <- </param>
+    <- <param>
+    <- <value><string>last</string></value>
+    <- </param>
+    <- <param>
+    <- <value><boolean>0</boolean></value>
+    <- </param>
+    <- </params>
+    <- </methodCall>
+    -> <?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><string>1</string></value></param></params></methodResponse>
+    <- <?xml version='1.0'?>
+    <- <methodResponse>
+    <- <params>
+    <- <param>
+    <- <value><struct>
+    <- <member>
+    <- <name>null</name>
+    <- <value><string></string></value>
+    <- </member>
+    <- </struct></value>
+    <- </param>
+    <- </params>
+    <- </methodResponse>
+    rebuilding wiki..
+    scanning index.mdwn
+    building index.mdwn
+    done
+
+# Enabling the plugin
+
+Let us say you want to debug a plugin `foo`, located somewhere in your [`libdir`](https://ikiwiki.info/plugins/install/).
+
+1. Do not not enable plugin `foo` in the ikiwiki setup file.
+2. Create a symbolic link named `foo.verboserpc` in one of your `libdir`, linking to the `verboserpc` plugin.
+3. In your setup file, enable plugin `foo.verboserpc`.
+
+That's it. When called, the `verboserpc` plugin will be called as `foo.verboserpc`, and will run program `foo`, while transmitting (to Ikiwiki and `foo`) and logging (to standard error) any input/output.
+
+# Does it work?
+
+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 [`proxy`](http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD), it might be useless, since this proxy already have an option to log RPC calls (by giving `debug_fn=sys.stderr.write` as an option to the constructor of [`IkiWikiProcedureProxy`](http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=plugins/proxy.py;h=b61eb466c8d47ef839fc24e5d0ba54be3a9b23fa;hb=HEAD#l217)).
+
+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…
+
+# Download and install
+
+Code and documentation can be found here : [[https://atelier.gresille.org/projects/gresille-ikiwiki/wiki/VerboseRPC]].
index d9e9c5fc93369717e7e5fe22afc7b02505fe778c..2010fdef180e8e2149e6ce3ba5ef4fba8039eeac 100644 (file)
@@ -12,9 +12,8 @@ I wrote and maintain a few plugins, which are available here: [[https://atelier.
 
 I have a few things in mind. Their status is something between *I will implement it someday* to *maybe someone could need this* or *I will need it if I implement this killer website I have in mind*.
 
-* [[plugins/contrib/htaccessmanager]]: Create a cgi page to manage a htaccess file.
-* [[forum/Questions_about_a_new_plugin]]
-
+* [[plugins/contrib/usermanager]]: Create a cgi page to manage users (add/remove users, give/remove administrative priviledge to users, change password, etc.
+* [[plugins/contrib/htaccess]]: Have an [[htacess|//httpd.apache.org/docs/current/howto/htaccess.html]] file to be automatically updated each time an user is added/deleted, or its password is changed).
 
 # Contact