On 09/15/2010 08:42 AM, Alastair Dent wrote:
Hmm.

I've tried using .. raw: html to escape and put some extra javascript in one of 
the standard js files.

That worked - sortof. Except that the html builder doesn't copy over any images 
that aren't referenced in rst.

I guess I'll have to look at making my own extension for this. Blast.

You might not need an extension for this. I would use the rst-class directive myself to apply arbitrary CSS classes to the content I wanted to hide. Example:

  .. rst-class:: html-start-hidden

  This is the following reST paragraph that the class applies to.

Then you just tell your JS library of choice to act upon items of that class (rst-class gets added to HTML CSS class list), for instance with the right plugin for jQuery you might have something like:

$('.html-start-hidden').expandCollapse({'start-hidden': true});

No .. raw:: html needed (just add the JS to the static templates), and the reST content shows up in your PDF and other builds as well.

--
--Max Battcher--
http://worldmaker.net

--
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-...@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to