diff --git a/src/hawkmoth/__init__.py b/src/hawkmoth/__init__.py index 651c9882..9054d175 100644 --- a/src/hawkmoth/__init__.py +++ b/src/hawkmoth/__init__.py @@ -70,7 +70,7 @@ def __parse(self, filename): clang_args.extend(self.__get_clang_args()) # Cached parse results per rst document - parsed_files = self.env.temp_data.setdefault('cautodoc_parsed_files', {}) + parsed_files = self.env.temp_data.setdefault('hawkmoth_parsed_files', {}) # The output depends on clang args key = (filename, tuple(clang_args)) @@ -161,6 +161,12 @@ class _AutoSymbolDirective(_AutoBaseDirective): def _get_filenames(self): filename = self.options.get('file') + # Cache filename across directives in rst document + if filename: + self.env.temp_data['hawkmoth_current_file'] = filename + else: + filename = self.env.temp_data.get('hawkmoth_current_file') + # Note: For the time being the file option is mandatory (sic). if not filename: self.logger.warning(':file: option missing.',