From 43407189207a06ee11ce55ce80de0bbe1f72d491 Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Thu, 3 Jun 2010 15:14:08 +0200 Subject: [PATCH 01/12] Remove external refuris from toc.ncx. --- sphinx/builders/epub.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 9767391e0..f99012bdd 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -195,6 +195,10 @@ class EpubBuilder(StandaloneHTMLBuilder): # XXX: is there a better way than checking the attribute # toctree-l[1-8] on the parent node? if isinstance(doctree, nodes.reference): + refuri = doctree['refuri'] + if refuri.startswith('http://') or refuri.startswith('https://') \ + or refuri.startswith('irc:') or refuri.startswith('mailto:'): + return result classes = doctree.parent.attributes['classes'] level = 1 for l in range(8, 0, -1): # or range(1, 8)? @@ -202,7 +206,7 @@ class EpubBuilder(StandaloneHTMLBuilder): level = l result.append({ 'level': level, - 'refuri': self.esc(doctree['refuri']), + 'refuri': self.esc(refuri), 'text': self.esc(doctree.astext()) }) else: From 55e322e22585b86ea8641d939e7019369f53ec9f Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Thu, 3 Jun 2010 15:32:46 +0200 Subject: [PATCH 02/12] Use smartypants for toc entries. --- sphinx/builders/epub.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index f99012bdd..db6ce05ad 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -20,6 +20,7 @@ from docutils.transforms import Transform from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.util.osutil import EEXIST +from sphinx.util.smartypants import sphinx_smarty_pants as ssp # (Fragment) templates from which the metainfo files content.opf, toc.ncx, @@ -207,7 +208,7 @@ class EpubBuilder(StandaloneHTMLBuilder): result.append({ 'level': level, 'refuri': self.esc(refuri), - 'text': self.esc(doctree.astext()) + 'text': ssp(self.esc(doctree.astext())) }) else: for elem in doctree.children: @@ -224,19 +225,20 @@ class EpubBuilder(StandaloneHTMLBuilder): self.refnodes.insert(0, { 'level': 1, 'refuri': self.esc(self.config.master_doc + '.html'), - 'text': self.esc(self.env.titles[self.config.master_doc].astext()) + 'text': ssp(self.esc( + self.env.titles[self.config.master_doc].astext())) }) for file, text in reversed(self.config.epub_pre_files): self.refnodes.insert(0, { 'level': 1, 'refuri': self.esc(file + '.html'), - 'text': self.esc(text) + 'text': ssp(self.esc(text)) }) for file, text in self.config.epub_post_files: self.refnodes.append({ 'level': 1, 'refuri': self.esc(file + '.html'), - 'text': self.esc(text) + 'text': ssp(self.esc(text)) }) From ef63485c6e6813b4cfd9ef74856c17b07919326c Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Thu, 3 Jun 2010 15:39:24 +0200 Subject: [PATCH 03/12] Added one more epub_exclude_file. --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index b268a13f0..e102c155d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -36,7 +36,7 @@ epub_scheme = 'url' epub_identifier = epub_publisher epub_pre_files = [('index', 'Welcome')] epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', - '_static/jquery.js', '_static/searchtools.js', + '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', '_static/basic.css', 'search.html'] latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation', From 87c3052bb4045fd9302ee469ccc09b818e3e7abd Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Thu, 3 Jun 2010 15:57:38 +0200 Subject: [PATCH 04/12] Added note for large floating divs to the documentation. --- doc/faq.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/faq.rst b/doc/faq.rst index 613283c5d..ff08c486d 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -134,6 +134,12 @@ some notes: and Bookworm_. For bookworm you can download the source from http://code.google.com/p/threepress/ and run your own local server. +* Large floating divs are not displayed properly. + If they cover more than one page, the div is only shown on the first page. + In that case you can copy the :file:`epub.css` from the + ``sphinx/themes/epub/static/`` directory to your local ``_static/`` + directory and remove the float settings. + .. _Epubcheck: http://code.google.com/p/epubcheck/ .. _Calibre: http://calibre-ebook.com/ .. _FBreader: http://www.fbreader.org/ From d54377153a8d2942dc9a9baf171dd8f5c40f2ff4 Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Mon, 7 Jun 2010 22:27:13 +0200 Subject: [PATCH 05/12] Only add refnodes with a class of 'toctree-l%d' to the toc.ncx file --- doc/config.rst | 4 ++-- doc/faq.rst | 4 ++++ sphinx/builders/epub.py | 17 ++++++++--------- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/doc/config.rst b/doc/config.rst index d968ce551..e9c98f1c2 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -766,8 +766,8 @@ the `Dublin Core metadata `_. .. confval:: epub_post_files Additional files that should be inserted after the text generated by Sphinx. - It is a list of tuples containing the file name and the title. The default - value is ``[]``. + It is a list of tuples containing the file name and the title. This option + can be used to add an appendix. The default value is ``[]``. .. confval:: epub_exclude_files diff --git a/doc/faq.rst b/doc/faq.rst index ff08c486d..5869e3af8 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -140,6 +140,10 @@ some notes: ``sphinx/themes/epub/static/`` directory to your local ``_static/`` directory and remove the float settings. +* Files that are inserted outside of the ``toctree`` directive must be manually + included. This sometimes applies to appendixes, e.g. the glossary or + the indices. You can add them with the :confval:`epub_post_files` option. + .. _Epubcheck: http://code.google.com/p/epubcheck/ .. _Calibre: http://calibre-ebook.com/ .. _FBreader: http://www.fbreader.org/ diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index db6ce05ad..47984be6b 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -201,15 +201,14 @@ class EpubBuilder(StandaloneHTMLBuilder): or refuri.startswith('irc:') or refuri.startswith('mailto:'): return result classes = doctree.parent.attributes['classes'] - level = 1 - for l in range(8, 0, -1): # or range(1, 8)? - if (_toctree_template % l) in classes: - level = l - result.append({ - 'level': level, - 'refuri': self.esc(refuri), - 'text': ssp(self.esc(doctree.astext())) - }) + for level in range(8, 0, -1): # or range(1, 8)? + if (_toctree_template % level) in classes: + result.append({ + 'level': level, + 'refuri': self.esc(refuri), + 'text': ssp(self.esc(doctree.astext())) + }) + break else: for elem in doctree.children: result = self.get_refnodes(elem, result) From 13adb67063b12d4960f368e5247ae3423c22654a Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Mon, 7 Jun 2010 22:28:48 +0200 Subject: [PATCH 06/12] Correct handling of extensions for extra files --- doc/conf.py | 2 +- sphinx/builders/epub.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index e102c155d..299f321ac 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -34,7 +34,7 @@ epub_author = 'Georg Brandl' epub_publisher = 'http://sphinx.pocoo.org/' epub_scheme = 'url' epub_identifier = epub_publisher -epub_pre_files = [('index', 'Welcome')] +epub_pre_files = [('index.html', 'Welcome')] epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', '_static/basic.css', 'search.html'] diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 47984be6b..fdfab7190 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -230,13 +230,13 @@ class EpubBuilder(StandaloneHTMLBuilder): for file, text in reversed(self.config.epub_pre_files): self.refnodes.insert(0, { 'level': 1, - 'refuri': self.esc(file + '.html'), + 'refuri': self.esc(file), 'text': ssp(self.esc(text)) }) for file, text in self.config.epub_post_files: self.refnodes.append({ 'level': 1, - 'refuri': self.esc(file + '.html'), + 'refuri': self.esc(file), 'text': ssp(self.esc(text)) }) From eb86c504b3a807e79badd2239297b44016b911f2 Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Mon, 7 Jun 2010 22:37:01 +0200 Subject: [PATCH 07/12] Disable VisibleLinksTransform because it may leak into the HTML generation. --- sphinx/builders/epub.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index fdfab7190..74c328ea7 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -125,7 +125,7 @@ _media_types = { class VisibleLinksTransform(Transform): """ - Add the link target of referances to the text, unless it is already + Add the link target of references to the text, unless it is already present in the description. """ @@ -171,7 +171,10 @@ class EpubBuilder(StandaloneHTMLBuilder): # the output files for epub must be .html only self.out_suffix = '.html' self.playorder = 0 - self.app.add_transform(VisibleLinksTransform) + # Disable transform until the issue with cached doctrees is solved. + # Building the html file after the epub file shows the + # visible links also in the HTML output. + #self.app.add_transform(VisibleLinksTransform) def get_theme_config(self): return self.config.epub_theme, {} From b2a237b8b4e613904965295129621d621cf28ecc Mon Sep 17 00:00:00 2001 From: Roland Meister Date: Wed, 30 Jun 2010 21:32:18 +0200 Subject: [PATCH 08/12] Omit nodes without refuri attribute from toc.ncx. This fixes bug report on sphinx-dev. --- sphinx/builders/epub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index 74c328ea7..a5f7a84d0 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -198,7 +198,7 @@ class EpubBuilder(StandaloneHTMLBuilder): """Collect section titles, their depth in the toc and the refuri.""" # XXX: is there a better way than checking the attribute # toctree-l[1-8] on the parent node? - if isinstance(doctree, nodes.reference): + if isinstance(doctree, nodes.reference) and hasattr(doctree, 'refuri'): refuri = doctree['refuri'] if refuri.startswith('http://') or refuri.startswith('https://') \ or refuri.startswith('irc:') or refuri.startswith('mailto:'): From fa120b01d5142d7e3a857d87eb5d76a7ae9b1cdb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 2 Jul 2010 10:41:40 +0200 Subject: [PATCH 09/12] Update of Brazilian portuguese message catalog, by Roger Demetrescu. --- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js | 2 +- sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo | Bin 8836 -> 10252 bytes sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po | 222 ++++++++++++---------- 3 files changed, 118 insertions(+), 106 deletions(-) diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js index dbfaab85f..312d0fc7a 100644 --- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "pt_BR", "plural_expr": "(n > 1)", "messages": {"Search Results": "Resultados da Pesquisa", "Preparing search...": "Preparando pesquisa...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sua pesquisa n\u00e3o encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que voc\u00ea tenha selecionado o m\u00ednimo de categorias.", "Search finished, found %s page(s) matching the search query.": "Pesquisa finalizada, foram encontrada(s) %s p\u00e1gina(s) que conferem com o crit\u00e9rio de pesquisa.", ", in ": ", em ", "Expand sidebar": "", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Collapse sidebar": "", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "Hide Search Matches": "Esconder Resultados da Pesquisa"}}); \ No newline at end of file +Documentation.addTranslations({"locale": "pt_BR", "plural_expr": "(n > 1)", "messages": {"Search Results": "Resultados da Pesquisa", "Preparing search...": "Preparando pesquisa...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Sua pesquisa n\u00e3o encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que voc\u00ea tenha selecionado o m\u00ednimo de categorias.", "Search finished, found %s page(s) matching the search query.": "Pesquisa finalizada, foram encontrada(s) %s p\u00e1gina(s) que conferem com o crit\u00e9rio de pesquisa.", ", in ": ", em ", "Expand sidebar": "Expandir painel lateral", "Permalink to this headline": "Link permanente para este t\u00edtulo", "Searching": "Pesquisando", "Collapse sidebar": "Recolher painel lateral", "Permalink to this definition": "Link permanente para esta defini\u00e7\u00e3o", "Hide Search Matches": "Esconder Resultados da Pesquisa"}}); \ No newline at end of file diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo index b644a1145202e2a8a398b14f873ae665beacd278..67c1ce549defc203511d37f64b4f4117ee3b9247 100644 GIT binary patch delta 4464 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 diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po index 44e2053a1..7df9013e7 100644 --- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Sphinx 0.5\n" "Report-Msgid-Bugs-To: roger.demetrescu@gmail.com\n" "POT-Creation-Date: 2008-11-09 19:46+0100\n" -"PO-Revision-Date: 2010-05-24 23:54+0200\n" +"PO-Revision-Date: 2010-06-20 18:34-0300\n" "Last-Translator: Roger Demetrescu \n" "Language-Team: pt_BR \n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" @@ -17,7 +17,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 0.9.4\n" -#: sphinx/environment.py:106 sphinx/writers/latex.py:184 +#: sphinx/environment.py:106 +#: sphinx/writers/latex.py:184 #: sphinx/writers/manpage.py:67 #, python-format msgid "%B %d, %Y" @@ -41,7 +42,8 @@ msgstr "Módulo" msgid "%b %d, %Y" msgstr "%d/%m/%Y" -#: sphinx/builders/html.py:285 sphinx/themes/basic/defindex.html:30 +#: sphinx/builders/html.py:285 +#: sphinx/themes/basic/defindex.html:30 msgid "General Index" msgstr "Índice Geral" @@ -70,9 +72,8 @@ msgid "Module author: " msgstr "Autor do módulo: " #: sphinx/directives/other.py:131 -#, fuzzy msgid "Code author: " -msgstr "Autor do módulo: " +msgstr "Autor do código: " #: sphinx/directives/other.py:133 msgid "Author: " @@ -85,18 +86,21 @@ msgstr "Veja também" #: sphinx/domains/__init__.py:253 #, python-format msgid "%s %s" -msgstr "" +msgstr "%s %s" -#: sphinx/domains/c.py:51 sphinx/domains/python.py:49 +#: sphinx/domains/c.py:51 +#: sphinx/domains/python.py:49 msgid "Parameters" msgstr "Parâmetros" -#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:137 +#: sphinx/domains/c.py:54 +#: sphinx/domains/javascript.py:137 #: sphinx/domains/python.py:59 msgid "Returns" msgstr "Retorna" -#: sphinx/domains/c.py:56 sphinx/domains/python.py:61 +#: sphinx/domains/c.py:56 +#: sphinx/domains/python.py:61 msgid "Return type" msgstr "Tipo de retorno" @@ -125,12 +129,15 @@ msgstr "%s (tipo C)" msgid "%s (C variable)" msgstr "%s (variável C)" -#: sphinx/domains/c.py:171 sphinx/domains/cpp.py:1031 -#: sphinx/domains/javascript.py:166 sphinx/domains/python.py:497 +#: sphinx/domains/c.py:171 +#: sphinx/domains/cpp.py:1031 +#: sphinx/domains/javascript.py:166 +#: sphinx/domains/python.py:497 msgid "function" msgstr "função" -#: sphinx/domains/c.py:172 sphinx/domains/cpp.py:1032 +#: sphinx/domains/c.py:172 +#: sphinx/domains/cpp.py:1032 msgid "member" msgstr "membro" @@ -138,14 +145,14 @@ msgstr "membro" msgid "macro" msgstr "macro" -#: sphinx/domains/c.py:174 sphinx/domains/cpp.py:1033 +#: sphinx/domains/c.py:174 +#: sphinx/domains/cpp.py:1033 msgid "type" msgstr "tipo" #: sphinx/domains/c.py:175 -#, fuzzy msgid "variable" -msgstr "Variável" +msgstr "variável" #: sphinx/domains/cpp.py:876 #, python-format @@ -167,16 +174,19 @@ msgstr "%s (membro C++)" msgid "%s (C++ function)" msgstr "%s (função C++)" -#: sphinx/domains/cpp.py:1030 sphinx/domains/python.py:499 +#: sphinx/domains/cpp.py:1030 +#: sphinx/domains/python.py:499 msgid "class" msgstr "classe" -#: sphinx/domains/javascript.py:117 sphinx/domains/python.py:221 +#: sphinx/domains/javascript.py:117 +#: sphinx/domains/python.py:221 #, python-format msgid "%s() (built-in function)" msgstr "%s() (função interna)" -#: sphinx/domains/javascript.py:118 sphinx/domains/python.py:285 +#: sphinx/domains/javascript.py:118 +#: sphinx/domains/python.py:285 #, python-format msgid "%s() (%s method)" msgstr "%s() (método %s)" @@ -184,41 +194,44 @@ msgstr "%s() (método %s)" #: sphinx/domains/javascript.py:120 #, python-format msgid "%s (global variable or constant)" -msgstr "" +msgstr "%s (variável global ou constante)" -#: sphinx/domains/javascript.py:122 sphinx/domains/python.py:323 +#: sphinx/domains/javascript.py:122 +#: sphinx/domains/python.py:323 #, python-format msgid "%s (%s attribute)" msgstr "%s (atributo %s)" #: sphinx/domains/javascript.py:131 -#, fuzzy msgid "Arguments" msgstr "Parâmetros" #: sphinx/domains/javascript.py:134 msgid "Throws" -msgstr "" +msgstr "Gera" -#: sphinx/domains/javascript.py:167 sphinx/domains/python.py:498 +#: sphinx/domains/javascript.py:167 +#: sphinx/domains/python.py:498 msgid "data" -msgstr "" +msgstr "dado" -#: sphinx/domains/javascript.py:168 sphinx/domains/python.py:504 +#: sphinx/domains/javascript.py:168 +#: sphinx/domains/python.py:504 msgid "attribute" msgstr "atributo" #: sphinx/domains/python.py:53 -#, fuzzy msgid "Variables" -msgstr "Variável" +msgstr "Variáveis" #: sphinx/domains/python.py:56 msgid "Raises" msgstr "Levanta" -#: sphinx/domains/python.py:222 sphinx/domains/python.py:279 -#: sphinx/domains/python.py:291 sphinx/domains/python.py:304 +#: sphinx/domains/python.py:222 +#: sphinx/domains/python.py:279 +#: sphinx/domains/python.py:291 +#: sphinx/domains/python.py:304 #, python-format msgid "%s() (in module %s)" msgstr "%s() (no módulo %s)" @@ -228,7 +241,8 @@ msgstr "%s() (no módulo %s)" msgid "%s (built-in variable)" msgstr "%s (variável interna)" -#: sphinx/domains/python.py:226 sphinx/domains/python.py:317 +#: sphinx/domains/python.py:226 +#: sphinx/domains/python.py:317 #, python-format msgid "%s (in module %s)" msgstr "%s (no módulo %s)" @@ -259,14 +273,14 @@ msgid "%s() (%s static method)" msgstr "%s() (método estático %s)" #: sphinx/domains/python.py:308 -#, fuzzy, python-format +#, python-format msgid "%s() (%s.%s class method)" -msgstr "%s() (método %s.%s)" +msgstr "%s() (método de classe %s.%s)" #: sphinx/domains/python.py:311 -#, fuzzy, python-format +#, python-format msgid "%s() (%s class method)" -msgstr "%s() (método %s)" +msgstr "%s() (método de classe %s)" #: sphinx/domains/python.py:321 #, python-format @@ -283,9 +297,8 @@ msgid "%s (module)" msgstr "%s (módulo)" #: sphinx/domains/python.py:429 -#, fuzzy msgid "Python Module Index" -msgstr "Índice do Módulo" +msgstr "Índice de Módulos do Python" #: sphinx/domains/python.py:430 msgid "modules" @@ -295,47 +308,49 @@ msgstr "módulos" msgid "Deprecated" msgstr "Obsoleto" -#: sphinx/domains/python.py:500 sphinx/locale/__init__.py:162 +#: sphinx/domains/python.py:500 +#: sphinx/locale/__init__.py:162 msgid "exception" msgstr "exceção" #: sphinx/domains/python.py:501 msgid "method" -msgstr "" +msgstr "método" #: sphinx/domains/python.py:502 -#, fuzzy, python-format +#, python-format msgid "class method" -msgstr "%s() (método %s)" +msgstr "método de classe" #: sphinx/domains/python.py:503 msgid "static method" msgstr "método estático" -#: sphinx/domains/python.py:505 sphinx/locale/__init__.py:158 +#: sphinx/domains/python.py:505 +#: sphinx/locale/__init__.py:158 msgid "module" msgstr "módulo" #: sphinx/domains/rst.py:53 #, python-format msgid "%s (directive)" -msgstr "" +msgstr "%s (diretiva)" #: sphinx/domains/rst.py:55 -#, fuzzy, python-format +#, python-format msgid "%s (role)" -msgstr "%s (módulo)" +msgstr "%s (papel)" #: sphinx/domains/rst.py:103 msgid "directive" -msgstr "" +msgstr "diretiva" #: sphinx/domains/rst.py:104 -#, fuzzy msgid "role" -msgstr "módulo" +msgstr "papel" -#: sphinx/domains/std.py:68 sphinx/domains/std.py:84 +#: sphinx/domains/std.py:68 +#: sphinx/domains/std.py:84 #, python-format msgid "environment variable; %s" msgstr "váriavel de ambiente; %s" @@ -347,15 +362,15 @@ msgstr "%sopção de linha de comando; %s" #: sphinx/domains/std.py:328 msgid "glossary term" -msgstr "" +msgstr "Termo de glossário" #: sphinx/domains/std.py:329 msgid "grammar token" -msgstr "" +msgstr "token de gramática" #: sphinx/domains/std.py:330 msgid "reference label" -msgstr "" +msgstr "rótulo de referência" #: sphinx/domains/std.py:331 msgid "environment variable" @@ -363,13 +378,16 @@ msgstr "váriavel de ambiente" #: sphinx/domains/std.py:332 msgid "program option" -msgstr "" +msgstr "opção de programa" -#: sphinx/domains/std.py:360 sphinx/themes/basic/genindex-single.html:11 +#: sphinx/domains/std.py:360 +#: sphinx/themes/basic/genindex-single.html:11 #: sphinx/themes/basic/genindex-split.html:11 #: sphinx/themes/basic/genindex-split.html:14 -#: sphinx/themes/basic/genindex.html:11 sphinx/themes/basic/genindex.html:14 -#: sphinx/themes/basic/genindex.html:50 sphinx/themes/basic/layout.html:125 +#: sphinx/themes/basic/genindex.html:11 +#: sphinx/themes/basic/genindex.html:14 +#: sphinx/themes/basic/genindex.html:50 +#: sphinx/themes/basic/layout.html:125 #: sphinx/writers/latex.py:173 msgid "Index" msgstr "Índice" @@ -378,19 +396,20 @@ msgstr "Índice" msgid "Module Index" msgstr "Índice do Módulo" -#: sphinx/domains/std.py:362 sphinx/themes/basic/defindex.html:25 +#: sphinx/domains/std.py:362 +#: sphinx/themes/basic/defindex.html:25 msgid "Search Page" msgstr "Página de Pesquisa" #: sphinx/ext/autodoc.py:917 #, python-format msgid " Bases: %s" -msgstr "" +msgstr " Bases: %s" #: sphinx/ext/autodoc.py:950 #, python-format msgid "alias of :class:`%s`" -msgstr "" +msgstr "apelido de :class:`%s`" #: sphinx/ext/todo.py:41 msgid "Todo" @@ -407,29 +426,28 @@ msgstr "entrada original" #: sphinx/ext/viewcode.py:66 msgid "[source]" -msgstr "" +msgstr "[código fonte]" #: sphinx/ext/viewcode.py:109 msgid "[docs]" -msgstr "" +msgstr "[documentos]" #: sphinx/ext/viewcode.py:123 -#, fuzzy msgid "Module code" -msgstr "módulo" +msgstr "Código do módulo" #: sphinx/ext/viewcode.py:129 #, python-format msgid "

