On 9/16/2010 4:15, Alastair Dent wrote:
Just re-read your email, and I'm not sure how this would work.

In html, I'd have two divs, something like this:

<div class="help-only"><a id="h002" class="block-link" title="Title"
href="javascript:toggleBlock('002')" target="_self">     
     Click here to see an example.</a></div>        

     <div id="d002" class="expandingblock" style="display:none;">
             <p>Here is the example</p>

One is the link to expand or collapse the 2nd div.

Without an extension, how do I end up with a link to the javascript?

The jQuery philosophy (although it isn't unique to jQuery as many other js frameworks follow it in some form) here seems to differ from what you are used to. It may be something for you to explore on your own.

But the idea often is to use the simplest, most meaningful (semantic) HTML, such as:

<p class="expandable">This is a paragraph that I want to hide by default.</p>

Then let the script itself add the "boiler-plate" HTML it needs to actually expand/hide the markup. The script itself will add the expand/collapse links.

This philosophy is easier to integrate with reST/docutils/Sphinx than the other. (It also downgrades better when viewed in a browser without js support or with js turned off.) If you don't mind learning a new approach to js/new js framework, such a philosophy could ultimately end up saving you time in the long run than trying to maintain a custom reST extension just to do js in the form that you are used to.

At least, that is my opinion.

--Max Battcher--

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 
For more options, visit this group at 

Reply via email to