Phillip Lord wrote:

Stuart Rackham <[email protected]> writes:
Okay, that's not so good! So, it looks like the right way to go would be
to use a plugin to serve the JS up and add it to the header. This will
be nicer in many ways, because I can just include the JS, and serve it
from a single location which should be faster. Also, with a plugin, I
should be able to set up configuration options; I think having this run
for an entire blog is likely to cause problems.

I think to get this working ideally, I'd like the option of adding some
custom fields to the post; I think these are supported in the XML-RPC
interface (haven't tried it, though). I could use the attributes support
you've just added to then switch this on or off on a per-post basis.
Anyway, it's going to take a while to do this; never written a wordpress
plugin. Or any PhP. But it doesn't sound too hard.
The alternative would be to display equations as images using an AsciiDoc
filter (this is how the music filter works, see
http://www.methods.co.nz/asciidoc/music-filter.html). I hacked this example
(http://www.amk.ca/python/code/mt-math) into a rough math2png.py script just
to see if it was feasible. The advantages of this approach are:

- It can be used to generate DocBook and HTML.
- Equations appear identical across formats.
- No JavaScript required in HTML outputs so no need for WordPress plugin.

Disadvantages:

- Inline filters have not been implemented yet, so no inline equations.


Ideally, I'd like to go for a non-image based solution; images are not
accessible. Also is blogpost clever enough to work out which images are
being created (rather than just linked to) as part of the asciidoc run?

Yes, it scans the generated HTML for image resources after asciidoc finishes.



The plugin also has the advantage that it's not asciidoc/blogpost
specific. There are some tools already that allow wordpress to show
maths, but the latex-u-like capabilities of javascript is attractive to
me.
For me, also, lack of inline equations would be a big thing. I'm not a
heavy maths user, just need the occasional term included.

The image route is really a LaTeX filter, it would accept any valid LaTeX so
it's not confined to math.

The only drawback I've experienced with the existing
approach is that it requires mathML fonts installed in the target browser,
Firefox is OK, but neither IE or Chrome work out of the box.


Cheers, Stuart



I think, I'll try it and see how it works.
Phil




--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/asciidoc?hl=en.

Reply via email to