-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Draw images for PlantUML markup reachable via URL? #4
Comments
It makes sense for me. I'll think about it and I'll get back to you soon. |
This is the proposed syntax for this new feature, Note that it's not necessary to encode the URL of the source file. For example, the following URL is valid: In the future, a third parameter format could be use to specify the form (png, svg, ...) of the resulting diagram. Have you any comment ? |
Sounds great! Indeed the urlencoding is only necessary when the passed URL contains special characters like ampersands. You will probably let us know when and where we can try it? |
Thinking about this a bit longer... Here's how we could optimize it for the GitHub use case: Assume from a .md file I added http://www.plantuml.com/github?subdir/file.puml as an image. The server could then take my referer header, replace "blob" with "raw" in the URL and interpret "subdir/file.puml" as relative path to that. The idea is to make it a bit easier with relative links instead of absolute ones (shorter). But that should also work when looking at files in branches or in forked repos - you should always get the .puml from the same branch/repo. |
Hello, http://www.plantuml.com/plantuml/img/Aov9B2hXiYejJbL8pop9A4so1W00 This is just simple as that! |
@arnaudroques yes, but that does not allow it to keep .puml around in version control and just render the graphics based on it. |
To be coherent with the proxy syntax, it could be |
Hi @mpdude This feature has to be documented on the plantuml website. |
Awesome :) I'll try it as soon as possible :) |
Yes, it works ! |
This works with one caveat (a problem with GitHub). The markdown engine renders the
as an image in the camo.githubusercontent.com web site (image cache). Open this image in a new tab to see an example: The problem is that this cache won't be updated unless the URL to the image changes. GitHub assumes images to be static, whereas PlantUML images drawn via the proxy are not. Prior to the proxy service feature, I was using the PlantUML !includeurl URL-to-source.puml (language) feature. A work-around to the GitHub cache problem is to toggle some redundant information in the URL (change the URL without changing the file specification), as explained below. fuhrmanator/course-activity-planner@45fd5d8 With the proxy service, this workaround might be to add/remove "idx=0&" in the URL. |
The official word about Github's CDN caching affecting dynamically generated images is here: The fix should be changing the cache headers here, where image caching is being forced: |
Yes, by default, PlantUML server sends some Cache-Control/public header for images. This makes sense for text diagram without !include. We cannot simply remove it for every served image, but we could improve this behaviour: This is something we have already implemented very basically, see So you can even check now is the following URL gives the right HTTP header |
How about adding an optional That way, if a diagram
... that data get attached to the resulting file
That way Github knows when to grab the new file, files stay as cacheable as possible, and PUML changes get more noticeable (human-readability: any person can check if a diagram has changed in the least) |
I have closed duplicate of this issues which I have created with next text:
|
The option |
We have put a new version of the online server http://plantuml.com/plantuml The code is not published yet, but it will be in few days/weeks. This version now handles correctly HTTP Headers This way, integration with Github/Gitlab should be improved. Do not hesitate to make feedback about this. |
My bad, i was talking about |
Yes, it's still possible.
|
according the post Markdown native diagrams with PlantUML | Andreas' Blog, we can set the 'cache' params to be 'no', so when the reffer file is committed, the reffered uml image will be update too. |
It would be great if we could pass the PlantUML server an URL to a markup file as an URL parameter and get the image in return.
That way, I could put .puml files somewhere in my repo.
Then, my documentation .md files could point to something like
http://www.plantuml.com/imageForUrl?url=..urlencoded_URL_of_the_raw_version_of_the_markup_file...
and embed the image rendered by the server.... at least until GitHub supports PlantUML nativaly :)
As an extra bonus, a second parameter could choose which
@startuml...@enduml
section to pick from the source file in case there are more than one.Does that make sense?
The text was updated successfully, but these errors were encountered: