Gerard Flanagan schrieb: > On Thu, 2009-01-08 at 13:12 -0800, Eric wrote: >> I have ~400 svgs in my project that i'm trying to incorporate into my >> documentation that I've started writing with sphinx. The problem is >> that I can't get either the 0.5.1 or the latest code from hg to work, >> as it appears to generate an <img> tag, and at least in firefox I need >> to generate an <object> tag with the appropriate parameters.
Yes, SVGs are still a bit tricky. Does anyone know if the <object> tags work with all browsers (those that support SVG, that is)? >> I looked in the htmlwriter.py source, and it seems that code >> generation for an image node is passed off to the BaseTranslator, >> which in this case appears to be HTMLTranslator from >> docutils.writers.html4css1. >> >> There was a discussion on this topic in the sphinx-dev list around the >> middle of November, but it doesn't appear a conclusion was reached. >> >> So I'm trying to figure out if I should hack on the overall >> HTMLTranslator, and add in a special case of explicitly generating >> HTML when the image type is SVG (and passing it to the docutils >> HTMLTranslator otherwise), or perhaps create a pre-processing step >> that will convert SVGs into PNGs for inclusion. If the <object> strategy is the right one for SVGs, I'll happily add it to the default writer. > For the custom directive part, you are as wise as me - I've never done > that. Here is some prior art though: > > http://www.bitbucket.org/birkenfeld/sphinx/src/tip/sphinx/ext/todo.py > http://svn.scipy.org/svn/numpy/trunk/doc/sphinxext/ Let me also throw in a link to the newly written extension tutorial at <http://sphinx.pocoo.org/ext/tutorial.html>. It explains the todo extension in detail. (I'm also Georg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sphinx-dev" 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/sphinx-dev?hl=en -~----------~----~----~----~------~----~------~--~---
