RE: [sphinx-dev] Re: secondary windows or hidden sections in html output

2010-09-17 Thread Alastair Dent
I can see it would be an advantage over raw html, but can't see it being
an advantage over a sphinx extension.

Js support is a given - the search and index in sphinx won't work
without it. 

-Original Message-
From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com]
On Behalf Of Max Battcher
Sent: 16 September 2010 21:33
To: sphinx-dev@googlegroups.com
Subject: 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:

 div class=help-onlya 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;
  pHere 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=expandableThis 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--
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.



Re: [sphinx-dev] Re: secondary windows or hidden sections in html output

2010-09-16 Thread Max Battcher

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-onlya 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;
 pHere 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=expandableThis 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--
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: secondary windows or hidden sections in html output

2010-09-15 Thread Alastair Dent
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.

-Original Message-
From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On 
Behalf Of Guenter Milde
Sent: 15 September 2010 08:00
To: sphinx-dev@googlegroups.com
Subject: [sphinx-dev] Re: secondary windows or hidden sections in html output

On 2010-09-14, Alastair Dent wrote:

 I'm used to working with raw html and adding sections of info or 
 graphics that are only displayed when the user clicks a link or button.
 Sometimes it's text that is expanded inline, sometimes a large version 
 of a graphic.

 Is there a way of doing this with rst and Sphinx, or do I need to 
 write an extension?

If you do it in HTML, it can be done with reStruturedText. rst has a link 
syntax and also a syntax to have a graphic linking somewhere.
http://docutils.sourceforge.net/docs/user/rst/quickref.html

If you do it in some script, you can keep using raw HTML (in a raw directive or 
a custom role).

G√ľnter

--
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.



RE: [sphinx-dev] Re: secondary windows or hidden sections in html output

2010-09-15 Thread Alastair Dent
I'll try that tomorrow, thanks.


-Original Message-
From: sphinx-dev@googlegroups.com on behalf of Max Battcher
Sent: Wed 15/09/2010 19:03
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.

winmail.dat