Re: [sphinx-dev] Sidebar Table of Contents Should Cover the Entire Doc Set, Not Just the Headings on the Current Page

2012-07-28 Thread TP
On Thu, Jul 26, 2012 at 7:37 PM, Chris Boorman  wrote:
> I'm using Sphinx to help me generate docs for a Python API, and I can't find
> a way to generate a complete Table of Contents. I can only get Sphinx to
> auomatically generate entries for the the current page. Since my pages
> aren't long, this produces short-sighted, practically useless TOCs. I need
> to find a way to generate a "master" TOC that lists every topic in the
> documentation set, and that can serve as a content navigation aid. Any ideas
> out there?

That what the globaltoc.html is for. See [1]

[1] http://sphinx.pocoo.org/config.html#confval-html_sidebars

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@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] ext/autodoc.py: should not safe_getattr's AttributeException's be handled?

2012-07-28 Thread Antonio Valentino
Hi Yaroslav,

Il 27/07/2012 19:58, Yaroslav Halchenko ha scritto:
> our documentation (www.pymvpa.org) started to break with absolutely 
> non-informative to us
> 
>   Traceback (most recent call last):
> File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 326, in 
> import_object
>   obj = self.get_attr(obj, part)
> File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 232, in 
> get_attr
>   return safe_getattr(obj, name, 
> *defargs)  
> File "/usr/lib/pymodules/python2.7/sphinx/util/inspect.py", line 70, in 
> safe_getattr
>   raise AttributeError(name)
>   AttributeError: cmdline
> 
> since we had no cmdline in the code.  inspection of the backtrace at the 
> moment showed that it was due to:
> 
> $> python -c "import psutil; print psutil.Process.__dict__['cmdline']; 
> print psutil.Process.cmdline" 
> 
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/lib/pymodules/python2.7/psutil/_common.py", line 75, in __get__
> res = instance.__dict__[self.func.__name__] = self.func(instance)
>   File "/usr/lib/pymodules/python2.7/psutil/__init__.py", line 242, in 
> cmdline
> return self._platform_impl.get_process_cmdline()
> AttributeError: 'NoneType' object has no attribute '_platform_impl'
> 
> so the questions are
> 
> - shouldn't may be autodoc not even getattr any properties (who knows what 
> evil that would do... and imho it might be legit for a property to through 
> an exception)?
> - or shouldn't it at least handle the exceptions gracefully?
> 

the issue seems, is some way, to be related to [1].
I'm pretty sure that a patch has been posted somewhere but unfortunately
I'm not able to find it anymore.


[1] https://bitbucket.org/birkenfeld/sphinx/issue/904


best regards

-- 
Antonio Valentino

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@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] Exception in shinx/jinja when building html

2012-07-28 Thread saisam
Hi there,

I got an exception while creating some html using the command
sphinx-build -b html . _build_html
and I get the same issue when creating a chm

I tried to get the last version of shinx (1.1.3), rst2pdf (0.92, at
first is was needed), reportlab (2.5)
and jinja and at the end I get the folloing log file with the
exception.

Could anyone see if the problem comes from jinja, shinx or my
document ?

Thanks

# Sphinx version: 1.1.3
# Python version: 2.6.6
# Docutils version: 0.8.1 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\cmdline.py", line 189, in main
app.build(force_all, filenames)
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\application.py", line 207, in build
raise
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\application.py", line 204, in build
self.builder.build_update()
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\builders\__init__.py", line 196, in build_update
'out of date' % len(to_build))
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\builders\__init__.py", line 252, in build
self.write(docnames, list(updated_docnames), method)
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\builders\__init__.py", line 292, in write
self.write_doc(docname, doctree)
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\builders\html.py", line 426, in write_doc
self.handle_page(docname, ctx, event_arg=doctree)
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\builders\html.py", line 728, in handle_page
output = self.templates.render(templatename, ctx)
  File "C:\Python26\lib\site-packages\sphinx-1.1.3-py2.6.egg\sphinx
\jinja2glue.py", line 128, in render
return self.environment.get_template(template).render(context)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\environment.py", line 719, in get_template
return self._load_template(name, self.make_globals(globals))
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\environment.py", line 693, in _load_template
template = self.loader.load(self, name, globals)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\loaders.py", line 127, in load
code = environment.compile(source, name, filename)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\environment.py", line 479, in compile
source = self._parse(source, name, filename)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\environment.py", line 398, in _parse
return Parser(self, source, name,
_encode_filename(filename)).parse()
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\parser.py", line 32, in __init__
self.stream = environment._tokenize(source, name, filename, state)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\environment.py", line 430, in _tokenize
stream = self.lexer.tokenize(source, name, filename, state)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\lexer.py", line 501, in tokenize
return TokenStream(self.wrap(stream, name, filename), name,
filename)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\lexer.py", line 298, in __init__
next(self)
  File "C:\Python26\lib\site-packages\jinja2-2.6-py2.6.egg
