Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
402 stars 73 forks source link

[FEAT] HTML or URL to resource in Annotations #739

Closed PalasX closed 3 years ago

PalasX commented 3 years ago

Is your feature request related to a problem? Please describe. Annotations accept text and understand Markdown, which is great, but sometimes limiting.

Describe the solution you'd like Allow HTML parsing in annotations. Alternatively, allow an image to be used as an annotation, or a URL to an image? Then the user can pre-render whatever they want as an annotation, and just link to the hosted image with a URL

Describe alternatives you've considered I've just been using markdown as best as possible. I use annotations a lot for stat blocks so i dont have to leave PlanarAlly to look something up. Adding HTML support or just a URL to an image resource would make statblocks super easy to have handy, but it could also be used for player-facing annotations. They could be more detailed views of something/someone on the map, or any number of other interactable things the players can view on their own.

Additional context I really dont know how difficult any of this would be to impliment. I figure for an image resource or a URL to an image, you can just size the annotation popup to the size of the image, plus a little magin. I have no idea how you would try to size an annotation for html content that might be more dynamic. I was looking at https://github.com/Valloric/statblock5e when i figured i might as well ask if HTML or a URL to a resource might be something anyone else would be interested in.

freddyyeddy commented 3 years ago

Just a heads-up for some tools for you if you don't know about them tetra-cube makes beautiful 5e stat blocks. The best place for ready made and available monster manual and npc stat blocks (though they are html not images) is aided.org but it uses simple url parameters for it's blocks. I know this isn't strictly related to the tool but these are some super helpful tools for streamlining. I think there could be merritt to adding a stat-block tool into PlannarAlly. Even if it didn't use the dnd stat-block theme would allow a cleaner separation of use cases for annotation for text and information delivery. Not trying to but in at all and I think simple url image links might have merritt in annotation. Heck if it could do media links you could use an annotations hover to play a sound or something. But on the developer end allowing users to link to whatever is a huuuge security risk. Maybe a better compromise is allow annotations to reference assets in your asset pool.

On Sat, Apr 24, 2021, 9:29 AM PalasX @.***> wrote:

Is your feature request related to a problem? Please describe. Annotations accept text and understand Markdown, which is great, but sometimes limiting.

Describe the solution you'd like Allow HTML parsing in annotations. Alternatively, allow an image to be used as an annotation, or a URL to an image? Then the user can pre-render whatever they want as an annotation, and just link to the hosted image with a URL

Describe alternatives you've considered I've just been using markdown as best as possible. I use annotations a lot for stat blocks so i dont have to leave PlanarAlly to look something up. Adding HTML support or just a URL to an image resource would make statblocks super easy to have handy, but it could also be used for player-facing annotations. They could be more detailed views of something/someone on the map, or any number of other interactable things the players can view on their own.

Additional context I really dont know how difficult any of this would be to impliment. I figure for an image resource or a URL to an image, you can just size the annotation popup to the size of the image, plus a little magin. I have no idea how you would try to size an annotation for html content that might be more dynamic. I was looking at https://github.com/Valloric/statblock5e when i figured i might as well ask if HTML or a URL to a resource might be something anyone else would be interested in.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kruptein/PlanarAlly/issues/739, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIXG6YFPYVE4EAYH5AANWTTKL5Y7ANCNFSM43QLAUPA .

PalasX commented 3 years ago

Your link should be aidedd.org ?

Yeah, reference to the asset pool in annotations is a good compromise. Super easy to pre render a bunch of blocks, and could be usefull for other player handouts

On Sat, Apr 24, 2021, 2:32 PM Adam Bordelon @.***> wrote:

Just a heads-up for some tools for you if you don't know about them tetra-cube makes beautiful 5e stat blocks. The best place for ready made and available monster manual and npc stat blocks (though they are html not images) is aided.org but it uses simple url parameters for it's blocks. I know this isn't strictly related to the tool but these are some super helpful tools for streamlining. I think there could be merritt to adding a stat-block tool into PlannarAlly. Even if it didn't use the dnd stat-block theme would allow a cleaner separation of use cases for annotation for text and information delivery. Not trying to but in at all and I think simple url image links might have merritt in annotation. Heck if it could do media links you could use an annotations hover to play a sound or something. But on the developer end allowing users to link to whatever is a huuuge security risk. Maybe a better compromise is allow annotations to reference assets in your asset pool.

