Open mbrandonw opened 1 year ago
Keeping this issue as snippet-focused makes sense to me but note that this problem affects any source code change. The live update feature currently only supports changes in markdown files – so any changes in a project's source code will not be reflected without a complete rebuild.
@ethan-kusters, it looks like the preview action in docc monitors the documentation bundle, but not other directories in the source tree.
A naive approach could be to set the project root (containing the docs bundle) as monitoring target, so any file change would trigger a rebuild?
The problem with that is that DirectoryMonitor
will re-run convertAction
on every change, i.e. rebuild the whole thing from scratch (unless docc has caching internally that I don't know about yet).
Rebuilding docs on code change would also require building the code (at least obtaining a fresh symbols.json
). At least that part is already incremental.
Sounds like a topic for another RFC to align on possible approaches with sane performance costs?
Is this issue still being considered?
Description
When previewing docs with the
swift package preview-documentation
I have found that changes made to snippet files (in the Snippets root directory) do not trigger a rebuild of docs. This makes it hard to iterate on documentation that uses snippets.Further, I found found that snippets in the generated docs will update unless the preview server is stopped and restarted. For example, I can perform the following steps:
swift package preview-documentation
)The only way to see the newest version of the snippet is to stop the preview server and start it again.
Checklist
main
branch of this package.Expected Behavior
I would hope that any changes to a snippet file or the main docs would rebuild all of the docs with the freshest version of all snippets.
Actual behavior
Snippets are not re-generated unless I stop the preview server and restart it.
Steps To Reproduce
No response
Swift-DocC Version Information
1.2.0
Swift Compiler Version Information