Confluence supports displaying PlantUML diagrams using for example PlantUML for Confluence macro. Basically, one copy-pastes a source code of the UML diagram and it's correctly rendered in a page.
Macro usage and render:


Question:
My goal is to keep the diagrams up to date with the current version of code. Is there a way to import the source code of the diagram from a repository into Confluence and display the diagram (let's say from the master
branch)?
Since BitBucket and Confluence are products of Atlassian and probably work well together, I am looking for such integration. If there is a way to get a source code from GitHub/GitLab displayed, I'd appreciate the answer even more. However, a solution working with BitBucket - Confluence - PlantUML would be more than sufficient.