Re: [sphinx-dev] Re: secondary windows or hidden sections in html output
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: Click here to see an example. Here is the example 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: This is a paragraph that I want to hide by default. 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-- 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.
Re: [sphinx-dev] Re: graphiz and LaTeX layout issue
On Sep 16, 2010, at 8:51 AM, Doug Hellmann wrote: > > On Sep 12, 2010, at 3:50 PM, Guenter Milde wrote: > >> On 2010-09-12, Kevin Dunn wrote: >>> On Sat, Sep 11, 2010 at 14:38, Doug Hellmann >>> wrote: On Sep 11, 2010, at 2:35 PM, Doug Hellmann wrote: >> > I've run into a problem with the graphviz extension and LaTeX output, > similar to the one described in this older thread > http://groups.google.com/group/sphinx-dev/browse_thread/thread/b4d6b008d85e95a2/2b9a3bd468558cad?lnk=gst&q=graphviz# >> >> > So the image is inlined in the middle of a single paragraph that > should be 2. >> > Does anyone have any suggestions about how to work around this and > insert the necessary paragraph breaks? >> >> Try with comments between: >> >> >> Consider this digraph: >> >> .. write here anything you want >> >> .. digraph:: pickle_example >> >> "root"; >> >> .. or use an empty comment >> >> The graph includes several cycles, ... >> >> >> (Tested only with Docutils.) > > That doesn't seem to have any effect on the output, I'm still not getting > paragraph separation. I've created a fork and added a new option to the graphviz directives to fix this issue at http://bitbucket.org/dhellmann/sphinx-graphviz-paragraphs. I sent Georg a pull-request, but wasn't sure if who else should get it, too. Doug -- 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.
Re: [sphinx-dev] Re: graphiz and LaTeX layout issue
> I've run into a problem with the graphviz extension and LaTeX output, > similar to the one described in this older thread > http://groups.google.com/group/sphinx-dev/browse_thread/thread/b4d6b008d85e95a2/2b9a3bd468558cad?lnk=gst&q=graphviz# >> >> > So the image is inlined in the middle of a single paragraph that > should be 2. >> > Does anyone have any suggestions about how to work around this and > insert the necessary paragraph breaks? >> >> Try with comments between: >> >> >> Consider this digraph: >> >> .. write here anything you want >> >> .. digraph:: pickle_example >> >> "root"; >> >> .. or use an empty comment >> >> The graph includes several cycles, ... >> >> >> (Tested only with Docutils.) > > That doesn't seem to have any effect on the output, I'm still not getting > paragraph separation. I guess this approach should work, based on the LaTeX output you showed in the first message. However, this will place your figure using LaTeX's figure placement rules (i.e. which sometimes means the figures appear where you don't want them). http://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures .. raw:: latex \begin{figure}[htb] .. digraph:: pickle_example "root"; .. raw:: latex \end{figure} Kevin > Doug -- 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.
Re: [sphinx-dev] Re: graphiz and LaTeX layout issue
On Sep 12, 2010, at 3:50 PM, Guenter Milde wrote: > On 2010-09-12, Kevin Dunn wrote: >> On Sat, Sep 11, 2010 at 14:38, Doug Hellmann wrote: >>> On Sep 11, 2010, at 2:35 PM, Doug Hellmann wrote: > I've run into a problem with the graphviz extension and LaTeX output, similar to the one described in this older thread http://groups.google.com/group/sphinx-dev/browse_thread/thread/b4d6b008d85e95a2/2b9a3bd468558cad?lnk=gst&q=graphviz# > > So the image is inlined in the middle of a single paragraph that should be 2. > Does anyone have any suggestions about how to work around this and insert the necessary paragraph breaks? > > Try with comments between: > > > Consider this digraph: > > .. write here anything you want > > .. digraph:: pickle_example > >"root"; > > .. or use an empty comment > > The graph includes several cycles, ... > > > (Tested only with Docutils.) That doesn't seem to have any effect on the output, I'm still not getting paragraph separation. Doug -- 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.
RE: [sphinx-dev] Re: secondary windows or hidden sections in html output
Just re-read your email, and I'm not sure how this would work. In html, I'd have two divs, something like this: Click here to see an example. Here is the example 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? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of Max Battcher Sent: 15 September 2010 19:04 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] Re: secondary windows or hidden sections in html output 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. -- 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.