diff --git a/Doc/tools/sphinxext/layout.html b/Doc/tools/sphinxext/layout.html
index db4a386e89f..df728aa16f2 100644
--- a/Doc/tools/sphinxext/layout.html
+++ b/Doc/tools/sphinxext/layout.html
@@ -8,6 +8,23 @@
{% block extrahead %}
{% if not embedded %}{% endif %}
+ {% if pagename == 'whatsnew/news' %}
+
+ {% endif %}
{{ super() }}
{% endblock %}
{% block footer %}
diff --git a/Doc/tools/sphinxext/pyspecific.py b/Doc/tools/sphinxext/pyspecific.py
index bff10abb730..aa6e85fa0f0 100644
--- a/Doc/tools/sphinxext/pyspecific.py
+++ b/Doc/tools/sphinxext/pyspecific.py
@@ -145,6 +145,45 @@ def run(self):
return ret
+# Support for including Misc/NEWS
+
+import re
+import codecs
+from docutils.statemachine import string2lines
+from sphinx.util.nodes import nested_parse_with_titles
+
+issue_re = re.compile('Issue #([0-9]+)')
+
+class MiscNews(Directive):
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {}
+
+ def run(self):
+ fname = self.arguments[0]
+ source = self.state_machine.input_lines.source(
+ self.lineno - self.state_machine.input_offset - 1)
+ source_dir = path.dirname(path.abspath(source))
+ try:
+ fp = codecs.open(path.join(source_dir, fname), encoding='utf-8')
+ try:
+ content = fp.read()
+ finally:
+ fp.close()
+ except Exception:
+ text = 'The NEWS file is not available.'
+ node = nodes.strong(text, text)
+ return [node]
+ content = issue_re.sub(r'`Issue #\1 `__',
+ content)
+ # remove first 3 lines as they are the main heading
+ lines = content.splitlines()[3:]
+ self.state_machine.insert_input(lines, fname)
+ return []
+
+
# Support for building "topic help" for pydoc
pydoc_topic_labels = [
@@ -276,3 +315,4 @@ def setup(app):
app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)')
app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction)
app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod)
+ app.add_directive('miscnews', MiscNews)
diff --git a/Doc/whatsnew/index.rst b/Doc/whatsnew/index.rst
index bc942fd3ae5..e23beea1304 100644
--- a/Doc/whatsnew/index.rst
+++ b/Doc/whatsnew/index.rst
@@ -24,3 +24,11 @@ anyone wishing to stay up-to-date after a new release.
2.2.rst
2.1.rst
2.0.rst
+
+The "Python News" is a HTML version of the file :source:`Misc/NEWS` which
+contains *all* nontrivial changes to Python.
+
+.. toctree::
+ :maxdepth: 1
+
+ news.rst
diff --git a/Doc/whatsnew/news.rst b/Doc/whatsnew/news.rst
new file mode 100644
index 00000000000..2f81ed364be
--- /dev/null
+++ b/Doc/whatsnew/news.rst
@@ -0,0 +1,14 @@
++++++++++++
+Python News
++++++++++++
+
+.. raw:: html
+
+
+ Filter entries by content:
+
+
+
+
+.. miscnews:: ../../Misc/NEWS
+
diff --git a/Misc/NEWS b/Misc/NEWS
index 95120bf1519..6b05ac5b863 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -674,9 +674,10 @@ Tools/Demos
- Issue #12605: The gdb hooks for debugging CPython (within Tools/gdb) have been
enhanced to show information on more C frames relevant to CPython within the
"py-bt" and "py-bt-full" commands:
- * C frames that are waiting on the GIL
- * C frames that are garbage-collecting
- * C frames that are due to the invocation of a PyCFunction
+
+ * C frames that are waiting on the GIL
+ * C frames that are garbage-collecting
+ * C frames that are due to the invocation of a PyCFunction
Documentation
-------------