mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #4051: warn() function for HTML theme outputs 'None' string
This commit is contained in:
parent
9eec5fa8d7
commit
ec2e60674f
2
CHANGES
2
CHANGES
@ -38,7 +38,7 @@ Bugs fixed
|
||||
* #4067: Return non-zero exit status when make subprocess fails
|
||||
* #4055: graphviz: the :align: option does not work for SVG output
|
||||
* #4055: graphviz: the :align: center option does not work for latex output
|
||||
|
||||
* #4051: ``warn()`` function for HTML theme outputs 'None' string
|
||||
|
||||
|
||||
Testing
|
||||
|
@ -898,7 +898,6 @@ class StandaloneHTMLBuilder(Builder):
|
||||
outfilename=None, event_arg=None):
|
||||
# type: (unicode, Dict, unicode, unicode, Any) -> None
|
||||
ctx = self.globalcontext.copy()
|
||||
ctx['warn'] = self.warn
|
||||
# current_page_name is backwards compatibility
|
||||
ctx['pagename'] = ctx['current_page_name'] = pagename
|
||||
ctx['encoding'] = self.config.html_output_encoding
|
||||
@ -931,6 +930,13 @@ class StandaloneHTMLBuilder(Builder):
|
||||
return False
|
||||
ctx['hasdoc'] = hasdoc
|
||||
|
||||
def warn(*args, **kwargs):
|
||||
# type: (Any, Any) -> unicode
|
||||
"""Simple warn() wrapper for themes."""
|
||||
self.warn(*args, **kwargs)
|
||||
return '' # return empty string
|
||||
ctx['warn'] = warn
|
||||
|
||||
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
|
||||
self.add_sidebars(pagename, ctx)
|
||||
ctx.update(addctx)
|
||||
|
Loading…
Reference in New Issue
Block a user