epub-validator doesn't allow # (and #top).

This commit is contained in:
Yoshiki Shibukawa
2016-08-28 09:24:33 +09:00
parent 97c6cc4e10
commit df99392f29
2 changed files with 5 additions and 0 deletions

View File

@@ -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

View File

@@ -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