From 36094d76742872e3a894a15775832e8ba8261bbf Mon Sep 17 00:00:00 2001 From: "http://kaizer.se/" Date: Wed, 16 Sep 2009 23:34:27 -0400 Subject: Resolving WikiLinks in rst -- WIP --- doc/plugins/rst/discussion.mdwn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'doc/plugins/rst') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index 9909784d5..af96edc6a 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -41,3 +41,33 @@ such since they are inline elements in the text.. But images work fine in rst's syntax.. what about using rst syntax for wikilinks as well? Is it possible to inject something into the parser to turn unmached links ``WikiLink`_` into ikiwiki links? --ulrik + +------ + +Resolving WikiLinks in rst +========================== + +I wanted to look into if we can hook into rst and influence how links are resolved. +It turns out it is possible, and I have a working WIP for the rst plugin that does this. + +My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: http://kaizer.se/wiki/rst.py +*Warning, written in the middle of the night just to test if it works!* + +It basically matches normal rst links just like ikiwiki would match a wikilink +if it existed. +I can't read perl so I haven't found out so much. The plugin successfully registers backlinks using +`proxy.rpc('add_link', on_page, bestlink)` (since the destination page will be rebuilt to update), +but the backlinks don't show up. + +I converted one of my pages to rst: + +Before: http://kaizer.se/wiki/kupfer-mdwn +After: http://kaizer.se/wiki/kupfer-rst + +I need help on a couple of points + +* How to fix the backlinks with `add_link`? +* How to generate NonExistingLinks using the plugin API? +* Can we include this in ikiwiki's rst if it is not too hairy? + +--ulrik -- cgit v1.2.3 From 5946a54ec793fa89bdb9a116d74684a93a9696bd Mon Sep 17 00:00:00 2001 From: "http://kaizer.se/" Date: Thu, 17 Sep 2009 11:33:12 -0400 Subject: see Resolve native reStructuredText links to ikiwiki pages --- doc/plugins/rst/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins/rst') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index af96edc6a..38fbed6d6 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -50,8 +50,8 @@ Resolving WikiLinks in rst I wanted to look into if we can hook into rst and influence how links are resolved. It turns out it is possible, and I have a working WIP for the rst plugin that does this. -My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: http://kaizer.se/wiki/rst.py -*Warning, written in the middle of the night just to test if it works!* +My work in progress for `/usr/lib/ikiwiki/plugins/rst` is here: +[[todo/Resolve native reStructuredText links to ikiwiki pages]] It basically matches normal rst links just like ikiwiki would match a wikilink if it existed. -- cgit v1.2.3 From 99f4056b989acfacf3590dbaec9a505a31420f88 Mon Sep 17 00:00:00 2001 From: "http://weakish.myopenid.com/" Date: Fri, 9 Jul 2010 11:44:59 +0000 Subject: minor markup syntax --- doc/plugins/rst/discussion.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/plugins/rst') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index 38fbed6d6..3c3b03275 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -61,8 +61,8 @@ but the backlinks don't show up. I converted one of my pages to rst: -Before: http://kaizer.se/wiki/kupfer-mdwn -After: http://kaizer.se/wiki/kupfer-rst +Before: +After: I need help on a couple of points -- cgit v1.2.3 From 8a0b2d07d3aa1a833e9b83ce9e2a9b2a6f76fb9b Mon Sep 17 00:00:00 2001 From: "http://weakish.myopenid.com/" Date: Fri, 13 Aug 2010 16:13:06 +0000 Subject: possible to use place holders? --- doc/plugins/rst/discussion.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/plugins/rst') diff --git a/doc/plugins/rst/discussion.mdwn b/doc/plugins/rst/discussion.mdwn index 3c3b03275..c84a6218e 100644 --- a/doc/plugins/rst/discussion.mdwn +++ b/doc/plugins/rst/discussion.mdwn @@ -71,3 +71,11 @@ I need help on a couple of points * Can we include this in ikiwiki's rst if it is not too hairy? --ulrik + + +---- + +> The main problem with more sophisticated RST support is that ikiwiki turns +preprocessor directives into raw HTML and reST hates inline HTML. + +Is it possible for ikiwiki to store preprocessor directives in memory, and replace them with place holders, then do the rst process. After the rst processing, process the preprocessor directives and replace place holders. --[[weakish]] -- cgit v1.2.3