RE: [sphinx-dev] Using if statements in conf.py
I do test builds using a command like the one below: sphinx-build -n -a -b html C:\Data\docs\Help-root\cs-mpHelp C:\Data\Docs\build Our production build is run from a complex series of Python scripts - for prod builds the developer now says they'll probably write the value of ifconf_product to the conf.py file. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of Ernesto Posse Sent: 05 December 2011 19:50 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] Using if statements in conf.py My comments are below. On Mon, Dec 5, 2011 at 5:47 AM, Alastair Dent alastair.d...@imgtec.com wrote: Thanks, that helps. I really don't know anything about Python - my background is with languages like Fortran and Pascal. How do I pass an argument to conf.py? If I were doing this in Pascal I'd declare it as a global variable and initialise it explicitly at an appropriate point. Python doesn't seem to work like that. From what I can tell, I need to use something like: ifconf_product = sys.argv[1] in the conf.py. But how do I call conf.py with an argument? Well, it depends on what you are trying to do, and why are you trying to call conf.py. First of all, normally you do not call conf.py directly. conf.py is automatically called (or rather, imported) when you execute sphinx-build. Using sys.arg should in principle give you access to the command-line arguments to sphinx-build. You did not mention in your e-mail if you actually tried this. If you did, and it is not working, what kind of behaviour, messages or errors do you get? Also note that the declarations in conf.py *are* variables (and you can think of them as 'global' in certain sense) and are initialized right there (in conf.py). This file is meant to contain the parameters of the sphinx-build process, so it seems rather odd that you are trying to call conf.py. Perhaps if you clarified what is it that you are trying to do, might help. If you are trying to have alternative configurations, it has been suggested to have two (or more) separate config files, e.g. config1.py, config2.py and then invoking: sphinx-build -c /path/to/config1.py of sphinx-build -c /path/to/config2.py -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of Ernesto Posse Sent: 02 December 2011 22:29 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] Using if statements in conf.py On Fri, Dec 2, 2011 at 11:27 AM, Alastair Dent alastair.d...@imgtec.com wrote: Can I do something like the following in conf.py: You can but you'll have to use Python syntax (conf.py is a Python module), so instead of if ifconf_product='mini' then exclude_patterns = ['interface/*.rst','dialogs/*.rst'] elseif ifconf_product='main' then exclude_patterns = ['mini-indexes.rst] endif it should be something like if ifconf_product=='mini': exclude_patterns = ['interface/*.rst','dialogs/*.rst'] elif ifconf_product=='main': exclude_patterns = ['mini-indexes.rst] -- Ernesto Posse Modelling and Analysis in Software Engineering School of Computing Queen's University - Kingston, Ontario, Canada -- 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. -- 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. -- Ernesto Posse Modelling and Analysis in Software Engineering School of Computing Queen's University - Kingston, Ontario, Canada -- 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. -- 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] two tocs in index.rst = two in sidebar
I have two tocs in my index.rst, each contained by an ifconfig statement. The body of the index.rst generates correctly, with the correct toc showing according to the parameters for ifconfig. However, the sidebar (which contains a mini-toc based on index.rst) does not generate correctly. It contains both of the tocs. This seems to be a bug due to the way the parsing is being done. I am using the old-style sidebar structure in my layout.html {%- macro sidebar() %} {%- if render_sidebar %} div class=sphinxsidebar div class=sphinxsidebarwrapper {%- block sidebarlogo %} {%- if logo %} p class=logoa href={{ pathto(master_doc) }} img class=logo src={{ pathto('_static/' + logo, 1) }} alt=Logo/ /a/p {%- endif %} {%- endblock %} {%- if sidebars != None %} {#- new style sidebar: explicitly include/exclude templates #} {%- for sidebartemplate in sidebars %} {%- include sidebartemplate %} {%- endfor %} {%- else %} {#- old style sidebars: using blocks -- should be deprecated #} {%- block sidebartoc %} {%- include localtoc.html %} {%- endblock %} {%- block sidebarrel %} {%- include relations.html %} {%- endblock %} {%- block sidebarsourcelink %} {#%- include sourcelink.html %#} {%- endblock %} {%- if customsidebar %} {%- include customsidebar %} {%- endif %} {%- block sidebarsearch %} {%- include searchbox.html %} {%- endblock %} {%- endif %} /div /div {%- endif %} {%- endmacro %} -- 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] Using if statements in conf.py
Thanks, that helps. I really don't know anything about Python - my background is with languages like Fortran and Pascal. How do I pass an argument to conf.py? If I were doing this in Pascal I'd declare it as a global variable and initialise it explicitly at an appropriate point. Python doesn't seem to work like that. From what I can tell, I need to use something like: ifconf_product = sys.argv[1] in the conf.py. But how do I call conf.py with an argument? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of Ernesto Posse Sent: 02 December 2011 22:29 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] Using if statements in conf.py On Fri, Dec 2, 2011 at 11:27 AM, Alastair Dent alastair.d...@imgtec.com wrote: Can I do something like the following in conf.py: You can but you'll have to use Python syntax (conf.py is a Python module), so instead of if ifconf_product='mini' then exclude_patterns = ['interface/*.rst','dialogs/*.rst'] elseif ifconf_product='main' then exclude_patterns = ['mini-indexes.rst] endif it should be something like if ifconf_product=='mini': exclude_patterns = ['interface/*.rst','dialogs/*.rst'] elif ifconf_product=='main': exclude_patterns = ['mini-indexes.rst] -- Ernesto Posse Modelling and Analysis in Software Engineering School of Computing Queen's University - Kingston, Ontario, Canada -- 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. -- 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] Using if statements in conf.py
Can I do something like the following in conf.py: if ifconf_product='mini' then exclude_patterns = ['interface/*.rst','dialogs/*.rst'] elseif ifconf_product='main' then exclude_patterns = ['mini-indexes.rst] endif I need to exclude specific files for some builds and not for others. -- 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] exclude_patterns not working
They are linked by reference. Do you think that could be triggering Sphinx to output them regardless of the exclude_patterns command? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of daspostloch Sent: 20 July 2011 15:39 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] exclude_patterns not working are they also *linked/produced* in the html output pages in addition to being copied? (they shouldn't be) there has been another thread like this in the archives. imo it's a bug of sphinx to copy files that are ignored and not used to produce html output. On 07/20/2011 04:28 PM, Alastair Dent wrote: Python 2.6 Sphinx-1.0.7-py2.6.egg I'm using the following in conf.py exclude_patterns = ['interface/peripheralRegion.rst', 'hdEditor/'] All files in hdEditor and the 'interface/peripheralRegion.rst' file are included in the build. -- 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. -- 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] exclude_patterns not working
Not quite the same issue. In my case, html is being generated for the excluded files. If I get the time, I'll try building and excluding something that isn't explicitly referenced. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of daspostloch Sent: 20 July 2011 16:01 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] exclude_patterns not working try it out :) i'd been referring to this one: http://comments.gmane.org/gmane.comp.python.sphinx.devel/5074 upon re-reading it is not exactly your problem. so, good luck, i'm out :) but anyway, it might still be helpful in general if you specified whether or not .html is actually being generated for them, or if it's only the sources that get copied. good luck On 07/20/2011 04:54 PM, Alastair Dent wrote: They are linked by reference. Do you think that could be triggering Sphinx to output them regardless of the exclude_patterns command? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of daspostloch Sent: 20 July 2011 15:39 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] exclude_patterns not working are they also *linked/produced* in the html output pages in addition to being copied? (they shouldn't be) there has been another thread like this in the archives. imo it's a bug of sphinx to copy files that are ignored and not used to produce html output. On 07/20/2011 04:28 PM, Alastair Dent wrote: Python 2.6 Sphinx-1.0.7-py2.6.egg I'm using the following in conf.py exclude_patterns = ['interface/peripheralRegion.rst', 'hdEditor/'] All files in hdEditor and the 'interface/peripheralRegion.rst' file are included in the build. -- 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. -- 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. -- 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] exclude_patterns not working
Ok, I've tested this. Exclude_patterns works if and only if the excluded file is not referenced by either a toc or a direct ref. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On Behalf Of daspostloch Sent: 20 July 2011 15:39 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] exclude_patterns not working are they also *linked/produced* in the html output pages in addition to being copied? (they shouldn't be) there has been another thread like this in the archives. imo it's a bug of sphinx to copy files that are ignored and not used to produce html output. On 07/20/2011 04:28 PM, Alastair Dent wrote: Python 2.6 Sphinx-1.0.7-py2.6.egg I'm using the following in conf.py exclude_patterns = ['interface/peripheralRegion.rst', 'hdEditor/'] All files in hdEditor and the 'interface/peripheralRegion.rst' file are included in the build. -- 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. -- 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] Where is the Sphinx-Wiki???
I think you've misunderstood the main usage of Sphinx. It is used for producing documentation from commented source code, where the comments are written in rst format. I'd be very interested in a project that used a wiki as a source. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of Snaky Love Sent: 28 September 2010 19:21 To: sphinx-dev Subject: [sphinx-dev] Where is the Sphinx-Wiki??? Hi, sorry for maybe asking about the most obvious thing, but I was not able to find anything that helped me to answer the question myself... so I would like to ask here: where is the sphinx wiki??? No, not a wiki iabout/i sphinx, I am searching a wiki that is iusing/i sphinx? You are using wikis geherating collaborative documentation projects with sphinx, aren´t you? Which wiki are you using? Thank you very much for your attention! Snaky -- 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] Putting the search box on the top bar
Find the layout.html file for the theme you are using. Look for 'Search' and you should find some lines like: {%- block sidebarsearch %} {%- include searchbox.html %} {%- endblock %} Now to decide where to put it in the header. The template I'm using has a navigation bar at the top, defined in {%- macro relbar() %} I put the {%- block sidebarsearch %} {%- include searchbox.html %} {%- endblock %} In the macro, after the definition of the navigation html. You'll probably want to tweak the layout - do this in layout.html. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of delfick Sent: 28 September 2010 11:37 To: sphinx-dev Subject: [sphinx-dev] Putting the search box on the top bar Hello, Does anyone know how I'd go about making it so the search box is at the top of the page, rather than in the sidebar ? Thankyou, Regards, Stephen -- 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] Putting the search box on the top bar
Mostly it is easier - once you know where things are. My suggestion is a bit of a cludge and I'm sure someone else can come up with a more elegant solution. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of Stephen Moore Sent: 28 September 2010 13:55 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] Putting the search box on the top bar On Tue, Sep 28, 2010 at 8:35 PM, Alastair Dent alastair.d...@imgtec.com wrote: Find the layout.html file for the theme you are using. Look for 'Search' and you should find some lines like: [..] well that was quite a bit easier than I thought it would be :) Thankyou ... Regards, Stephen -- 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.
[sphinx-dev] accessing global variables like 'toc'
In some html files I'd like to place a local toc. The variable 'toc' would seem to do the trick, but how do I insert it? Should I define a block in the layout.html? -- 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
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
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
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
[sphinx-dev] secondary windows or hidden sections in html output
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? -- 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] PDF docs from HTML
Take a look at http://www.princexml.com/. We use it for converting html to pdf and find the results fantastic. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of Georg Brandl Sent: 23 August 2010 15:08 To: sphinx-dev@googlegroups.com Subject: Re: [sphinx-dev] PDF docs from HTML -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 23.08.2010 13:56, schrieb Infinity77: Hi All, I am the maintainer of the AGW library (a battery-included package for wxPython). I am currently using Sphinx Sphinx-1.0dev_20091116 for Python 2.5 and I am very happy with the results I get with it. As you can see from this page: http://xoomer.virgilio.it/infinity77/AGW_Docs/index.html I am using a pretty heavily customized theme for the HTML output. I wanted to provide also a PDF version of the docs (beside the CHM one, which is already available), but I am hitting a wall no matter what I try. A while ago I have tried with Latex, but on Windows it is a nightmare to install and use, not to mention that Latex gets stuck processing the AGW docs and spits impossible errors. I am currently trying with rst2pdf: it's been running for some time now (about an hours or so), with Python sucking 320 MB of RAM and growing. Apart from a bunch of messages like this: [ERROR] findfonts.py:249 Unknown font: DejaVu Sans-Oblique [ERROR] styles.py:81 Unknown font: DejaVu Sans-Oblique,replacing with Helvetica (which are, by the way, incorrect as I have these fonts installed and very visible), I am not getting any other output. Then, I was wondering if someone knew of a way to generate a *single* HTML file from Sphinx containing the whole documentation, which I might be able to convert to PDF using Acrobat or similar. - From Sphinx 1.0, there is indeed a singlehtml builder that should do approximately what you want. Georg -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAkxygKoACgkQN9GcIYhpnLA9uQCcDOhXzFmZN86y+uNrQ5sNI6YE SOsAnjxCH0iJLh7VS7IEPNY8T5eNDSnF =C9Hq -END PGP SIGNATURE- -- 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: modifications to the toctree() template function
Sorry, the function isn't called localtoc, it's just 'toc'. Some of the templates produce html with a toc that is just for the current file. Look for localtoc.html. Also mentioned here: http://sphinx.pocoo.org/config.html?highlight=localtoc Like you, I'm finding using some of the functions frustrating. I'm sure that the apparent lack of info on some things is due to them not actually being part of Sphinx, but adapted from the likes of Jinja -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 11 August 2010 23:25 To: sphinx-dev Subject: [sphinx-dev] Re: modifications to the toctree() template function you're right, basic theme uses globaltoc.html template. but the code in there just calls the toctree() template function. which I also do. my question goes beyond that. my system doesn't seem to know any localtoc() function. where can i see which functions are available in the template, and how to use them? thanks for your insight :) a. On 11 Aug., 15:40, Alastair Dent alastair.d...@imgtec.com wrote: I was a bit woolly in my description, and on checking, I'm wrong as well. AFAIK, the sidebar is 'built' by taking info from an html file specified for your theme. For my setup, that's C:\Python26\Lib\site-packages\Sphinx-1.0b2-py2.6.egg\sphinx\themes\basic\globaltoc.html Can you use the function localtoc instead? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 11 August 2010 11:45 To: sphinx-dev Subject: [sphinx-dev] Re: modifications to the toctree() template function I don't understand what you mean. What's the difference between 'compile time' and 'runtime'? The toctree() template function takes parameters, which means that it is evaluated when the HTML files are built. So it should just be a matter of extending the Sphinx function which the template toctree() function calls. But which is that? And how would I start? On Aug 9, 11:14 am, Alastair Dent alastair.d...@imgtec.com wrote: As I understand it, the toctree is built at compile time, not runtime. So normally it is built, then inserted into the html file. So the sidebars are built, then inserted. So what you are asking for would be quite complicated. I use a 'local' toctree in a similar manner to what you are asking, but it is only in the first/overview html file for each chunk. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 09 August 2010 09:57 To: sphinx-dev Subject: [sphinx-dev] modifications to the toctree() template function Hi there, I'm using Sphinx 1.0.1 to build some websites. While adapting the basic template to my needs, I stumbled upon the need to modify the toctree() template function to accomodate several things. Most importantly, I'd like to have toctree() an option to start at the level of the current document, and not at the root level. What I mean is this: root/ doc1/ doc2/ doc2.1/ doc2.2/ doc3/ So I'd like to have the option to render a sidebar menu which only contains the 'heading' doc2, and then the members doc2.1 and doc2.2. I was thinking about an option toctree(startatcurrent=True) to accomodate this ... Also, how do I get the title of and the link to the parent of the current document (to accomodate the 'heading' as descibed above)? I've been searching through the Sphinx code for quite some while, but couldn'r really figure out which functions/variables are available to the templates. What I did find out is that probably the code that I want is in environment.py. But how would I go to implement changes? Any help is greatly appreciated! Cheers, A. -- 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 athttp://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 athttp://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. -- You received this message because you are subscribed to the Google Groups sphinx-dev
RE: [sphinx-dev] Re: modifications to the toctree() template function
I had a thought (wow). In your original question, you wanted a sidebar toc that displayed a list for a sub-grouping of docs. Can you build each sub-group of docs separately, then just combine the files? You would need a 'master' grouping as well, to give you an overall toc/sitemap. So your dir structure might be like this: Root/ main intro section with toc Doc1 with conf.py etc \doc1.1 Doc2 with conf.py etc \doc2.1 So you would build doc1, doc2 and root. Doc1 output would have the toc for all of the doc1 grouping. Doc2 the same. Root would have a toc pointing to doc1 and doc2 Copy all build files to same location. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 11 August 2010 23:25 To: sphinx-dev Subject: [sphinx-dev] Re: modifications to the toctree() template function you're right, basic theme uses globaltoc.html template. but the code in there just calls the toctree() template function. which I also do. my question goes beyond that. my system doesn't seem to know any localtoc() function. where can i see which functions are available in the template, and how to use them? thanks for your insight :) a -- 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: modifications to the toctree() template function
I was a bit woolly in my description, and on checking, I'm wrong as well. AFAIK, the sidebar is 'built' by taking info from an html file specified for your theme. For my setup, that's C:\Python26\Lib\site-packages\Sphinx-1.0b2-py2.6.egg\sphinx\themes\basic\globaltoc.html Can you use the function localtoc instead? -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 11 August 2010 11:45 To: sphinx-dev Subject: [sphinx-dev] Re: modifications to the toctree() template function I don't understand what you mean. What's the difference between 'compile time' and 'runtime'? The toctree() template function takes parameters, which means that it is evaluated when the HTML files are built. So it should just be a matter of extending the Sphinx function which the template toctree() function calls. But which is that? And how would I start? On Aug 9, 11:14 am, Alastair Dent alastair.d...@imgtec.com wrote: As I understand it, the toctree is built at compile time, not runtime. So normally it is built, then inserted into the html file. So the sidebars are built, then inserted. So what you are asking for would be quite complicated. I use a 'local' toctree in a similar manner to what you are asking, but it is only in the first/overview html file for each chunk. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 09 August 2010 09:57 To: sphinx-dev Subject: [sphinx-dev] modifications to the toctree() template function Hi there, I'm using Sphinx 1.0.1 to build some websites. While adapting the basic template to my needs, I stumbled upon the need to modify the toctree() template function to accomodate several things. Most importantly, I'd like to have toctree() an option to start at the level of the current document, and not at the root level. What I mean is this: root/ doc1/ doc2/ doc2.1/ doc2.2/ doc3/ So I'd like to have the option to render a sidebar menu which only contains the 'heading' doc2, and then the members doc2.1 and doc2.2. I was thinking about an option toctree(startatcurrent=True) to accomodate this ... Also, how do I get the title of and the link to the parent of the current document (to accomodate the 'heading' as descibed above)? I've been searching through the Sphinx code for quite some while, but couldn'r really figure out which functions/variables are available to the templates. What I did find out is that probably the code that I want is in environment.py. But how would I go to implement changes? Any help is greatly appreciated! Cheers, A. -- 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 athttp://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. -- 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] modifications to the toctree() template function
As I understand it, the toctree is built at compile time, not runtime. So normally it is built, then inserted into the html file. So the sidebars are built, then inserted. So what you are asking for would be quite complicated. I use a 'local' toctree in a similar manner to what you are asking, but it is only in the first/overview html file for each chunk. -Original Message- From: sphinx-dev@googlegroups.com [mailto:sphinx-...@googlegroups.com] On Behalf Of andreash Sent: 09 August 2010 09:57 To: sphinx-dev Subject: [sphinx-dev] modifications to the toctree() template function Hi there, I'm using Sphinx 1.0.1 to build some websites. While adapting the basic template to my needs, I stumbled upon the need to modify the toctree() template function to accomodate several things. Most importantly, I'd like to have toctree() an option to start at the level of the current document, and not at the root level. What I mean is this: root/ doc1/ doc2/ doc2.1/ doc2.2/ doc3/ So I'd like to have the option to render a sidebar menu which only contains the 'heading' doc2, and then the members doc2.1 and doc2.2. I was thinking about an option toctree(startatcurrent=True) to accomodate this ... Also, how do I get the title of and the link to the parent of the current document (to accomodate the 'heading' as descibed above)? I've been searching through the Sphinx code for quite some while, but couldn'r really figure out which functions/variables are available to the templates. What I did find out is that probably the code that I want is in environment.py. But how would I go to implement changes? Any help is greatly appreciated! Cheers, A. -- 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.
[sphinx-dev] sort order with Glob
Is it possible to tell glob to sort by document title rather than document name? -- 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] Using :glob:
I'd really like to mix using :glob: with manual entries in a toctree. Is this possible? It seems that the normal syntax is something like this: .. toctree:: :maxdepth: 2 :glob: dialoghelp/* I want to put some manual entries in before the entries inserted by glob, and have a title before the glob bit. Is this possible? -- 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] 'unknown directive'
I have an rst file with the following line: .. cfunction:: DAConf [options] [command [DA-id]] Building this results in the error message ERROR/3 Unknown directive type cfunction Why? -- 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] KeyError; 'test' with sphinx v1.0b2
I was building successfully using default setup. altered the html_theme to point to a custom theme and got the following error (build completed successfully, as far as I can tell). Exception occurred: File c:\Python26\lib\site-packages\sphinx-1.0b2-py2.6.egg\sphinx \environment.py, line 1031, in get_toc_for toc = self.tocs[docname].deepcopy() KeyError: 'test' I commented out my html_theme='csHelp' and added html_theme='default', then rebuilt. Same error. -- 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] Search Function Firefox on Linux (Centos+KDE)
We are testing out using Sphinx for a cross-platform app, and it looks ok on both Windows and Linux, apart from one wrinkle. The search function simply doesn't do anything on Linux. No error messages, just nothing. The same doc set works perfectly on windows xp and 7. I'm running CentOS 5 with KDE 3.5.4 and Konqueror 3.5.4 -- 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.