-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Cache filename #156
RFC: Cache filename #156
Conversation
Follow the hawkmoth naming more consistently with s/cautodoc_parsed_files/hawkmoth_parsed_files/
When documenting lots of symbols from a file, it gets tedious to repeat the :file: option: .. c:autofunction:: foo :file: baz.c .. c:autofunction:: bar :file: baz.c Cache the filename from the :file: option across directives within a document.
Perhaps better ideas in #157 |
if filename: | ||
self.env.temp_data['hawkmoth_current_file'] = filename | ||
else: | ||
filename = self.env.temp_data.get('hawkmoth_current_file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so having looked into this I stand by my comment in #157: I don't like the idea of stateful directives too much. But I've also reconsidered things a bit, even if I would still personally vote this particular implementation down in favour of having a specialized directive to select a file.
Not only that would be much more explicit, we could later combine it with full lookup / cache as a way of speeding things up by limiting the search to a (set of) directory --- i.e.: .. autoresolve:: some/dir
. And in that case, adding the new directive with support for a single file only could be done without implying future breaking API changes.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so having looked into this I stand by my comment in #157: I don't like the idea of stateful directives too much. But I've also reconsidered things a bit, even if I would still personally vote this particular implementation down in favour of having a specialized directive to select a file.
Agreed. If there are going to be stateful directives, they should be explicit rather than implicit like this.
Superseded by #168 |
Only tested locally, no documentation, but thoughts?