\jinja2\lexer.py", line 343, in next
self.current = self._next()
ValueError: generator already executing

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@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] Cannot find file Grammar.txt

2012-07-28 Thread Etienne Noël


When I'm trying to generate html documentation using Python Sphinx under 
Windows, I get the following error:

IOError: [Errno 2] No such file or directory: 
'c:\python27\sphinx.egg\sphinx\pycode\Grammar.txt'

However, when I open the sphinx.egg, the file "Grammar.txt" is present...

Here's the log it provided

Sphinx version: 1.1.3Python version: 2.7.3Docutils version: 0.9.1 releaseJinja2 
version: 2.6 Traceback (most recent call last): File 
"c:\python27\sphinx.egg\sphinx\cmdline.py", line 188, in main

warningiserror, tags)   File "c:\python27\sphinx.egg\sphinx\application.py", 
line 114, in __init__
self.setup_extension(extension)   File 
"c:\python27\sphinx.egg\sphinx\application.py", line 247, in

setup_extension mod = *import*(extension, None, None, ['setup']) File 
"c:\python27\sphinx.egg\sphinx\ext\autodoc.py", line 26, in 
File "c:\python27\sphinx.egg\sphinx\pycode__init__.py", line 25, in File 
"c:\python27\sphinx.egg\sphinx\pycode\pgen2\driver.py", line 126, in 
load_grammar g = pgen.generate_grammar(gt) File 
"c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 383, in 
generate_grammar p = ParserGenerator(filename) File 
"c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 15, in *init* stream 
= open(filename) IOError: [Errno 2] No such file or directory: 
'c:\python27\sphinx.egg\sphinx\pycode\Grammar.txt'

Anyone has a clue why ?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/YpGpRDbtLoUJ.
To post to this group, send email to sphinx-dev@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] ref:`Not Italized Please `

2012-07-28 Thread nelsonz


Hello;

How can I create an internal link using *:ref:* such that the link name
in the output html does NOT appear italicized.

Thanks
Nelson

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/vZlLDo8JbeAJ.
To post to this group, send email to sphinx-dev@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] Codeblocks in multipe langaues

2012-07-28 Thread Vitaly Babiy
Hey guys,


I was wonder if there is already a way to do this kinda of think with 
sphinx?


https://stripe.com/#example-code


Given a few code blocks group them and show one at a time after a user a 
choose which to see.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/AhOI250llWEJ.
To post to this group, send email to sphinx-dev@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] Patch

2012-07-28 Thread Pedro Kroger
Hi,

I'm submitting a patch to use variables for latex and pdflatex in the 
Makefile used by sphinx to compile latex.
It's a small change, but it allows one to use other latex implementations.

For instance, with this patch I can use xelatex with something like the 
following in my master Makefile:

export PDFLATEX = xelatex

pdf:
$(SPHINXBUILD) -b latex $(SCREENOPTS) $(ALLSPHINXOPTS) $(BUILDDIR)/latex
$(MAKE) -C $(BUILDDIR)/latex all-pdf PDFLATEX=$(PDFLATEX)


Cheers,

Pedro Kroger
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/Wzn_oSnHDMIJ.
To post to this group, send email to sphinx-dev@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.

diff -r 348224ae1fd5 sphinx/texinputs/Makefile
--- a/sphinx/texinputs/Makefile	Sun Jul 01 15:28:39 2012 +0200
+++ b/sphinx/texinputs/Makefile	Tue Jul 24 21:15:16 2012 -0300
@@ -4,6 +4,9 @@
 ALLPDF = $(addsuffix .pdf,$(ALLDOCS))
 ALLDVI = $(addsuffix .dvi,$(ALLDOCS))
 
+LATEX = latex
+PDFLATEX = pdflatex
+
 # Prefix for archive names
 ARCHIVEPRREFIX =
 # Additional LaTeX options
@@ -43,20 +46,20 @@
 # The number of LaTeX runs is quite conservative, but I don't expect it
 # to get run often, so the little extra time won't hurt.
 %.dvi: %.tex
-	latex $(LATEXOPTS) '$<'
-	latex $(LATEXOPTS) '$<'
-	latex $(LATEXOPTS) '$<'
+	$(LATEX) $(LATEXOPTS) '$<'
+	$(LATEX) $(LATEXOPTS) '$<'
+	$(LATEX) $(LATEXOPTS) '$<'
 	-makeindex -s python.ist '$(basename $<).idx'
-	latex $(LATEXOPTS) '$<'
-	latex $(LATEXOPTS) '$<'
+	$(LATEX) $(LATEXOPTS) '$<'
+	$(LATEX) $(LATEXOPTS) '$<'
 
 %.pdf: %.tex
