diff options
| author | georg.brandl <devnull@localhost> | 2008-08-06 14:46:11 +0000 |
|---|---|---|
| committer | georg.brandl <devnull@localhost> | 2008-08-06 14:46:11 +0000 |
| commit | f4dc16016b85ac92cd98d7d5d5120a7dbe7ce833 (patch) | |
| tree | b77e1641103888124b34da3c9a640bd731178939 | |
| parent | 582afda641cf6c525af8f8157140ee5aed357c34 (diff) | |
| download | sphinx-f4dc16016b85ac92cd98d7d5d5120a7dbe7ce833.tar.gz | |
Merged revisions 65532,65546-65547,65550-65551 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x
........
r65532 | georg.brandl | 2008-08-04 22:35:07 +0000 (Mon, 04 Aug 2008) | 2 lines
Add a test file for misc. markup and fix a doc bug.
........
r65546 | georg.brandl | 2008-08-05 09:55:20 +0000 (Tue, 05 Aug 2008) | 2 lines
Show an indication while downloading the search index.
........
r65547 | georg.brandl | 2008-08-05 10:07:50 +0000 (Tue, 05 Aug 2008) | 2 lines
Fix an indentation problem in production lists. #3477.
........
r65550 | georg.brandl | 2008-08-05 16:21:34 +0000 (Tue, 05 Aug 2008) | 2 lines
Remove unused interface.js.
........
r65551 | georg.brandl | 2008-08-06 08:48:21 +0000 (Wed, 06 Aug 2008) | 2 lines
Don't try to remove a nonexisting static dir.
........
| -rw-r--r-- | doc/concepts.rst | 26 | ||||
| -rw-r--r-- | doc/conf.py | 4 | ||||
| -rw-r--r-- | doc/markup/para.rst | 6 | ||||
| -rw-r--r-- | sphinx/builder.py | 3 | ||||
| -rw-r--r-- | sphinx/htmlwriter.py | 5 | ||||
| -rw-r--r-- | sphinx/static/searchtools.js | 3 | ||||
| -rw-r--r-- | sphinx/templates/search.html | 1 | ||||
| -rw-r--r-- | tests/root/contents.txt | 1 | ||||
| -rw-r--r-- | tests/root/markup.txt | 101 |
9 files changed, 115 insertions, 35 deletions
diff --git a/doc/concepts.rst b/doc/concepts.rst index 0ac78b2e..ca7aaf7c 100644 --- a/doc/concepts.rst +++ b/doc/concepts.rst @@ -13,30 +13,8 @@ Since the reST source files can have different extensions (some people like :confval:`source_suffix`) and different OSes have different path separators, Sphinx abstracts them: all "document names" are relative to the :term:`source directory`, the extension is stripped, and path separators are converted to -slashes :eq:`abc`. All values, parameters and suchlike referring to "documents" expect -such a document :math:`name\sqrt{3}`. - -.. math:: - :label: abc - - 3x+4y \sqrt{4} - - x+y \\ - z+z - -.. math:: a+b - - c + d & = 5 \\ - & = 6 - -.. math:: 5x + 6 - -.. math:: - :label: def - - test - -See :eq:`def`. +slashes. All values, parameters and suchlike referring to "documents" expect +such a document name. The TOC tree diff --git a/doc/conf.py b/doc/conf.py index 793f1d1e..06dca15d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -21,9 +21,7 @@ import sys, os, re # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.addons.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.pngmath'] -#pngmath_use_preview = True -jsmath_path = '/home/gbr/jsMath/easy/load.js' +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/markup/para.rst b/doc/markup/para.rst index e7dcac7c..ebc70426 100644 --- a/doc/markup/para.rst +++ b/doc/markup/para.rst @@ -88,11 +88,9 @@ units as well as normal text: .. directive:: centered - This directive creates a centered boldfaced paragraph. Use it as follows:: + This directive creates a centered boldfaced line of text. Use it as follows:: - .. centered:: - - Paragraph contents. + .. centered:: LICENSE AGREEMENT Table-of-contents markup diff --git a/sphinx/builder.py b/sphinx/builder.py index 37d4195d..a1053bf7 100644 --- a/sphinx/builder.py +++ b/sphinx/builder.py @@ -604,7 +604,8 @@ class StandaloneHTMLBuilder(Builder): if path.isfile(fullname): shutil.copyfile(fullname, targetname) elif path.isdir(fullname): - shutil.rmtree(targetname) + if path.exists(targetname): + shutil.rmtree(targetname) shutil.copytree(fullname, targetname) # copy logo file (handled differently) if self.config.html_logo: diff --git a/sphinx/htmlwriter.py b/sphinx/htmlwriter.py index 9e4af7ed..5fadcb1d 100644 --- a/sphinx/htmlwriter.py +++ b/sphinx/htmlwriter.py @@ -221,10 +221,9 @@ class HTMLTranslator(BaseTranslator): maxlen = max(len(name) for name in names) for production in node: if production['tokenname']: + lastname = production['tokenname'].ljust(maxlen) self.body.append(self.starttag(production, 'strong', '')) - self.body.append(production['tokenname'].ljust(maxlen) + - '</strong> ::= ') - lastname = production['tokenname'] + self.body.append(lastname + '</strong> ::= ') else: self.body.append('%s ' % (' '*len(lastname))) production.walkabout(self) diff --git a/sphinx/static/searchtools.js b/sphinx/static/searchtools.js index 5fed1116..a7c3424a 100644 --- a/sphinx/static/searchtools.js +++ b/sphinx/static/searchtools.js @@ -243,6 +243,7 @@ var Search = { var dots = $('<span></span>').appendTo(title); var status = $('<p style="display: none"></p>').appendTo(out); var output = $('<ul class="search"/>').appendTo(out); + $('#search-progress').text('Getting search index...') // spawn a background runner for updating the dots // until the search has finished @@ -300,6 +301,8 @@ var Search = { var fileMap = {}; var files = null; + $('#search-progress').empty() + // perform the search on the required words for (var i = 0; i < searchwords.length; i++) { var word = searchwords[i]; diff --git a/sphinx/templates/search.html b/sphinx/templates/search.html index 6260f4d5..031476a4 100644 --- a/sphinx/templates/search.html +++ b/sphinx/templates/search.html @@ -12,6 +12,7 @@ <form action="" method="get"> <input type="text" name="q" value="" /> <input type="submit" value="search" /> + <span id="search-progress" style="padding-left: 10px"></span> </form> {% if search_performed %} <h2>Search Results</h2> diff --git a/tests/root/contents.txt b/tests/root/contents.txt index 346878b5..f890f172 100644 --- a/tests/root/contents.txt +++ b/tests/root/contents.txt @@ -12,6 +12,7 @@ Contents: images includes + markup Indices and tables ================== diff --git a/tests/root/markup.txt b/tests/root/markup.txt new file mode 100644 index 00000000..98a98fc2 --- /dev/null +++ b/tests/root/markup.txt @@ -0,0 +1,101 @@ +:tocdepth: 2 + +Testing various markup +====================== + +.. sectionauthor:: Georg Brandl + +.. contents:: TOC + + +Admonitions +----------- + +.. note:: Note + Note text. + +.. warning:: Warning + + Warning text. + +.. tip: + Tip text. + + +Tables +------ + +.. tabularcolumns:: |L|L|R| + ++----+----------------+----+ +| 1 | * Block elems | x | +| | * In table | | ++----+----------------+----+ +| 2 | Empty cells: | | ++----+----------------+----+ + + +Version markup +-------------- + +.. versionadded:: 0.5 + Some funny **stuff**. + +.. versionchanged:: 0.5 + Even more funny stuff. [#]_ + +.. deprecated:: 0.4 + Boring stuff. + + +Misc stuff +---------- + +.. seealso:: + + `Google <http://www.google.com>`_ + For everything. + +.. rubric:: Side note + +This is a side note. + +.. centered:: LICENSE AGREEMENT + +.. acks:: + + * Terry Pratchett + * J. R. R. Tolkien + * Monty Python + +.. glossary:: + + boson + Particle with integer spin. + + fermion + Particle with half-integer spin. + +.. productionlist:: + try_stmt: try1_stmt | try2_stmt + try1_stmt: "try" ":" `suite` + : ("except" [`expression` ["," `target`]] ":" `suite`)+ + : ["else" ":" `suite`] + : ["finally" ":" `suite`] + try2_stmt: "try" ":" `suite` + : "finally" ":" `suite` + + +Index markup +------------ + +.. index:: + single: entry + pair: entry; pair + triple: index; entry; triple + + + +.. rubric:: Footnotes + +.. [#] Like footnotes. |