Source code for %s

" -msgstr "" +msgstr "

Código fonte de %s

" #: sphinx/ext/viewcode.py:156 msgid "Overview: module code" -msgstr "" +msgstr "Visão geral: código do módulo" #: sphinx/ext/viewcode.py:157 msgid "

All modules for which code is available

" -msgstr "" +msgstr "

Todos os módulos onde este código está disponível

" #: sphinx/locale/__init__.py:139 msgid "Attention" @@ -506,26 +524,31 @@ msgstr "comando" msgid "built-in function" msgstr "função interna" -#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 +#: sphinx/themes/agogo/layout.html:45 +#: sphinx/themes/basic/globaltoc.html:10 #: sphinx/themes/basic/localtoc.html:11 msgid "Table Of Contents" msgstr "Tabela de Conteúdo" -#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:128 -#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:14 +#: sphinx/themes/agogo/layout.html:49 +#: sphinx/themes/basic/layout.html:128 +#: sphinx/themes/basic/search.html:11 +#: sphinx/themes/basic/search.html:14 msgid "Search" msgstr "Pesquisar" -#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15 +#: sphinx/themes/agogo/layout.html:52 +#: sphinx/themes/basic/searchbox.html:15 msgid "Go" msgstr "Ir" -#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20 -#, fuzzy +#: sphinx/themes/agogo/layout.html:57 +#: sphinx/themes/basic/searchbox.html:20 msgid "Enter search terms or a module, class or function name." -msgstr "Informe o nome de um módulo, classe ou função." +msgstr "Digite os termos da busca ou o nome de um módulo, classe ou função." -#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 +#: sphinx/themes/agogo/layout.html:78 +#: sphinx/themes/basic/sourcelink.html:14 msgid "Show Source" msgstr "Exibir Fonte" @@ -615,12 +638,8 @@ msgstr "Última atualização em %(last_updated)s." #: sphinx/themes/basic/layout.html:189 #, python-format -msgid "" -"Created using Sphinx " -"%(sphinx_version)s." -msgstr "" -"Criado com Sphinx " -"%(sphinx_version)s." +msgid "Created using Sphinx %(sphinx_version)s." +msgstr "Criado com Sphinx %(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 #, python-format @@ -647,10 +666,9 @@ msgstr "próximo capítulo" msgid "" "Please activate JavaScript to enable the search\n" " functionality." -msgstr "" +msgstr "Por favor ative o JavaScript para habilitar a funcionalidade de pesquisa." #: sphinx/themes/basic/search.html:23 -#, fuzzy msgid "" "From here you can search these documents. Enter your search\n" " words into the box below and click \"search\". Note that the search\n" @@ -658,11 +676,9 @@ msgid "" " containing fewer words won't appear in the result list." msgstr "" "A partir daqui você pode pesquisar estes documentos. Preencha suas \n" -" palavras de pesquisa na caixa abaixo e clique em \"pesquisar\". " -"Observe que a função de pesquisa\n" +" palavras de pesquisa na caixa abaixo e clique em \"pesquisar\". Observe que a função de pesquisa\n" " irá pesquisar automaticamente por todas as palavras.\n" -" Páginas contendo menos palavras não irão aparecer na lista de " -"resultado." +" Páginas contendo menos palavras não irão aparecer na lista de resultado." #: sphinx/themes/basic/search.html:30 msgid "search" @@ -713,12 +729,14 @@ msgstr "Alterações na API C" msgid "Other changes" msgstr "Outras alterações" -#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:482 +#: sphinx/themes/basic/static/doctools.js:154 +#: sphinx/writers/html.py:482 #: sphinx/writers/html.py:487 msgid "Permalink to this headline" msgstr "Link permanente para este título" -#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:87 +#: sphinx/themes/basic/static/doctools.js:160 +#: sphinx/writers/html.py:87 msgid "Permalink to this definition" msgstr "Link permanente para esta definição" @@ -739,51 +757,45 @@ msgid ", in " msgstr ", em " #: sphinx/themes/basic/static/searchtools.js:491 -msgid "" -"Your search did not match any documents. Please make sure that all words " -"are spelled correctly and that you've selected enough categories." -msgstr "" -"Sua pesquisa não encontrou nenhum documento. Por favor assegure-se de que" -" todas as palavras foram digitadas corretamente e de que você tenha " -"selecionado o mínimo de categorias." +msgid "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." +msgstr "Sua pesquisa não encontrou nenhum documento. Por favor assegure-se de que todas as palavras foram digitadas corretamente e de que você tenha selecionado o mínimo de categorias." #: sphinx/themes/basic/static/searchtools.js:493 #, python-format msgid "Search finished, found %s page(s) matching the search query." -msgstr "" -"Pesquisa finalizada, foram encontrada(s) %s página(s) que conferem com o " -"critério de pesquisa." +msgstr "Pesquisa finalizada, foram encontrada(s) %s página(s) que conferem com o critério de pesquisa." #: sphinx/themes/default/static/sidebar.js:66 msgid "Expand sidebar" -msgstr "" +msgstr "Expandir painel lateral" #: sphinx/themes/default/static/sidebar.js:79 #: sphinx/themes/default/static/sidebar.js:106 msgid "Collapse sidebar" -msgstr "" +msgstr "Recolher painel lateral" #: sphinx/themes/haiku/layout.html:26 msgid "Contents" -msgstr "" +msgstr "Conteúdo" #: sphinx/writers/latex.py:171 msgid "Release" msgstr "Versão" -#: sphinx/writers/latex.py:572 sphinx/writers/manpage.py:178 +#: sphinx/writers/latex.py:572 +#: sphinx/writers/manpage.py:178 msgid "Footnotes" -msgstr "" +msgstr "Notas de rodapé" #: sphinx/writers/latex.py:641 msgid "continued from previous page" -msgstr "" +msgstr "continuação da página anterior" #: sphinx/writers/latex.py:646 -#, fuzzy msgid "Continued on next page" -msgstr "Índice completo em uma página" +msgstr "Continua na próxima página" #: sphinx/writers/text.py:422 msgid "[image]" msgstr "[imagem]" + From 28fc52559c07f9287a1f198da27a6548e50f1344 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 2 Jul 2010 11:44:01 +0200 Subject: [PATCH 10/12] Activate oldcmarkup by default, but warn when the markup is used. --- CHANGES | 7 ++++--- sphinx/application.py | 4 +++- sphinx/ext/oldcmarkup.py | 11 +++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 4be9eed82..fb5d0b3c7 100644 --- a/CHANGES +++ b/CHANGES @@ -15,9 +15,10 @@ Incompatible changes - JavaScript - reStructuredText -* The old markup for defining and linking to C directives will not work - anymore without activating the :mod:`~sphinx.ext.oldcmarkup` - extension. +* The old markup for defining and linking to C directives is now + deprecated. It will not work anymore in future versions without + activating the :mod:`~sphinx.ext.oldcmarkup` extension; in Sphinx + 1.0, it is activated by default. * Removed support for old dependency versions; requirements are now: diff --git a/sphinx/application.py b/sphinx/application.py index 3ffd86c26..97778d3fb 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -109,7 +109,9 @@ class Sphinx(object): if self.confdir is None: self.confdir = self.srcdir - # load all extension modules + # backwards compatibility: activate old C markup + self.setup_extension('sphinx.ext.oldcmarkup') + # load all user-given extension modules for extension in self.config.extensions: self.setup_extension(extension) # the config file itself can be an extension diff --git a/sphinx/ext/oldcmarkup.py b/sphinx/ext/oldcmarkup.py index 62f5ee28d..c2172b088 100644 --- a/sphinx/ext/oldcmarkup.py +++ b/sphinx/ext/oldcmarkup.py @@ -13,6 +13,10 @@ from docutils.parsers.rst import directives from sphinx.util.compat import Directive +_warned_oldcmarkup = False +WARNING_MSG = 'using old C markup; please migrate to new-style markup ' \ + '(e.g. c:function instead of cfunction), see ' \ + 'http://sphinx.pocoo.org/domains.html' class OldCDirective(Directive): has_content = True @@ -26,6 +30,9 @@ class OldCDirective(Directive): def run(self): env = self.state.document.settings.env + if not env.app._oldcmarkup_warned: + env.warn(env.docname, WARNING_MSG, self.lineno) + env.app._oldcmarkup_warned = True newname = 'c:' + self.name[1:] newdir = env.lookup_domain_element('directive', newname)[0] return newdir(newname, self.arguments, self.options, @@ -35,12 +42,16 @@ class OldCDirective(Directive): def old_crole(typ, rawtext, text, lineno, inliner, options={}, content=[]): env = inliner.document.settings.env + if not env.app._oldcmarkup_warned: + env.warn(env.docname, WARNING_MSG) + env.app._oldcmarkup_warned = True newtyp = 'c:' + typ[1:] newrole = env.lookup_domain_element('role', newtyp)[0] return newrole(newtyp, rawtext, text, lineno, inliner, options, content) def setup(app): + app._oldcmarkup_warned = False app.add_directive('cfunction', OldCDirective) app.add_directive('cmember', OldCDirective) app.add_directive('cmacro', OldCDirective) From 2cbaded7019ce7a1e641aaa5f444daf1375275dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Neuh=C3=A4user?= Date: Fri, 2 Jul 2010 16:44:05 +0200 Subject: [PATCH 11/12] Add test for oldcmarkup warning --- tests/test_build_html.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_build_html.py b/tests/test_build_html.py index fe249f44a..a1d993570 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -39,6 +39,9 @@ http://www.python.org/logo.png reading included file u'wrongenc.inc' seems to be wrong, try giving an \ :encoding: option %(root)s/includes.txt:4: WARNING: download file not readable: nonexisting.png +%(root)s/objects.txt:79: WARNING: using old C markup; please migrate to \ +new-style markup \(e.g. c:function instead of cfunction\), see \ +http://sphinx.pocoo.org/domains.html """ HTML_WARNINGS = ENV_WARNINGS + """\ From b57c71b78498d57c6e7270455525f0f6d5458e06 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 3 Jul 2010 10:28:28 +0200 Subject: [PATCH 12/12] Small logic fix to work around precedence bug in Jinja 2.1.x. --- sphinx/themes/basic/layout.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 1dac66938..e31e85443 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -14,7 +14,7 @@ {%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} {%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} {%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and - (not sidebars == []) %} + (sidebars != []) %} {%- set url_root = pathto('', 1) %} {%- if url_root == '#' %}{% set url_root = '' %}{% endif %}