summaryrefslogtreecommitdiff
path: root/sphinx/io.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-02-08 13:01:38 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-02-10 15:07:23 +0900
commit2275c67966272c8c87f7eb06df3fe3ac25ecc0c6 (patch)
treec39ee7a4be9cc485671bc5618194a8fcdc6afd8c /sphinx/io.py
parente420d259d54aa2aa5de27777c5f590f4af8451ae (diff)
downloadsphinx-git-2275c67966272c8c87f7eb06df3fe3ac25ecc0c6.tar.gz
io: Choose FileInput using ``supported`` attribute (refs: #4564)
Diffstat (limited to 'sphinx/io.py')
-rw-r--r--sphinx/io.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/io.py b/sphinx/io.py
index a23d712b4..8f1da22bd 100644
--- a/sphinx/io.py
+++ b/sphinx/io.py
@@ -208,7 +208,7 @@ class SphinxBaseFileInput(FileInput):
class SphinxFileInput(SphinxBaseFileInput):
"""A basic FileInput for Sphinx."""
- pass
+ supported = ('*',) # special source input
class SphinxRSTFileInput(SphinxBaseFileInput):
@@ -225,6 +225,7 @@ class SphinxRSTFileInput(SphinxBaseFileInput):
For that reason, ``sphinx.parsers.RSTParser`` should be used with this to parse
a content correctly.
"""
+ supported = ('restructuredtext',)
def prepend_prolog(self, text, prolog):
# type: (StringList, unicode) -> None
@@ -295,8 +296,9 @@ def read_doc(app, env, filename):
def setup(app):
- app.registry.add_source_input('*', SphinxFileInput)
- app.registry.add_source_input('restructuredtext', SphinxRSTFileInput)
+ # type: (Sphinx) -> Dict[unicode, Any]
+ app.registry.add_source_input(SphinxFileInput)
+ app.registry.add_source_input(SphinxRSTFileInput)
return {
'version': 'builtin',