Skip to content

Commit

Permalink
Allow access to the parser during the read phase
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed May 7, 2024
1 parent 98f953e commit 1cfeb55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sphinx/builders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ def read_doc(self, docname: str, *, _cache: bool = True) -> None:
filename = self.env.doc2path(docname)
filetype = get_filetype(self.app.config.source_suffix, filename)
publisher = self.app.registry.get_publisher(self.app, filetype)
self.env.temp_data['parser'] = publisher.parser
# record_dependencies is mutable even though it is in settings,
# explicitly re-initialise for each document
publisher.settings.record_dependencies = DependencyList()
Expand Down

0 comments on commit 1cfeb55

Please sign in to comment.