From ff3707e2a5baa99df0cc6fb82f8b1826e9aca37a Mon Sep 17 00:00:00 2001 From: tpowers Date: Sun, 28 Mar 2010 19:07:14 -0700 Subject: [PATCH 1/5] Implemented html_compact_lists conf.py option. Normally True. When False, "simple" item lists are not compacted. See http://docutils.sourceforge.net/FAQ.html#how-are-lists-formatted-in-html. Bullet lists like the "Indices and Tables" section look odd when they are not compacted. Therefore specially change any bullet list that only has paragraph's with pending_xrefs to use compact paragraphs instead. Implemented secnumber_suffix conf.py option. Default is '. '. Section numbers look better if changed to u'\u00a0\u00a0'. --- .hgignore | 1 + sphinx/builders/__init__.py | 13 ++++++++ sphinx/config.py | 4 ++- sphinx/environment.py | 64 +++++++++++++++++++++++++++++++++++++ sphinx/writers/html.py | 10 ++++-- 5 files changed, 88 insertions(+), 4 deletions(-) diff --git a/.hgignore b/.hgignore index 7bd2ee92f..3d74ec1c7 100644 --- a/.hgignore +++ b/.hgignore @@ -11,3 +11,4 @@ TAGS \.ropeproject/ ^env/ \.DS_Store$ +~$ diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 32236a667..71b05dcce 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -300,6 +300,19 @@ class Builder(object): else: self.info('none found') + #%%%%% Don't know where else to put this??? Change + #env.settings since that seems to be the only way to change + #the StandaloneHTMLBuilder(Builder)'s docsettings. These + #docsettings are stored in doctree.settings, which eventually + #get passed to HTMLWriter, which actually creates + #docutils/writers/html4css1/__init__.py/HTMLTranslator(nodes.NodeVisitor). + #It's here that these settings are then used to configure the + #actual HTML output. + if self.config.html_compact_lists: + self.env.settings['compact_lists'] = 1 + else: + self.env.settings['compact_lists'] = 0 + if updated_docnames: # save the environment self.info(bold('pickling environment... '), nonl=True) diff --git a/sphinx/config.py b/sphinx/config.py index b81958df5..0eeefda01 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -61,7 +61,8 @@ class Config(object): rst_epilog = (None, 'env'), trim_doctest_flags = (True, 'env'), needs_sphinx = (None, None), - + secnumber_suffix = ('. ', 'html'), + # HTML options html_theme = ('default', 'html'), html_theme_path = ([], 'html'), @@ -93,6 +94,7 @@ class Config(object): html_show_sphinx = (True, 'html'), html_context = ({}, 'html'), html_output_encoding = ('utf-8', 'html'), + html_compact_lists = (True, 'html'), # HTML help only options htmlhelp_basename = (lambda self: make_filename(self.project), None), diff --git a/sphinx/environment.py b/sphinx/environment.py index 99cd47bbe..2730fdc13 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -612,6 +612,7 @@ class BuildEnvironment: self.process_images(docname, doctree) self.process_downloads(docname, doctree) self.process_metadata(docname, doctree) + self.process_refonly_bullet_lists(docname, doctree) self.create_title_from(docname, doctree) self.note_labels_from(docname, doctree) self.note_indexentries_from(docname, doctree) @@ -781,6 +782,69 @@ class BuildEnvironment: md[name.astext()] = body.astext() del doctree[0] + def process_refonly_bullet_lists(self, docname, doctree): + """Change refonly bullet lists to use compact_paragraphs. + + Specifically implemented for 'Indices and Tables' section, which + looks odd in --no-compact-lists mode. + + """ + if self.config.html_compact_lists: + return + + class RefOnlyListChecker(nodes.GenericNodeVisitor): + """Raise `nodes.NodeFound` if non-simple list item is + encountered. + + Here 'simple' means a list item containing only a paragraph + with a single reference in it. + + """ + def default_visit(self, node): + raise nodes.NodeFound + + def visit_bullet_list(self, node): + pass + + def visit_list_item(self, node): + children = [] + for child in node.children: + if not isinstance(child, nodes.Invisible): + children.append(child) + if len(children) != 1: + raise nodes.NodeFound + if not isinstance(children[0], nodes.paragraph): + raise nodes.NodeFound + para = children[0] + if len(para) != 1: + raise nodes.NodeFound + if not isinstance(para[0], addnodes.pending_xref): + raise nodes.NodeFound + raise nodes.SkipChildren + + def invisible_visit(self, node): + """Invisible nodes should be ignored.""" + pass + + def check_refonly_list(node): + """Check for list with only references in it.""" + visitor = RefOnlyListChecker(doctree) + try: + node.walk(visitor) + except nodes.NodeFound: + return None + else: + return 1 + + for node in doctree.traverse(nodes.bullet_list): + if check_refonly_list(node): + for item in node.traverse(nodes.list_item): + para = item[0] + ref = para[0] + compact_para = addnodes.compact_paragraph() + compact_para += ref + item.replace(para, compact_para) + def create_title_from(self, docname, document): """ Add a title node to the document (just copy the first section title), diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 320463e2c..d072a86d8 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -59,6 +59,7 @@ class HTMLTranslator(BaseTranslator): self.highlightlinenothreshold = sys.maxint self.protect_literal_text = 0 self.add_permalinks = builder.config.html_add_permalinks + self.secnumber_suffix = builder.config.secnumber_suffix def visit_start_of_file(self, node): # only occurs in the single-file builder @@ -165,7 +166,8 @@ class HTMLTranslator(BaseTranslator): self.body[-1] = ' Date: Tue, 30 Mar 2010 05:13:42 -0700 Subject: [PATCH 2/5] Implemented rst_prologue conf.py option. --- sphinx/config.py | 1 + sphinx/environment.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sphinx/config.py b/sphinx/config.py index 0eeefda01..f6a412da2 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -59,6 +59,7 @@ class Config(object): keep_warnings = (False, 'env'), modindex_common_prefix = ([], 'html'), rst_epilog = (None, 'env'), + rst_prologue = (None, 'env'), trim_doctest_flags = (True, 'env'), needs_sphinx = (None, None), secnumber_suffix = ('. ', 'html'), diff --git a/sphinx/environment.py b/sphinx/environment.py index 2730fdc13..c3805063e 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -589,9 +589,10 @@ class BuildEnvironment: app.emit('source-read', docname, arg) data = arg[0] if self.config.rst_epilog: - return data + '\n' + self.config.rst_epilog + '\n' - else: - return data + data = data + '\n' + self.config.rst_epilog + '\n' + if self.config.rst_prologue: + data = self.config.rst_prologue + '\n' + data + return data # publish manually pub = Publisher(reader=SphinxStandaloneReader(), From 3a61ec646f62dd3efa44bcd5caad4aabdfe980fb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 7 Apr 2010 11:29:32 +0200 Subject: [PATCH 3/5] #349: Add Turkish translation, thanks to Firat Ozgul. --- CHANGES | 2 + doc/config.rst | 1 + sphinx/locale/tr/LC_MESSAGES/sphinx.js | 1 + sphinx/locale/tr/LC_MESSAGES/sphinx.mo | Bin 0 -> 8333 bytes sphinx/locale/tr/LC_MESSAGES/sphinx.po | 618 +++++++++++++++++++++++++ 5 files changed, 622 insertions(+) create mode 100644 sphinx/locale/tr/LC_MESSAGES/sphinx.js create mode 100644 sphinx/locale/tr/LC_MESSAGES/sphinx.mo create mode 100644 sphinx/locale/tr/LC_MESSAGES/sphinx.po diff --git a/CHANGES b/CHANGES index 6f63ccc22..96a83a3e4 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,8 @@ Release 1.0 (in development) * Sphinx now requires Jinja2 version 2.2 or greater. +* Added Turkish translation, thanks to Firat Ozgul. + * Added ``needs_sphinx`` config value and ``Sphinx.require_sphinx`` application API function. diff --git a/doc/config.rst b/doc/config.rst index 6d0563e09..ed9063a28 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -280,6 +280,7 @@ Project information * ``pt_BR`` -- Brazilian Portuguese * ``ru`` -- Russian * ``sl`` -- Slovenian + * ``tr`` -- Turkish * ``uk_UA`` -- Ukrainian * ``zh_CN`` -- Simplified Chinese * ``zh_TW`` -- Traditional Chinese diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.js b/sphinx/locale/tr/LC_MESSAGES/sphinx.js new file mode 100644 index 000000000..e5898d54f --- /dev/null +++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.js @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "tr", "plural_expr": "0", "messages": {"Search Results": "Arama Sonu\u00e7lar\u0131", "Preparing search...": "Aramaya haz\u0131rlan\u0131yor...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Arama sonucunda hi\u00e7bir belge bulunamad\u0131. B\u00fct\u00fcn kelimeleri do\u011fru yazd\u0131\u011f\u0131n\u0131zda ve yeterli kategori se\u00e7imi yapt\u0131\u011f\u0131n\u0131zdan emin olun.", "Search finished, found %s page(s) matching the search query.": "Arama sonu\u00e7land\u0131, aramayla e\u015fle\u015fen %s sayfa bulundu.", ", in ": ", \u015funun i\u00e7inde:", "Permalink to this headline": "Bu ba\u015fl\u0131\u011f\u0131n kal\u0131c\u0131 ba\u011flant\u0131s\u0131", "Searching": "Ar\u0131yor", "Permalink to this definition": "Bu tan\u0131m\u0131n kal\u0131c\u0131 ba\u011flant\u0131s\u0131", "module, in ": "mod\u00fcl \u015funun i\u00e7inde:", "Hide Search Matches": "Arama Sonu\u00e7lar\u0131n\u0131 Gizle"}}); \ No newline at end of file diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo new file mode 100644 index 0000000000000000000000000000000000000000..c783e66b3df633a22e5518f5303761b496ff2f03 GIT binary patch literal 8333 zcmcJT3yfXIS%9a|^s#|7gwjU}>C|QIHSxV(8{;?|$7H?hSL?^(-84j1YR|oQcJJvu zkDK#Y`>xa?1*H{j6ojf4S)^SGDpm`GtXiy!E={FfgQ`|S0xA?CflvW~fEHSz3K9vv ze`e0z>-82PB&_v*=ggV;=b!&IGy7Nfy!zvce^2rM$N9hS)$+FW@9684`XOE)hIhbs z!Ci0;z8)5VAAmo?`-kBh;WhXM_&k*HUxq&nzXtDwFNN=a2Y;0Je}`{^uSe+JP(zV- z080Ov(0&2FnfJ?3#$AQ?!e`)H;Pue{75G-({~R8M--2(4<6}zwEIa{aJx{|QgCB)- zQJ;pWqJA45gI@^m--V+8EAX{&45eh;J@62mfTG6}P}Xr3io9Qj7vMGc8u*V85$a#z z+u+Oa0r+N&B>G%{GVW0^+N+eh1V!FuCYSlI@JrVHH2eX0ExbPm#dR-08UOoGof#Q!iynhhNe7^({rJjXix96bD{~0Lb zeh*4q{Q(sF`~{SGz5`jh`Y(7K-bt{CUgsfAss-N(pM=u?<52AP8&K^3St#Sz!uubF z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mv@^%>Pm@bTPft=y>k&KTINL!wXm^1$k^oilzb@+k|JSK;D}RiI)1sbxHf;f z!)3U-73F^0^h+U|S#wj@WnrY~bh6FWyb|?C${$il%YoeQV>}&hQ|=HEC6Uxlg0`-e z9sY1=6WLJN#zW+|@)Xpux%{Cn(mU&<-pds%N}f<*<1bB*(j)3l-Esx1>*a6q&BW+J&laP#=6_^UFlcEmW$<3981ULTxkr-D#vnu5OfsG|J^}MzIRG?cC$PO7Xz6vX|GarE!HT s_}hug_l@iIQfdx+)mjbZS=|k}NP6B}jS?l{JaWupE0LBCH8N5E4Zfwm=>Px# literal 0 HcmV?d00001 diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.po b/sphinx/locale/tr/LC_MESSAGES/sphinx.po new file mode 100644 index 000000000..f24efdcb3 --- /dev/null +++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.po @@ -0,0 +1,618 @@ +# Translations template for Sphinx. +# Copyright (C) 2009 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# FIRST AUTHOR , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.6.2+/6b02a19ccf31\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2009-08-06 22:48+0200\n" +"PO-Revision-Date: 2010-03-07 16:01+0200\n" +"Last-Translator: Firat Ozgul \n" +"Language-Team: Turkish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 0.9.4\n" + +#: sphinx/environment.py:103 +#: sphinx/writers/latex.py:182 +#, python-format +msgid "%B %d, %Y" +msgstr "%d %B %Y" + +#: sphinx/environment.py:324 +#: sphinx/themes/basic/genindex-single.html:2 +#: sphinx/themes/basic/genindex-split.html:2 +#: sphinx/themes/basic/genindex-split.html:5 +#: sphinx/themes/basic/genindex.html:2 +#: sphinx/themes/basic/genindex.html:5 +#: sphinx/themes/basic/genindex.html:48 +#: sphinx/themes/basic/layout.html:131 +#: sphinx/writers/latex.py:188 +msgid "Index" +msgstr "Dizin" + +#: sphinx/environment.py:325 +#: sphinx/writers/latex.py:187 +msgid "Module Index" +msgstr "Modül Dizini" + +#: sphinx/environment.py:326 +#: sphinx/themes/basic/defindex.html:16 +msgid "Search Page" +msgstr "Arama Sayfası" + +#: sphinx/roles.py:55 +#: sphinx/directives/desc.py:747 +#, python-format +msgid "environment variable; %s" +msgstr "çevre değişkeni; %s" + +#: sphinx/roles.py:62 +#, python-format +msgid "Python Enhancement Proposals!PEP %s" +msgstr "Python'u İyileştirme Önerileri!PEP %s" + +#: sphinx/builders/changes.py:71 +msgid "Builtins" +msgstr "Gömülü" + +#: sphinx/builders/changes.py:73 +msgid "Module level" +msgstr "Modül düzeyi" + +#: sphinx/builders/html.py:205 +#, python-format +msgid "%b %d, %Y" +msgstr "%d %b %Y" + +#: sphinx/builders/html.py:224 +#: sphinx/themes/basic/defindex.html:21 +msgid "General Index" +msgstr "Genel Dizin" + +#: sphinx/builders/html.py:224 +msgid "index" +msgstr "dizin" + +#: sphinx/builders/html.py:226 +#: sphinx/builders/htmlhelp.py:219 +#: sphinx/builders/qthelp.py:133 +#: sphinx/themes/basic/defindex.html:19 +#: sphinx/themes/basic/modindex.html:2 +#: sphinx/themes/basic/modindex.html:13 +msgid "Global Module Index" +msgstr "Global Modül Dizini" + +#: sphinx/builders/html.py:227 +msgid "modules" +msgstr "modüller" + +#: sphinx/builders/html.py:281 +msgid "next" +msgstr "sonraki" + +#: sphinx/builders/html.py:290 +msgid "previous" +msgstr "önceki" + +#: sphinx/builders/latex.py:162 +msgid " (in " +msgstr " (şunun içinde: " + +#: sphinx/directives/desc.py:97 +msgid "Raises" +msgstr "Şunu üretir:" + +#: sphinx/directives/desc.py:101 +msgid "Variable" +msgstr "Değişken" + +#: sphinx/directives/desc.py:104 +msgid "Returns" +msgstr "Şunu döndürür:" + +#: sphinx/directives/desc.py:113 +msgid "Return type" +msgstr "Dönüş tipi" + +#: sphinx/directives/desc.py:186 +msgid "Parameter" +msgstr "Parametre" + +#: sphinx/directives/desc.py:190 +msgid "Parameters" +msgstr "Parametreler" + +#: sphinx/directives/desc.py:418 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (gömülü fonksiyon)" + +#: sphinx/directives/desc.py:419 +#: sphinx/directives/desc.py:476 +#: sphinx/directives/desc.py:488 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (%s modülü içinde)" + +#: sphinx/directives/desc.py:422 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (gömülü değişken)" + +#: sphinx/directives/desc.py:423 +#: sphinx/directives/desc.py:514 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (%s modülü içinde)" + +#: sphinx/directives/desc.py:439 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (gömülü sınıf)" + +#: sphinx/directives/desc.py:440 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (sınıf %s içinde)" + +#: sphinx/directives/desc.py:480 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metodu)" + +#: sphinx/directives/desc.py:482 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metodu)" + +#: sphinx/directives/desc.py:492 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s statik metodu)" + +#: sphinx/directives/desc.py:495 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s statik metodu)" + +#: sphinx/directives/desc.py:518 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s niteliği)" + +#: sphinx/directives/desc.py:520 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s niteliği)" + +#: sphinx/directives/desc.py:609 +#, python-format +msgid "%s (C function)" +msgstr "%s (C fonksiyonu)" + +#: sphinx/directives/desc.py:611 +#, python-format +msgid "%s (C member)" +msgstr "%s (C öğesi)" + +#: sphinx/directives/desc.py:613 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C makrosu)" + +#: sphinx/directives/desc.py:615 +#, python-format +msgid "%s (C type)" +msgstr "%s (C tipi)" + +#: sphinx/directives/desc.py:617 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C değişkeni)" + +#: sphinx/directives/desc.py:665 +#, python-format +msgid "%scommand line option; %s" +msgstr "%skomut satırı seçeneği; %s" + +#: sphinx/directives/other.py:138 +msgid "Platforms: " +msgstr "Platformlar:" + +#: sphinx/directives/other.py:144 +#, python-format +msgid "%s (module)" +msgstr "%s (modül)" + +#: sphinx/directives/other.py:193 +msgid "Section author: " +msgstr "Bölüm yazarı:" + +#: sphinx/directives/other.py:195 +msgid "Module author: " +msgstr "Modül yazarı:" + +#: sphinx/directives/other.py:197 +msgid "Author: " +msgstr "Yazarı:" + +#: sphinx/directives/other.py:317 +msgid "See also" +msgstr "Ayrıca bkz." + +#: sphinx/ext/autodoc.py:883 +#, python-format +msgid " Bases: %s" +msgstr " Taban: %s" + +#: sphinx/ext/autodoc.py:916 +#, python-format +msgid "alias of :class:`%s`" +msgstr "şunun takma adı: :class:`%s`" + +#: sphinx/ext/todo.py:41 +msgid "Todo" +msgstr "Yapılacaklar" + +#: sphinx/ext/todo.py:99 +#, python-format +msgid "(The original entry is located in %s, line %d and can be found " +msgstr "(%s içinde ve %d satırındaki özgün girdi şurada bulunuyor " + +#: sphinx/ext/todo.py:105 +msgid "here" +msgstr " " + +#: sphinx/locale/__init__.py:15 +msgid "Attention" +msgstr "Dikkat" + +#: sphinx/locale/__init__.py:16 +msgid "Caution" +msgstr "Uyarı" + +#: sphinx/locale/__init__.py:17 +msgid "Danger" +msgstr "Tehlike" + +#: sphinx/locale/__init__.py:18 +msgid "Error" +msgstr "Hata" + +#: sphinx/locale/__init__.py:19 +msgid "Hint" +msgstr "İpucu" + +#: sphinx/locale/__init__.py:20 +msgid "Important" +msgstr "Önemli" + +#: sphinx/locale/__init__.py:21 +msgid "Note" +msgstr "Not" + +#: sphinx/locale/__init__.py:22 +msgid "See Also" +msgstr "Ayrıca bkz." + +#: sphinx/locale/__init__.py:23 +msgid "Tip" +msgstr "Tüyo" + +#: sphinx/locale/__init__.py:24 +msgid "Warning" +msgstr "Uyarı" + +#: sphinx/locale/__init__.py:28 +#, python-format +msgid "New in version %s" +msgstr "%s sürümüyle geldi" + +#: sphinx/locale/__init__.py:29 +#, python-format +msgid "Changed in version %s" +msgstr "%s sürümünde değişti" + +#: sphinx/locale/__init__.py:30 +#, python-format +msgid "Deprecated since version %s" +msgstr "%s sürümünden beri önerilmiyor" + +#: sphinx/locale/__init__.py:34 +msgid "module" +msgstr "modül" + +#: sphinx/locale/__init__.py:35 +msgid "keyword" +msgstr "anahtar kelime" + +#: sphinx/locale/__init__.py:36 +msgid "operator" +msgstr "işleç" + +#: sphinx/locale/__init__.py:37 +msgid "object" +msgstr "nesne" + +#: sphinx/locale/__init__.py:38 +msgid "exception" +msgstr "istisna" + +#: sphinx/locale/__init__.py:39 +msgid "statement" +msgstr "deyim" + +#: sphinx/locale/__init__.py:40 +msgid "built-in function" +msgstr "gömülü fonksiyon" + +#: sphinx/themes/basic/defindex.html:2 +msgid "Overview" +msgstr "Genel Bakış" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Indices and tables:" +msgstr "Dizinler ve tablolar" + +#: sphinx/themes/basic/defindex.html:14 +msgid "Complete Table of Contents" +msgstr "Ayrıntılı İçindekiler Tablosu" + +#: sphinx/themes/basic/defindex.html:15 +msgid "lists all sections and subsections" +msgstr "bütün bölümler ve alt bölümler listelenir" + +#: sphinx/themes/basic/defindex.html:17 +msgid "search this documentation" +msgstr "Bu belgelerde ara" + +#: sphinx/themes/basic/defindex.html:20 +msgid "quick access to all modules" +msgstr "bütün modüllere hızlı erişim" + +#: sphinx/themes/basic/defindex.html:22 +msgid "all functions, classes, terms" +msgstr "bütün fonksiyonlar, sınıflar, terimler" + +#: sphinx/themes/basic/genindex-single.html:5 +#, python-format +msgid "Index – %(key)s" +msgstr "Dizin – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:44 +#: sphinx/themes/basic/genindex-split.html:14 +#: sphinx/themes/basic/genindex-split.html:27 +#: sphinx/themes/basic/genindex.html:54 +msgid "Full index on one page" +msgstr "Bütün dizin tek sayfada" + +#: sphinx/themes/basic/genindex-split.html:7 +msgid "Index pages by letter" +msgstr "Harfe göre dizin sayfaları" + +#: sphinx/themes/basic/genindex-split.html:15 +msgid "can be huge" +msgstr "çok büyük olabilir" + +#: sphinx/themes/basic/layout.html:10 +msgid "Navigation" +msgstr "Gezinti" + +#: sphinx/themes/basic/layout.html:42 +msgid "Table Of Contents" +msgstr "İçindekiler Tablosu" + +#: sphinx/themes/basic/layout.html:48 +msgid "Previous topic" +msgstr "Önceki konu" + +#: sphinx/themes/basic/layout.html:50 +msgid "previous chapter" +msgstr "önceki bölüm" + +#: sphinx/themes/basic/layout.html:53 +msgid "Next topic" +msgstr "Sonraki konu" + +#: sphinx/themes/basic/layout.html:55 +msgid "next chapter" +msgstr "sonraki bölüm" + +#: sphinx/themes/basic/layout.html:60 +msgid "This Page" +msgstr "Bu Sayfa" + +#: sphinx/themes/basic/layout.html:63 +msgid "Show Source" +msgstr "Kaynağı Göster" + +#: sphinx/themes/basic/layout.html:73 +msgid "Quick search" +msgstr "Hızlı Arama" + +#: sphinx/themes/basic/layout.html:76 +msgid "Go" +msgstr "Git" + +#: sphinx/themes/basic/layout.html:81 +msgid "Enter search terms or a module, class or function name." +msgstr "Aranacak terimleri veya modül, sınıf ya da fonksiyon adını giriniz." + +#: sphinx/themes/basic/layout.html:119 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "%(docstitle)s içinde ara" + +#: sphinx/themes/basic/layout.html:128 +msgid "About these documents" +msgstr "Bu belgeler hakkında" + +#: sphinx/themes/basic/layout.html:134 +#: sphinx/themes/basic/search.html:2 +#: sphinx/themes/basic/search.html:5 +msgid "Search" +msgstr "Ara" + +#: sphinx/themes/basic/layout.html:137 +msgid "Copyright" +msgstr "Copyright" + +#: sphinx/themes/basic/layout.html:183 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/themes/basic/layout.html:185 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/themes/basic/layout.html:188 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Son güncelleme: %(last_updated)s." + +#: sphinx/themes/basic/layout.html:191 +#, python-format +msgid "Created using Sphinx %(sphinx_version)s." +msgstr "Sphinx %(sphinx_version)s ile oluşturulmuştur." + +#: sphinx/themes/basic/modindex.html:36 +msgid "Deprecated" +msgstr "Önerilmiyor" + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Ara: %(docstitle)s" + +#: sphinx/themes/basic/search.html:9 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Arama işlevini kullanabilmek için lütfen JavaScript'i\n" +" etkinleştirin." + +#: sphinx/themes/basic/search.html:14 +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" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Burada belgeler içinde arama yapabilirsiniz. Aradığınız kelimeyi \n" +"aşağıdaki kutuya yazıp \"ara\" düğmesine basınız. Arama işlevi \n" +"otomatik olarak bütün kelimeleri arayacaktır. Eksik kelime içeren \n" +"sayfalar sonuç listesinde görünmez." + +#: sphinx/themes/basic/search.html:21 +msgid "search" +msgstr "ara" + +#: sphinx/themes/basic/search.html:25 +#: sphinx/themes/basic/static/searchtools.js:453 +msgid "Search Results" +msgstr "Arama Sonuçları" + +#: sphinx/themes/basic/search.html:27 +msgid "Your search did not match any results." +msgstr "Arama sonucunda herhangi bir belge bulunamadı." + +#: sphinx/themes/basic/changes/frameset.html:5 +#: sphinx/themes/basic/changes/versionchanges.html:12 +#, python-format +msgid "Changes in Version %(version)s — %(docstitle)s" +msgstr "Sürüm %(version)s — %(docstitle)s içindeki Değişiklikler" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +msgstr "%(filename)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/versionchanges.html:17 +#, python-format +msgid "Automatically generated list of changes in version %(version)s" +msgstr "%(version)s numaralı sürümdeki değişikliklerin otomatik olarak üretilmiş listesi" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Kütüphane değişiklikleri" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "C API'sindeki değişiklikler" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Diğer değişiklikler" + +#: sphinx/themes/basic/static/doctools.js:139 +#: sphinx/writers/html.py:473 +#: sphinx/writers/html.py:478 +msgid "Permalink to this headline" +msgstr "Bu başlığın kalıcı bağlantısı" + +#: sphinx/themes/basic/static/doctools.js:145 +#: sphinx/writers/html.py:80 +msgid "Permalink to this definition" +msgstr "Bu tanımın kalıcı bağlantısı" + +#: sphinx/themes/basic/static/doctools.js:174 +msgid "Hide Search Matches" +msgstr "Arama Sonuçlarını Gizle" + +#: sphinx/themes/basic/static/searchtools.js:274 +msgid "Searching" +msgstr "Arıyor" + +#: sphinx/themes/basic/static/searchtools.js:279 +msgid "Preparing search..." +msgstr "Aramaya hazırlanıyor..." + +#: sphinx/themes/basic/static/searchtools.js:338 +msgid "module, in " +msgstr "modül şunun içinde:" + +#: sphinx/themes/basic/static/searchtools.js:347 +msgid ", in " +msgstr ", şunun içinde:" + +#: sphinx/themes/basic/static/searchtools.js:455 +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 "Arama sonucunda hiçbir belge bulunamadı. Bütün kelimeleri doğru yazdığınızda ve yeterli kategori seçimi yaptığınızdan emin olun." + +#: sphinx/themes/basic/static/searchtools.js:457 +#, python-format +msgid "Search finished, found %s page(s) matching the search query." +msgstr "Arama sonuçlandı, aramayla eşleşen %s sayfa bulundu." + +#: sphinx/writers/latex.py:185 +msgid "Release" +msgstr "Sürüm" + +#: sphinx/writers/latex.py:571 +msgid "Footnotes" +msgstr "Dipnotları" + +#: sphinx/writers/latex.py:639 +msgid "continued from previous page" +msgstr "önceki sayfadan devam" + +#: sphinx/writers/latex.py:644 +msgid "Continued on next page" +msgstr "Devamı sonraki sayfada" + +#: sphinx/writers/text.py:166 +#, python-format +msgid "Platform: %s" +msgstr "Platform: %s" + +#: sphinx/writers/text.py:428 +msgid "[image]" +msgstr "[resim]" + From d7f1aeba8c4cbd870cf2fb67aa08eee52f8e09c0 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 7 Apr 2010 13:02:03 +0200 Subject: [PATCH 4/5] Review changes from http://bitbucket.org/tpowers/sphinx/ and add docs. --- AUTHORS | 1 + CHANGES | 6 ++++++ doc/config.rst | 15 +++++++++++++++ sphinx/builders/__init__.py | 13 ------------- sphinx/builders/html.py | 1 + sphinx/config.py | 4 ++-- sphinx/environment.py | 18 ++++++++---------- sphinx/writers/html.py | 2 +- 8 files changed, 34 insertions(+), 26 deletions(-) diff --git a/AUTHORS b/AUTHORS index 6e215c8c1..c97af67c1 100644 --- a/AUTHORS +++ b/AUTHORS @@ -21,6 +21,7 @@ Other contributors, listed alphabetically, are: * Roland Meister -- epub builder * Christopher Perkins -- autosummary integration * Benjamin Peterson -- unittests +* T. Powers -- HTML output improvements * Stefan Seefeld -- toctree improvements * Antonio Valentino -- qthelp builder * Pauli Virtanen -- autodoc improvements, autosummary extension diff --git a/CHANGES b/CHANGES index 96a83a3e4..3d0091093 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,12 @@ Release 1.0 (in development) * Added ``tab-width`` option to ``literalinclude`` directive. +* Added ``html_secnumber_suffix`` config value to control section + numbering format. + +* Added ``html_compact_lists`` config value to control docutils' + compact lists feature. + * The ``html_sidebars`` config value can now contain patterns as keys, and the values can be lists that explicitly select which sidebar templates should be rendered. That means that the builtin diff --git a/doc/config.rst b/doc/config.rst index ed9063a28..4a7e0e5e3 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -614,6 +614,21 @@ that use Sphinx' HTMLWriter class. .. versionadded:: 1.0 +.. confval:: html_compact_lists + + If true, list items containing only a single paragraph will not be rendered + with a ``

