[sphinx-dev] Re: Output-format-dependent substitution
Thanks, Günter, I actually use latex_preamble = \\DeclareUnicodeCharacter{21E8}{\\ensuremath{\ \Rightarrow}} in my conf.py now. Cheers, Andreas. On 10 Jan., 11:44, Guenter Milde mi...@users.sf.net wrote: On 2012-01-09, andreash wrote: Hi Sphinx experts, how can I make a substitution depending on the output-format? Basically, I would like to have something like this:: if html: |CLICK| unicode:: U+21E8 elif latex: |CLICK| raw:: latex $\LongRightArrow$ Ugly workaround: .. |CLICK| raw:: latex $\LongRightArrow$ .. |CLACK| raw:: html ⇨ Now |CLICK|\ |CLACK| here! Another option would be to add a conversion for U+21E8 in the LaTeX preamble. The latex writer uses e.g. '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}', * I recommend \ensuremath{\LongRightArrow} to get this working in both text and math. * of course this requires that you use utf8 encoding for the latex source. * Untested! 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-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] Output-format-dependent substitution
Hi Sphinx experts, how can I make a substitution depending on the output-format? Basically, I would like to have something like this:: if html: |CLICK| unicode:: U+21E8 elif latex: |CLICK| raw:: latex $\LongRightArrow$ but I cannot seem to get the syntax right. Any help is greatly appreciated :) Andreas. -- 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] 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.
[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.
[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.
[sphinx-dev] Re: integrating pylit with sphinx
I solved this putting a find . -type f -name '*.py' -exec pylit.py {} \; in the makefile, at the beginning of each target definition. On Jun 1, 6:57 pm, andreash hilb...@gmail.com wrote: Hi there, I was wondering if there is an easy way to integrate pylit with sphinx? I would like to put my Python scripts somewhere inside my sphinx tree, and it would be great if sphinx (or rather, the makefile) would automatically call pylit for each .py file inside the tree which is referenced by a toctree element (toctree references myscript.py.txt = pylit myscript.py is called before sphinx-build) Any idea how to easily implement this? 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.
[sphinx-dev] integrating pylit with sphinx
Hi there, I was wondering if there is an easy way to integrate pylit with sphinx? I would like to put my Python scripts somewhere inside my sphinx tree, and it would be great if sphinx (or rather, the makefile) would automatically call pylit for each .py file inside the tree which is referenced by a toctree element (toctree references myscript.py.txt = pylit myscript.py is called before sphinx-build) Any idea how to easily implement this? 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.
[sphinx-dev] Re: How to include bibliography from BibTeX
Hi, thanks for pointing me towards that. From a first glance, bibstuff looks pretty promising. I'll look around docutils-dev to get going ... Cheers, Andreas. On May 31, 8:09 am, Guenter Milde mi...@users.berlios.de wrote: On 2010-05-30, andreash wrote: Hi there, I am using Zotero (http://www.zotero.org) to manage my bibliography database. Is there any way how I can include this bibliography into Sphinx? Especially in the HTML output ... I'm not necessarily looking for a way to actually use these items (although it would be nice); it would rather be sufficient to generate the bibliography, if possible with the BibTeX style of my choice ... If this is not possible, what would be the best way to implement this? The fastest way would be to export from the BibTeX database to HTML (see below for tools able to do this) and include (or link to) the resulting file. I'd really be interested in implementing this ... There is a TODO item for Docutils regarding citations: Citations: Collect citations that are referenced ... Citations can be: a) defined in the document as citation elements b) auto-generated from entries in a bibliographic database. + based on bibstuff_? + also have a look at * CrossTeX_, a backwards-compatible, improved bibtex re-implementation in Python (including HTML export). (development stalled since 2 years) * Pybtex_,a drop-in replacement for BibTeX written in Python. * BibTeX styles (experimental) pythonic style API. * Database in BibTeX, BibTeXML and YAML formats. * full Unicode support. * Write to TeX, HTML and plain text. * Automatically insert a References heading? .. _bibstuff:http://code.google.com/p/bibstuff/ .. _CrossTeX:http://www.cs.cornell.edu/people/egs/crosstex/ .. _Pybtex: http://pybtex.sourceforge.net/ Once this is solved in the Docutils core, it will be available for Sphinx too. 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.
[sphinx-dev] How to customize localization?
Is there any place where I can find out how to customize translations? What I did: * Create project-dir/locale/de/LC_MESSAGES * Create a file sphinx.po in that directory * Added locale_dirs = ['../locale'] to conf.py * put the following content in sphinx.po:: #: sphinx/themes/basic/layout.html:196 #, python-format msgid Created using a href=\http://sphinx.pocoo.org/\;Sphinx/a %(sphinx_version)s. msgstr Erstellt mit a href=\http://sphinx.pocoo.org/\;Sphinx/a %(sphinx_version)s. So obviously what I want to do is override some of the official translations for one project only. If now run ``make html``, nothing seems to happen. Sorry to have to ask this, but couldn't find it anywhere in the documentation ... Thanks for your insight, Andreas. -- 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] prevent TOCTREE from being displayed
Is there a way to prevent TOCTREEs from being displayed in HTML output? I'm using Sphinx 1.0 with the agogo theme, and would like to have the toctree in the sidebar only, not also somewhere in my documents' bodies. Thanks for you insight, Andreas. -- 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] How to link to internal documents, not to marks within a document
Hi there, I'm trying to build my website using Sphinx. So far, I linked from one page to another using :ref:. However, if the page I link to is larger than the screen, it is not shown from the top, but rather from the first headline (I placed the :ref: right in before the page's title). Is there any way to link to an internal document using a reference instead of a path, but the link pointing to the html document and not to the first anchor? Thanks, Andreas. -- 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] locale for last_updated timestamp
Hi there, I set ``language = 'de'`` and ``html_last_updated_fmt = '%d. %B %Y'`` in ``conf.py`` (Sphinx 1.0). Now I would expect that today's date is displayed as 15. März 2010, but instead it is dispayed as 15. March 2010. Why is that? My system's locale is set to de_de.UTF-8, if that has anything to do with it ... Thanks for your insight, Andreas. -- 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.
-interaction=nonstopmode in LaTeX build
Hey there, for a project I'm building the documentation automatically upon a commit using a post-commit hook (SVN). For this scenario it would be really nice to have the option of adding --interaction=nonstopmode to the latex commands. However, the Makefile seems to be re-written every time I run 'make latex' in the documentation root directory. How can i solve this? Thanks, Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
question regarding contents directive
Hey there, I have a question regarding the .. contents:: directive. My document roughly looks as follows: ** My Heading ** .. contents:: Übersicht First section = First subsection Second section == The problem is that in the contents, the heading of the document is also included: Übersicht * My Heading o First section + First subsection o Second section I think that's not really necessary, since the document is titled My Heading, and this is very big and visible on the top of the page. So my question is: How can I tell Sphinx that it shall not display the Heading in the contents directive? Thanks for your help, Andreas --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
placeholders not replaced in html_title
Hi there, I have a problem with html_title in conf.py. When I do not set html_title in conf.py, the title of the HTML pages is as I expect it to be. However, when I declare html_title = 'project Dokumentation :: SVN rev. version' the title of all my HTML documents becones project Dokumentation :: SVN rev. version I also already tried replacing the with ||, but that doesn't help either. What am I doing wrong here? Thanks a lot! Andreas PS: version = '62' release = '62' --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---