From df99392f29d3919e2c8c7cdf04e1f329972bde59 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Sun, 28 Aug 2016 09:24:33 +0900 Subject: [PATCH 1/5] epub-validator doesn't allow # (and #top). --- sphinx/builders/epub.py | 2 ++ sphinx/builders/html.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index aaa55ab0f..f6d903012 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -188,6 +188,8 @@ class EpubBuilder(StandaloneHTMLBuilder): # don't add links add_permalinks = False + # don't use # as current path. ePub check reject it. + allow_sharp_as_current_path = False # don't add sidebar etc. embedded = True # disable download role diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index f24f9ac44..ef816364e 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -82,6 +82,7 @@ class StandaloneHTMLBuilder(Builder): 'image/gif', 'image/jpeg'] searchindex_filename = 'searchindex.js' add_permalinks = True + allow_sharp_as_current_path = True embedded = False # for things like HTML help or Qt help: suppresses sidebar search = True # for things like HTML help and Apple help: suppress search download_support = True # enable download role @@ -786,6 +787,8 @@ class StandaloneHTMLBuilder(Builder): elif not resource: otheruri = self.get_target_uri(otheruri) uri = relative_uri(baseuri, otheruri) or '#' + if uri == '#' and not self.allow_sharp_as_current_path: + uri = baseuri return uri ctx['pathto'] = pathto From 792d154b1aa8eb76654f319db6187a5fbcae020d Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Sun, 28 Aug 2016 09:30:21 +0900 Subject: [PATCH 2/5] fix sphinx document's style to satisfy xhtml standard --- doc/_templates/index.html | 10 +++++----- doc/_themes/sphinx13/static/sphinx13.css | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/doc/_templates/index.html b/doc/_templates/index.html index aa1cec85a..c02641624 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -46,15 +46,15 @@

{%trans%}Documentation{%endtrans%}

