2008-07-17 @ 12:21AM
The XHTML + javascript has been replaced by a php page.
2008-07-16 @ 12:00AM
To validating an xhtml1-transitional page, javascript code included in a page (and only one included in) is considered as PCDATA thus processed by the validator, so the code does not contain special characters like ampersand: the usage of general entities and/or url-encoding for url is mandatory.
See http://javascript.about.com/library/blxhtml.htm.
Within my javascript code to retrieve a DokuWiki page for building the content of my homepage, I use an XMLHttpRequest javascript object with the export in xhtml DokuWiki functionality.
For example http://njames.trevize.net/wiki/doku.php?id=homepage&do=export_xhtml, the problem is: this URL contains an ampersand and DokuWiki does not like encoded ampersand in URL.
Note that I know it's not really a problem because you can locating the javascript in a separate .js file, and adding a <script src='…'> in the page's header and it's valid because the validator does not explore separate .js file.
If you don't want to create a separate .js file: DokuWiki seems have problems with the URL-encoded character and with the general character entities for the ampersand:
'http://nicolas.trevize.net/wiki/doku.php?id=homepage%26do=export_xhtml' seems don't work. nor 'http://nicolas.trevize.net/wiki/doku.php?id=homepage'+&+'do=export_xhtml' or 'http://nicolas.trevize.net/wiki/doku.php?id=homepage'+&+'do=export_xhtml'
The problem is that to validating xhtml1-transitional, this javascript code located in the page must escape the ampersand character used in the URL and DokuWiki accept any of the three (using URL-encoded or general entities).
The solution is to use:
<script type="text/javascript"> <![CDATA[ // content of your Javascript goes here ]]> </script>
2008-07-15 @ 8:15PM
From today the content of the homepage is the parsed content of a DokuWiki page of my wiki.
This is made with the DokuWiki's export_xhtmlbody functionality and a short javascript code for parsing the wiki page content.
Note that the javascript code use an XMLHttpRequest object, and it could work cause the wiki is located in the same internet domain, in the other case, writing a php page to retrieve the content could be a solution).
To make the parsing easier, I've decided a quick solution, a very light modification of ~dokuwiki/inc/actions.php: adding into the act_export($act) (line 360 of ~dokuwiki/inc/actions, DokuWiki version 2008-05-05) PHP function some HTML comments that I can use like flags.
For example for the XHTML export code:
tpl_toc();
ptln('<!-- wikipage start -->');
echo $html;
ptln('<!-- wikipage stop -->');
In reality these HTML comments are written in the web rendering but not written while exporting.
For the export functionalities, you can use different parameter:
See http://wiki.splitbrain.org/wiki:export.
I know using javascript to do this is a little quirk, and when the content will be important this solution could be very very slow… so I'll write a php page for the parsing in the next days.
2008-07-14 @ 6:32PM
I publish the website today, after a very long time during where is only a post-it noticing that it was “under construction”.
I've written a theme from Wordpress called SimpleCafe4Wordpress@trevize.net, started with the Simplr theme for Wordpress by Scott Allan Wallick but completely modified/rewritten now.
And I've written also a theme for DokuWiki called SimpleCafe4DokuWiki@trevize.net, using the DokuWiki default theme like basis.
Regards to DokuWiki: a very interesting link is http://www.middleware.vt.edu/doku.php?id=middleware:dokuwiki.
But this trick use a version dated of 2006, it's a bit out of date… however, the 'printable version' button of a wiki page and the usage of phpCAS could be very interesting…
The 'printable version' could be very interesting cause I want to use some wiki pages to store the content of the homepage (and thus to display the homepage I might retrieve the wiki page, parse it, and insert it in the homepage), so I need a way to retrieve the content (and only the content) a DokuWiki page without DokuWiki's style and page formatting.
Another way to do this, is to use the XHTML export functionality of DokuWiki.
2008-07-14 @ 5:57PM