-	pdflatex $(LATEXOPTS) '$<'
-	pdflatex $(LATEXOPTS) '$<'
-	pdflatex $(LATEXOPTS) '$<'
+	$(PDFLATEX) $(LATEXOPTS) '$<'
+	$(PDFLATEX) $(LATEXOPTS) '$<'
+	$(PDFLATEX) $(LATEXOPTS) '$<'
 	-makeindex -s python.ist '$(basename $<).idx'
-	pdflatex $(LATEXOPTS) '$<'
-	pdflatex $(LATEXOPTS) '$<'
+	$(PDFLATEX) $(LATEXOPTS) '$<'
+	$(PDFLATEX) $(LATEXOPTS) '$<'
 
 clean:
 	rm -f *.dvi *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla


[sphinx-dev] Sidebar Table of Contents Should Cover the Entire Doc Set, Not Just the Headings on the Current Page

2012-07-28 Thread Chris Boorman
I'm using Sphinx to help me generate docs for a Python API, and I can't 
find a way to generate a complete Table of Contents. I can only get Sphinx 
to auomatically generate entries for the the current page. Since my pages 
aren't long, this produces short-sighted, practically useless TOCs. I need 
to find a way to generate a "master" TOC that lists every topic in the 
documentation set, and that can serve as a content navigation aid. Any 
ideas out there?
 
 
- Chris.

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/_dTCQmMkFgMJ.
To post to this group, send email to sphinx-dev@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] Missing file "Grammar.txt"

2012-07-28 Thread Etienne Noël
First of all, I've looked on the forum and there were only three topics 
about this problem but it didn't solve my problem. I installed sphinx, did 
the quickstart withtout any issues. However, when I want to do "make html", 
I get the following error:

# Sphinx version: 1.1.3
# Python version: 2.7.3
# Docutils version: 0.9.1 release
# Jinja2 version: 2.6
Traceback (most recent call last):
  File "c:\python27\sphinx.egg\sphinx\cmdline.py", line 188, in main
warningiserror, tags)
  File "c:\python27\sphinx.egg\sphinx\application.py", line 114, in __init__
self.setup_extension(extension)
  File "c:\python27\sphinx.egg\sphinx\application.py", line 247, in 
setup_extension
mod = __import__(extension, None, None, ['setup'])
  File "c:\python27\sphinx.egg\sphinx\ext\autodoc.py", line 26, in 
  File "c:\python27\sphinx.egg\sphinx\pycode\__init__.py", line 25, in 

  File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\driver.py", line 126, in 
load_grammar
g = pgen.generate_grammar(gt)
  File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 383, in 
generate_grammar
p = ParserGenerator(filename)
  File "c:\python27\sphinx.egg\sphinx\pycode\pgen2\pgen.py", line 15, in 
__init__
stream = open(filename)
IOError: [Errno 2] No such file or directory: 
'c:\\python27\\sphinx.egg\\sphinx\\pycode\\Grammar.txt'

I've looked in the sphinx.egg and Grammar.txt is properly in it?

Anyone has a clue? 

Thanks in advance

(I'm using windows by the way)

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/q6hLCGYxXHcJ.
To post to this group, send email to sphinx-dev@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] ext/autodoc.py: should not safe_getattr's AttributeException's be handled?

2012-07-28 Thread Yaroslav Halchenko
our documentation (www.pymvpa.org) started to break with absolutely 
non-informative to us

  Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 326, in 
import_object
  obj = self.get_attr(obj, part)
File "/usr/lib/pymodules/python2.7/sphinx/ext/autodoc.py", line 232, in 
get_attr
  return safe_getattr(obj, name, 
*defargs)  
File "/usr/lib/pymodules/python2.7/sphinx/util/inspect.py", line 70, in 
safe_getattr
  raise AttributeError(name)
  AttributeError: cmdline

since we had no cmdline in the code.  inspection of the backtrace at the 
moment showed that it was due to:

$> python -c "import psutil; print psutil.Process.__dict__['cmdline']; 
print psutil.Process.cmdline" 

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/pymodules/python2.7/psutil/_common.py", line 75, in __get__
res = instance.__dict__[self.func.__name__] = self.func(instance)
  File "/usr/lib/pymodules/python2.7/psutil/__init__.py", line 242, in 
cmdline
return self._platform_impl.get_process_cmdline()
AttributeError: 'NoneType' object has no attribute '_platform_impl'

so the questions are

- shouldn't may be autodoc not even getattr any properties (who knows what 
evil that would do... and imho it might be legit for a property to through 
an exception)?
- or shouldn't it at least handle the exceptions gracefully?

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sphinx-dev/-/j4Ahb0CUciAJ.
To post to this group, send email to sphinx-dev@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.