On Sat, Apr 24, 2021, 9:29 AM PalasX @.***> wrote:

Is your feature request related to a problem? Please describe. Annotations accept text and understand Markdown, which is great, but sometimes limiting.

Describe the solution you'd like Allow HTML parsing in annotations. Alternatively, allow an image to be used as an annotation, or a URL to an image? Then the user can pre-render whatever they want as an annotation, and just link to the hosted image with a URL

Describe alternatives you've considered I've just been using markdown as best as possible. I use annotations a lot for stat blocks so i dont have to leave PlanarAlly to look something up. Adding HTML support or just a URL to an image resource would make statblocks super easy to have handy, but it could also be used for player-facing annotations. They could be more detailed views of something/someone on the map, or any number of other interactable things the players can view on their own.

Additional context I really dont know how difficult any of this would be to impliment. I figure for an image resource or a URL to an image, you can just size the annotation popup to the size of the image, plus a little magin. I have no idea how you would try to size an annotation for html content that might be more dynamic. I was looking at https://github.com/Valloric/statblock5e when i figured i might as well ask if HTML or a URL to a resource might be something anyone else would be interested in.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Kruptein/PlanarAlly/issues/739, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AGIXG6YFPYVE4EAYH5AANWTTKL5Y7ANCNFSM43QLAUPA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Kruptein/PlanarAlly/issues/739#issuecomment-826135069, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI3PBFVTU7WSOSVMBDLCUFTTKMFCLANCNFSM43QLAUPA .

Kruptein commented 3 years ago

A url to an image could be an easy addition, HTML is a bit more work as freddy mentioned it poses a security risk that will need to be taken care of.

the statblock5e repo looks cool, that might be interesting, tetra-cube and aiededd are also interesting.

dthv commented 3 years ago

Aren't images covered in markdown? Links should be. I'd go for markdown instead of HTML. :slightly_smiling_face:

PalasX commented 3 years ago

i had no idea images were convered in markdown!!! thats perfect! @dthv you're a life saver! i can just pre-render any statblocks i need, or handouts, or character portraits, or "upon closer inspection" zoom ins, or whatever, and host them along with PlanarAlly somewhere. GEE-NIUS!

Just tested this annotation:


This **word** is bold. This <em>word</em> is italic.
<img src="https://d33wubrfki0l68.cloudfront.net/eab45e25bb79970178fab7a2d10cba0209372a59/94d9e/assets/images/philly-magic-garden.jpg">
![](https://d33wubrfki0l68.cloudfront.net/eab45e25bb79970178fab7a2d10cba0209372a59/94d9e/assets/images/philly-magic-garden.jpg)

it shows the first WORD as bold correctly, and the second WORD as italic correct. It also shows both images! had no idea annotations were already allowing basic HTML. i should've tested before submitting i guess :) sorry!

What about an option to modify placement of annotations, such as left or right justified, instead of centered?

PalasX commented 3 years ago

0.27.0 version breaks embedding any HTML in the annotations. e.g. this doesnt work anymore for changing the font size of anotations: <span style="font-size:8pt;"> OR <font size="1">

I understand why you would want to clean HTML from the annotations, and thats probably a good call, but do we have any other option for alterting font size besides the ones provided by markdown? I was setting font size to 8pt just to save screen real-estate.

As always, another AWESOME update! Continued thatnks from my players! One of them has even taken to running a game with our map server and i'm helping them with tips and tricks on using it! You've made a wonderful tool that is facilitating real people making real memories. Can't tell you how awesome that is!!!

image

Kruptein commented 3 years ago

I see, this is due to another library being used to render the markdown. (as the update upgraded vue from 2 to 3, the previous library was no longer compatible)

I see that the library has an html option that defaults to false, so a quick fix is to set this to true, which I'll do when I come back from work on the dev branch.

If it disturbs your gameplay I can instead release it as a hotfix (or if you manage your own server you could patch it in yourself/wait form my dev PR)

Edit: and thank you for the nice words :)

PalasX commented 3 years ago

Thanks for looking into it so quickly! I just stole a few mintues from work to push 0.27.0 to the home server and realized it. I don't think a hotfix release is necessary, i can patch and rebuild later, or just pull the dev branch. I've actually got a game session tonight after work, so i'll probably just do it over the weekend. It does not really impact game play, its just more of a convenience factor.

PalasX commented 3 years ago

Everything working as expected with 0.28.0 release. Closing issue.