[sphinx-dev] Re: How do I set tab size in code snippets?

2009-12-09 Thread Jason S
On Dec 8, 6:32 pm, Guenter Milde mi...@users.berlios.de wrote:
  and how do you do this in general, or for included files with
  a specific extension? (like '.blam' for instance)

 In Docutils you can do this general for source and included files with
 the tab-width config 
 settinghttp://docutils.sourceforge.net/docs/user/config.html#tab-width

 and (since version 0.6) per-file with the tab-width option of the include
 directivehttp://docutils.sf.net/docs/ref/rst/directives.html#including-an-exte...

 but not for a specific extension.

really really really dumb question, since I'm new to this... would you
(or someone) mind showing me a simple, specific example of how to do
this? I don't understand the context of the tab-width documentation
you referenced. Is it in conf.py? Is it a separate directive? Where
does it go? I would prefer a global setting to use in my conf.py file
in my sphinx project... but if the right place is in the .rst file I
will do that.

--

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.




[sphinx-dev] Re: How do I set tab size in code snippets?

2009-12-09 Thread Jason S
Never mind, I figured something out.

In my source .rst file, I changed

.. literalinclude:: tennis.espdf

to

.. include:: tennis.espdf
   :literal:
   :tab-width: 3

Is literalinclude a sphinx convenience directive? Because it's not
mentioned
in http://docutils.sf.net/docs/ref/rst/directives.html, and if
literalinclude just
saves you one line but leads to problems / lack of documentation, then
I don't
see the point in using it.

--

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.




[sphinx-dev] Re: How do I set tab size in code snippets?

2009-12-09 Thread Roberto Alsina
Jason S writes:

 Never mind, I figured something out.
 
 In my source .rst file, I changed
 
 .. literalinclude:: tennis.espdf
 
 to
 
 .. include:: tennis.espdf
:literal:
:tab-width: 3
 
 Is literalinclude a sphinx convenience directive? Because it's not
 mentioned
 in http://docutils.sf.net/docs/ref/rst/directives.html, and if
 literalinclude just
 saves you one line but leads to problems / lack of documentation, then
 I don't
 see the point in using it.

It is documented in the sphinx manual, and the reason for it seems to be 
that if include points to a missing file it fails, while literalinclude just 
gives a warning

If you can live with that, use include instead.

--

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.




[sphinx-dev] Re: example for tweaking HTML styles?

2009-12-09 Thread Jason S


On Dec 8, 10:49 am, TJG tjgol...@gmail.com wrote:
 In your _static directory create, eg, my.css which starts with

 @import default.css;

 and which then adds or overrides as needed.

 Then in your conf.py add or update:

 html_style = 'winsys.css'

you mean my.css not winsys.css... but that worked, thanks!

FWIW Sphinx seems to have a bug in that if you do this, it does not
include the file designated in 'html_style' in its dependency list for
HTML builds... so if you change the .css file it doesn't recognize
that things have changed to force a rebuild.

--

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: example for tweaking HTML styles?

2009-12-09 Thread TJG
Jason S wrote:
 
 On Dec 8, 10:49 am, TJG tjgol...@gmail.com wrote:
 In your _static directory create, eg, my.css which starts with

 @import default.css;

 and which then adds or overrides as needed.

 Then in your conf.py add or update:

 html_style = 'winsys.css'
 
 you mean my.css not winsys.css... but that worked, thanks!

Err. Yes. Glad it was obvious enough what was going on there :)


 FWIW Sphinx seems to have a bug in that if you do this, it does not
 include the file designated in 'html_style' in its dependency list for
 HTML builds... so if you change the .css file it doesn't recognize
 that things have changed to force a rebuild.


I know; I've just got a rebuild.cmd which I hit. My doc sets aren't
big enough for this to be a problem. YMMV, of course.

TJG

--

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.




[sphinx-dev] Re: example for tweaking HTML styles?

2009-12-09 Thread Jason S
On Dec 9, 12:24 pm, TJG tjgol...@gmail.com wrote:
  HTML builds... so if you change the .css file it doesn't recognize
  that things have changed to force a rebuild.

 I know; I've just got a rebuild.cmd which I hit. My doc sets aren't
 big enough for this to be a problem. YMMV, of course.

rebuild.cmd ? care to elaborate?

--

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: example for tweaking HTML styles?

2009-12-09 Thread Tim Golden
Jason S wrote:
 On Dec 9, 12:24 pm, TJG tjgol...@gmail.com wrote:
 HTML builds... so if you change the .css file it doesn't recognize
 that things have changed to force a rebuild.
 I know; I've just got a rebuild.cmd which I hit. My doc sets aren't
 big enough for this to be a problem. YMMV, of course.
 
 rebuild.cmd ? care to elaborate?

I'm not sure elaborate is the word, really ;)

rebuild.cmd
build.py -a -b html . .\_build
pause
/rebuild.cmd

FWIW, my build.cmd looks like this:

build.cmd
build.py -b html . .\_build
pause
/build.cmd

TJG

--

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.




[sphinx-dev] Re: example for tweaking HTML styles?

2009-12-09 Thread Jason S
On Dec 9, 2:55 pm, Tim Golden tjgol...@gmail.com wrote:
 rebuild.cmd
 build.py -a -b html . .\_build
 pause
 /rebuild.cmd

Oh, in other worse you are using the -a argument to force writing
all output files. That works, I only have a handful of source files. I
didn't know about that one. Thanks!

--

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.




[sphinx-dev] Re: literalinclude vs. include

2009-12-09 Thread Guenter Milde
On 2009-12-09, Jason S wrote:
 On Dec 9, 11:14 am, Jason S jmsa...@gmail.com wrote:
 Never mind, I figured something out.

 In my source .rst file, I changed

 .. literalinclude:: tennis.espdf

 to

 .. include:: tennis.espdf
    :literal:
    :tab-width: 3


 Argh! include :literal: is perfect, except that for some
 reason it's mucking with my quotes to make them angled. :-(

Could you be more specific here? '' - '' or what?

 How come literalinclude leaves the quotes alone, but include :literal:
 messes with quotes?

Just guessing: A sphinx bug: overactive smartypants beautifying not
recognizing the :literal: option of the include directive.

You might consider turning off the automatic quote replacement completely
(eventually after changing the quotes in the source).

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.




Re: [sphinx-dev] Re: Autoreplacing with link to local html file

2009-12-09 Thread Nathan Huesken
On Wed, Dec 09, 2009 at 09:23:10PM +, Guenter Milde wrote:
 On 2009-12-08, Nathan Huesken wrote:
  Hi,
 
   I want to replace every occurence of |local| with a hyperlink to a
   local file (.../local.html).
 
   But with .. |local| replace:: __file://../local.html sphinx complains
   about mailformated hyperlink ...
 
 That is an anonymous target.
 
   What is the best way to do it?
 
 Did you try already::
 
  .. |local| replace:: `../local.html`_

I did, I get:
(ERROR/3) Substitution definition contains illegal element

  
 or consulting the Docutils docs?

Yeah. I did not know that local links should start with plain nothing.
The solution:

in the text: local_

then
.. _local: ../local.html


Wonderful,
Thanks!

 
 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.