- -
+ + diff --git a/doc/_themes/sphinx13/static/sphinx13.css b/doc/_themes/sphinx13/static/sphinx13.css index 8b3ebdf3a..a2549e181 100644 --- a/doc/_themes/sphinx13/static/sphinx13.css +++ b/doc/_themes/sphinx13/static/sphinx13.css @@ -394,3 +394,9 @@ div.viewcode-block:target { border-top: 1px solid #ac9; border-bottom: 1px solid #ac9; } + +.contentstable { + margin-left: 30px; + margin: 0 auto; + table-layout: fixed; +} From f455d05b5a5485509d2f16100eb11f86e81ac7ad Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Sun, 28 Aug 2016 09:31:26 +0900 Subject: [PATCH 3/5] epub builder: ignore autogenerated files by OS --- sphinx/builders/epub.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index f6d903012..b4b657468 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -569,6 +569,7 @@ class EpubBuilder(StandaloneHTMLBuilder): self.files = [] self.ignored_files = ['.buildinfo', 'mimetype', 'content.opf', 'toc.ncx', 'META-INF/container.xml', + 'Thumbs.db', 'ehthumbs.db', '.DS_Store', self.config.epub_basename + '.epub'] + \ self.config.epub_exclude_files if not self.use_index: From 27931ff1676d55e6cf2ad679a6945796f8975356 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Sun, 28 Aug 2016 09:32:21 +0900 Subject: [PATCH 4/5] fix module index template to satisfy xhtml standard --- sphinx/themes/agogo/static/agogo.css_t | 7 +++++++ sphinx/themes/basic/domainindex.html | 2 +- sphinx/themes/basic/static/basic.css_t | 7 +++++++ sphinx/themes/epub/static/epub.css | 7 +++++++ sphinx/themes/nonav/static/nonav.css | 7 +++++++ sphinx/themes/scrolls/static/scrolls.css_t | 5 +++++ sphinx/themes/traditional/static/traditional.css_t | 7 +++++++ 7 files changed, 41 insertions(+), 1 deletion(-) diff --git a/sphinx/themes/agogo/static/agogo.css_t b/sphinx/themes/agogo/static/agogo.css_t index 9a5f8dca1..0baec16fc 100644 --- a/sphinx/themes/agogo/static/agogo.css_t +++ b/sphinx/themes/agogo/static/agogo.css_t @@ -487,6 +487,13 @@ img.toggler { cursor: pointer; } +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* -- viewcode extension ---------------------------------------------------- */ .viewcode-link { diff --git a/sphinx/themes/basic/domainindex.html b/sphinx/themes/basic/domainindex.html index 34800f7e2..745174986 100644 --- a/sphinx/themes/basic/domainindex.html +++ b/sphinx/themes/basic/domainindex.html @@ -30,7 +30,7 @@ {%- endfor %} -
- - + + {%- if hasdoc('search') %}{%- endif %} {%- if hasdoc('genindex') %}{%- endif %}
+
{%- for letter, entries in content %}
 
diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t index 7a298d527..9d755d096 100644 --- a/sphinx/themes/basic/static/basic.css_t +++ b/sphinx/themes/basic/static/basic.css_t @@ -188,6 +188,13 @@ div.genindex-jumpbox { padding: 0.4em; } +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* -- general body styles --------------------------------------------------- */ div.body p, div.body dd, div.body li, div.body blockquote { diff --git a/sphinx/themes/epub/static/epub.css b/sphinx/themes/epub/static/epub.css index b6aae022a..6b72901c3 100644 --- a/sphinx/themes/epub/static/epub.css +++ b/sphinx/themes/epub/static/epub.css @@ -175,6 +175,13 @@ img.toggler { cursor: pointer; } +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* -- general body styles --------------------------------------------------- */ a.headerlink { diff --git a/sphinx/themes/nonav/static/nonav.css b/sphinx/themes/nonav/static/nonav.css index ec4326b50..cbaee7ced 100644 --- a/sphinx/themes/nonav/static/nonav.css +++ b/sphinx/themes/nonav/static/nonav.css @@ -175,6 +175,13 @@ img.toggler { cursor: pointer; } +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* -- general body styles --------------------------------------------------- */ a.headerlink { diff --git a/sphinx/themes/scrolls/static/scrolls.css_t b/sphinx/themes/scrolls/static/scrolls.css_t index cce268792..af10144a1 100644 --- a/sphinx/themes/scrolls/static/scrolls.css_t +++ b/sphinx/themes/scrolls/static/scrolls.css_t @@ -326,6 +326,11 @@ table.modindextable { border: none; } +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + table.modindextable img.toggler { margin-right: 10px; } diff --git a/sphinx/themes/traditional/static/traditional.css_t b/sphinx/themes/traditional/static/traditional.css_t index 5f62cc5ea..306b5b51d 100644 --- a/sphinx/themes/traditional/static/traditional.css_t +++ b/sphinx/themes/traditional/static/traditional.css_t @@ -415,6 +415,13 @@ img.toggler { cursor: pointer; } +/* :::: DOMAIN MODULE INDEX STYLES :::: */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + /* :::: GLOBAL STYLES :::: */ p.subhead { From abdf3e7f40572df0254acc73066dfef455b856b9 Mon Sep 17 00:00:00 2001 From: Yoshiki Shibukawa Date: Sun, 28 Aug 2016 09:36:38 +0900 Subject: [PATCH 5/5] Fix CHANGES --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 64b3f9bbb..7c32461e4 100644 --- a/CHANGES +++ b/CHANGES @@ -41,7 +41,7 @@ Incompatible changes * ``sphinx.ext.viewcode`` disabled on singlehtml builder. * Use make-mode of ``sphinx-quickstart`` by default. To disable this, use ``-M`` option -* Fix ``genindex.html`` to satisfy xhtml standard. +* Fix ``genindex.html``, Sphinx's document template, link address to itself to satisfy xhtml standard. * Use epub3 builder by default. And the old epub builder is renamed to epub2. * Fix ``epub`` and ``epub3`` builders that contained links to ``genindex`` even if ``epub_use_index = False``. * `html_translator_class` is now deprecated.