`` element. This is standard docutils behavior. Default: + ``True``. + + .. versionadded:: 1.0 + +.. confval:: html_secnumber_suffix + + Suffix for section numbers. Default: ``". "``. Set to ``" "`` to suppress + the final dot on section numbers. + + .. versionadded:: 1.0 + .. confval:: htmlhelp_basename Output file base name for HTML help builder. Default is ``'pydoc'``. diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 71b05dcce..32236a667 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -300,19 +300,6 @@ class Builder(object): else: self.info('none found') - #%%%%% Don't know where else to put this??? Change - #env.settings since that seems to be the only way to change - #the StandaloneHTMLBuilder(Builder)'s docsettings. These - #docsettings are stored in doctree.settings, which eventually - #get passed to HTMLWriter, which actually creates - #docutils/writers/html4css1/__init__.py/HTMLTranslator(nodes.NodeVisitor). - #It's here that these settings are then used to configure the - #actual HTML output. - if self.config.html_compact_lists: - self.env.settings['compact_lists'] = 1 - else: - self.env.settings['compact_lists'] = 0 - if updated_docnames: # save the environment self.info(bold('pickling environment... '), nonl=True) diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 914d741f1..92774b207 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -228,6 +228,7 @@ class StandaloneHTMLBuilder(Builder): self.docsettings = OptionParser( defaults=self.env.settings, components=(self.docwriter,)).get_default_values() + self.docsettings.compact_lists = bool(self.config.html_compact_lists) # format the "last updated on" string, only once is enough since it # typically doesn't include the time of day diff --git a/sphinx/config.py b/sphinx/config.py index f6a412da2..f2e6d57bc 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -62,8 +62,7 @@ class Config(object): rst_prologue = (None, 'env'), trim_doctest_flags = (True, 'env'), needs_sphinx = (None, None), - secnumber_suffix = ('. ', 'html'), - + # HTML options html_theme = ('default', 'html'), html_theme_path = ([], 'html'), @@ -96,6 +95,7 @@ class Config(object): html_context = ({}, 'html'), html_output_encoding = ('utf-8', 'html'), html_compact_lists = (True, 'html'), + html_secnumber_suffix = ('. ', 'html'), # HTML help only options htmlhelp_basename = (lambda self: make_filename(self.project), None), diff --git a/sphinx/environment.py b/sphinx/environment.py index 46386e0f5..4e9bedb20 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -786,21 +786,19 @@ class BuildEnvironment: def process_refonly_bullet_lists(self, docname, doctree): """Change refonly bullet lists to use compact_paragraphs. - Specifically implemented for 'Indices and Tables' section, which - looks odd in --no-compact-lists mode. - + Specifically implemented for 'Indices and Tables' section, which looks + odd when html_compact_lists is false. """ if self.config.html_compact_lists: return class RefOnlyListChecker(nodes.GenericNodeVisitor): - """Raise `nodes.NodeFound` if non-simple list item is - encountered. - - Here 'simple' means a list item containing only a paragraph - with a single reference in it. + """Raise `nodes.NodeFound` if non-simple list item is encountered. + Here 'simple' means a list item containing only a paragraph with a + single reference in it. """ + def default_visit(self, node): raise nodes.NodeFound @@ -833,9 +831,9 @@ class BuildEnvironment: try: node.walk(visitor) except nodes.NodeFound: - return None + return False else: - return 1 + return True for node in doctree.traverse(nodes.bullet_list): if check_refonly_list(node): diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index d072a86d8..bad08733e 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -59,7 +59,7 @@ class HTMLTranslator(BaseTranslator): self.highlightlinenothreshold = sys.maxint self.protect_literal_text = 0 self.add_permalinks = builder.config.html_add_permalinks - self.secnumber_suffix = builder.config.secnumber_suffix + self.secnumber_suffix = builder.config.html_secnumber_suffix def visit_start_of_file(self, node): # only occurs in the single-file builder From 63289cba33a8e4414d8e87141600c531c41d804e Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 7 Apr 2010 13:03:34 +0200 Subject: [PATCH 5/5] Rename rst_prologue to rst_prolog and document it. --- CHANGES | 2 ++ doc/config.rst | 7 +++++++ sphinx/config.py | 2 +- sphinx/environment.py | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 3d0091093..2adb9f910 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,8 @@ Release 1.0 (in development) * Added ``tab-width`` option to ``literalinclude`` directive. +* Added ``rst_prolog`` config value. + * Added ``html_secnumber_suffix`` config value to control section numbering format. diff --git a/doc/config.rst b/doc/config.rst index 4a7e0e5e3..97a4e3440 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -182,6 +182,13 @@ General configuration .. versionadded:: 0.6 +.. confval:: rst_prolog + + A string of reStructuredText that will be included at the beginning of every + source file that is read. + + .. versionadded:: 1.0 + .. confval:: default_role .. index:: default; role diff --git a/sphinx/config.py b/sphinx/config.py index f2e6d57bc..bc89f336c 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -59,7 +59,7 @@ class Config(object): keep_warnings = (False, 'env'), modindex_common_prefix = ([], 'html'), rst_epilog = (None, 'env'), - rst_prologue = (None, 'env'), + rst_prolog = (None, 'env'), trim_doctest_flags = (True, 'env'), needs_sphinx = (None, None), diff --git a/sphinx/environment.py b/sphinx/environment.py index 4e9bedb20..031c02130 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -590,8 +590,8 @@ class BuildEnvironment: data = arg[0] if self.config.rst_epilog: data = data + '\n' + self.config.rst_epilog + '\n' - if self.config.rst_prologue: - data = self.config.rst_prologue + '\n' + data + if self.config.rst_prolog: + data = self.config.rst_prolog + '\n' + data return data # publish manually