mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
refactor sphinx.io; SphinxFileInput can expect that app argument is always available
This commit is contained in:
parent
a0200ad499
commit
aa4fd0e1b7
@ -141,10 +141,11 @@ class SphinxFileInput(FileInput):
|
|||||||
def read(self):
|
def read(self):
|
||||||
# type: () -> unicode
|
# type: () -> unicode
|
||||||
data = FileInput.read(self)
|
data = FileInput.read(self)
|
||||||
if self.app:
|
|
||||||
arg = [data]
|
# emit source-read event
|
||||||
self.app.emit('source-read', self.env.docname, arg)
|
arg = [data]
|
||||||
data = arg[0]
|
self.app.emit('source-read', self.env.docname, arg)
|
||||||
|
data = arg[0]
|
||||||
|
|
||||||
parser = self.app.registry.get_source_parser(self.source_path)
|
parser = self.app.registry.get_source_parser(self.source_path)
|
||||||
docinfo, data = split_docinfo(data)
|
docinfo, data = split_docinfo(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user