From c1a2df4fc10e9d15e7dd9fc7acf1e14420554f63 Mon Sep 17 00:00:00 2001 From: "http://jblevins.org/" Date: Sat, 18 Oct 2008 16:53:28 -0400 Subject: Tracking some issues on my user page --- doc/users/jasonblevins.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'doc/users/jasonblevins.mdwn') diff --git a/doc/users/jasonblevins.mdwn b/doc/users/jasonblevins.mdwn index 52420f7c9..a07d5d14b 100644 --- a/doc/users/jasonblevins.mdwn +++ b/doc/users/jasonblevins.mdwn @@ -1,3 +1,5 @@ +[[!meta title="Jason Blevins"]] + I'm currently hosting a private ikiwiki for keeping research notes which, with some patches and a (currently unreleased) plugin, will convert inline LaTeX expressions to MathML. I'm working towards a @@ -9,3 +11,12 @@ we're at it, why not SVG). My (also MathML-enabled) homepage: (still using Blosxom...maybe one day I'll convert it to ikiwiki...) + +Current issues of interest: + + * [[bugs/recentchanges_feed_links]] + * [[bugs/HTML_inlined_into_Atom_not_necessarily_well-formed]] + * [[plugins/toc/discussion]] + * [[todo/BibTeX]] + * [[todo/svg]] + * [[todo/Option_to_make_title_an_h1?]] -- cgit v1.2.3 From 53292eea63726309707576eab8c6893a029e260c Mon Sep 17 00:00:00 2001 From: "http://jblevins.org/" Date: Tue, 21 Oct 2008 11:43:37 -0400 Subject: Notes on MathML and SVG support --- doc/users/jasonblevins.mdwn | 59 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 4 deletions(-) (limited to 'doc/users/jasonblevins.mdwn') diff --git a/doc/users/jasonblevins.mdwn b/doc/users/jasonblevins.mdwn index a07d5d14b..8e51e7f7c 100644 --- a/doc/users/jasonblevins.mdwn +++ b/doc/users/jasonblevins.mdwn @@ -5,14 +5,18 @@ which, with some patches and a (currently unreleased) plugin, will convert inline LaTeX expressions to MathML. I'm working towards a patchset and instructions for others to do the same. -There is one thing that needs to be decided first: whether or not to -include [[sanitization|todo/svg]] of MathML in htmlscrubber (and while -we're at it, why not SVG). +I've setup a test ikiwiki [here](http://xbeta.org/colab/) where I've +started keeping a few notes on my progress. There is an example of +inline SVG on the homepage (note that the logo scales along with the +font size). There are a few example mathematical expressions in the +[sandbox](http://xbeta.org/colab/sandbox/). The MathML is generated +automatically from inline LaTeX expressions using an experimental +plugin I'm working on. My (also MathML-enabled) homepage: (still using Blosxom...maybe one day I'll convert it to ikiwiki...) -Current issues of interest: +Current ikiwki issues of interest: * [[bugs/recentchanges_feed_links]] * [[bugs/HTML_inlined_into_Atom_not_necessarily_well-formed]] @@ -20,3 +24,50 @@ Current issues of interest: * [[todo/BibTeX]] * [[todo/svg]] * [[todo/Option_to_make_title_an_h1?]] + * [[bugs/SVG_files_not_recognized_as_images]] + +## MathML and SVG support + +So far, I've made some notes on sanitizing MathML and SVG via +htmlscrubber on the [[todo/svg]] todo item. + +I've also worked out some content-negotiation issues. First of all, +one needs to modify the default templates to use the +XHTML+MathML+SVG doctype (see e.g., this [patch][template-patch]). +For most browsers, the content type of the pages should be +`application/xhtml+xml`. The solution is easy if you want to +just send `application/xhtml+xml` to everybody: +just change the content type of `.html` files across the board. + +However, if you want to support browsers that don't accept +`application/xhtml+xml` (and those that will but say they +don't, such as IE with the MathPlayer plugin), then one +needs a `mod_rewrite` rule like the following: + + RewriteCond %{HTTP_ACCEPT} application\/xhtml\+xml [OR] + RewriteCond %{HTTP_USER_AGENT} (W3C.*Validator|MathPlayer) + RewriteRule \.html$ - [T=application/xhtml+xml] + +This solves the problem of MathML and inline SVG in static pages +but some additional work is required for dynamically generated +pages, like page previews, that are generated by `ikiwiki.cgi`. +We need to allow `ikiwiki.cgi` to set the content type dynamically +based on the `HTTP_CONTENT_TYPE` environment variable +(e.g., with the following [patch][cgi-patch]). Then, the following +rewrite rules can pass the correct content type to ikiwiki: + + RewriteCond %{HTTP_ACCEPT} application\/xhtml\+xml [OR] + RewriteCond %{HTTP_USER_AGENT} (W3C.*Validator|MathPlayer) + RewriteRule ikiwiki.cgi$ - [T=application/xhtml+xml] + +One final critical issue is that a production-ready setup needs to +implement some sort of on-the-fly error handling. If a user submits +an invalid LaTeX expression or SVG code (not malicious, just invalid) +and saves the page, then browsers like Firefox will halt processing of +the page, preventing any further viewing or editing. A less than +optimal solution is to force users to preview the page before saving. +That way if someone introduces invalid XHTML then they can't save the +page in the first place (unless they post directly to the right URL). + + [template-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blobdiff;f=templates/page.tmpl;h=380ef699fa72223744eb5c1ee655fb79aa6bce5b;hp=9084ba7e11e92a10528b2ab12c9b73cf7b0f40a7;hb=416d5d1b15b94e604442e4e209a30dee4b77b684;hpb=ececf4fb8766a4ff7eff943b3ef600be81a0df49 + [cgi-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=commitdiff;h=fa538c375250ab08f396634135f7d79fce2a9d36 -- cgit v1.2.3 From 7fe2744d48a75a447fbe124839c3db2756c24795 Mon Sep 17 00:00:00 2001 From: "http://jblevins.org/" Date: Wed, 22 Oct 2008 13:57:45 -0400 Subject: Added links to a couple of experimental plugins --- doc/users/jasonblevins.mdwn | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'doc/users/jasonblevins.mdwn') diff --git a/doc/users/jasonblevins.mdwn b/doc/users/jasonblevins.mdwn index 8e51e7f7c..f69a8040c 100644 --- a/doc/users/jasonblevins.mdwn +++ b/doc/users/jasonblevins.mdwn @@ -1,7 +1,7 @@ [[!meta title="Jason Blevins"]] I'm currently hosting a private ikiwiki for keeping research notes -which, with some patches and a (currently unreleased) plugin, will +which, with some patches and a plugin (below), will convert inline LaTeX expressions to MathML. I'm working towards a patchset and instructions for others to do the same. @@ -26,6 +26,17 @@ Current ikiwki issues of interest: * [[todo/Option_to_make_title_an_h1?]] * [[bugs/SVG_files_not_recognized_as_images]] +## Plugins + +These plugins are experimental. Use them at your own risk. Read the +perldoc documentation for more details. + + * [mdwn_itex][] - Works with the `mdwn` plugin to convert inline LaTeX + expressions to MathML using `itex2MML`. + + * [h1title][] - If present, use the leading level 1 Markdown header to + set the page title and remove it from the page body. + ## MathML and SVG support So far, I've made some notes on sanitizing MathML and SVG via @@ -71,3 +82,5 @@ page in the first place (unless they post directly to the right URL). [template-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blobdiff;f=templates/page.tmpl;h=380ef699fa72223744eb5c1ee655fb79aa6bce5b;hp=9084ba7e11e92a10528b2ab12c9b73cf7b0f40a7;hb=416d5d1b15b94e604442e4e209a30dee4b77b684;hpb=ececf4fb8766a4ff7eff943b3ef600be81a0df49 [cgi-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=commitdiff;h=fa538c375250ab08f396634135f7d79fce2a9d36 + [mdwn_itex]: http://code.jblevins.org/ikiwiki/plugins/mdwn_itex.pm + [h1title]: http://code.jblevins.org/ikiwiki/plugins/h1title.pm -- cgit v1.2.3 From d175961d41cea034f7816e12be0ed9b6597352c1 Mon Sep 17 00:00:00 2001 From: Jason Blevins Date: Tue, 4 Nov 2008 11:16:58 -0500 Subject: Added experimental code, metamail, pandoc, and path plugins --- doc/users/jasonblevins.mdwn | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'doc/users/jasonblevins.mdwn') diff --git a/doc/users/jasonblevins.mdwn b/doc/users/jasonblevins.mdwn index f69a8040c..61c381d96 100644 --- a/doc/users/jasonblevins.mdwn +++ b/doc/users/jasonblevins.mdwn @@ -29,7 +29,8 @@ Current ikiwki issues of interest: ## Plugins These plugins are experimental. Use them at your own risk. Read the -perldoc documentation for more details. +perldoc documentation for more details. Patches and suggestions are +welcome. * [mdwn_itex][] - Works with the `mdwn` plugin to convert inline LaTeX expressions to MathML using `itex2MML`. @@ -37,6 +38,30 @@ perldoc documentation for more details. * [h1title][] - If present, use the leading level 1 Markdown header to set the page title and remove it from the page body. + * [code][] - Whole file and inline code snippet syntax highlighting + via GNU Source-highlight. The list of supported file extensions is + configurable. There is also some preliminary [documentation][code-doc]. + See the [FortranWiki](http://fortranwiki.org) for examples. + + * [metamail][] - a plugin for loading metadata from email-style + headers at top of a file (e.g., `title: Page Title` or + `date: November 2, 2008 11:14 EST`). + + * [pandoc][] - Markdown page processing via Pandoc. LaTeX and + reStructuredText are optional. + + * [path][] - Provides path-specific template conditionals such as + `IS_HOMEPAGE` and `IN_DIR_SUBDIR`. + + [mdwn_itex]: http://code.jblevins.org/ikiwiki/plugins.git/plain/mdwn_itex.pm + [h1title]: http://code.jblevins.org/ikiwiki/plugins.git/plain/h1title.pm + [code]: http://code.jblevins.org/ikiwiki/plugins.git/plain/code.pm + [code-doc]: http://code.jblevins.org/ikiwiki/plugins.git/plain/code.text + [metamail]: http://code.jblevins.org/ikiwiki/plugins.git/plain/metamail.pm + [pandoc]: http://code.jblevins.org/ikiwiki/plugins.git/plain/pandoc.pm + [path]: http://code.jblevins.org/ikiwiki/plugins.git/plain/path.pm + + ## MathML and SVG support So far, I've made some notes on sanitizing MathML and SVG via @@ -82,5 +107,3 @@ page in the first place (unless they post directly to the right URL). [template-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blobdiff;f=templates/page.tmpl;h=380ef699fa72223744eb5c1ee655fb79aa6bce5b;hp=9084ba7e11e92a10528b2ab12c9b73cf7b0f40a7;hb=416d5d1b15b94e604442e4e209a30dee4b77b684;hpb=ececf4fb8766a4ff7eff943b3ef600be81a0df49 [cgi-patch]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=commitdiff;h=fa538c375250ab08f396634135f7d79fce2a9d36 - [mdwn_itex]: http://code.jblevins.org/ikiwiki/plugins/mdwn_itex.pm - [h1title]: http://code.jblevins.org/ikiwiki/plugins/h1title.pm -- cgit v1.2.3