python-visualization / folium

Python Data. Leaflet.js Maps.
https://python-visualization.github.io/folium/
MIT License
6.94k stars 2.23k forks source link

Override css and js links #1898

Closed hansthen closed 7 months ago

hansthen commented 8 months ago

Add a method to the JSCSSMixin that allows users to override a specific link to css or js. Unfortunately this still requires users to know the name of the of the link, which will require looking at the code or introspection.

Closes #1519

hansthen commented 7 months ago

I updated the code as requested. As to the documentation, adding links for javascript and css is mostly useful for writing plugins. Regular use will not typically require this API. What would you think if we added a guide for plugin writers to the advanced documentation and add the documentation there?

Conengmo commented 7 months ago

I updated the code as requested.

Thanks!

As to the documentation, adding links for javascript and css is mostly useful for writing plugins. Regular use will not typically require this API.

I don't think that's true. We've had users ask for this feature so they can make self contained maps that use local resources only. Also, https://github.com/python-visualization/folium/issues/1519 talks about his as a user from a Django context.

For developers we have our contribution guide, which has some guidelines on plugin development. I don't really see the link with this topic here.

I'm also fine with merging this and leaving the ticket open to add documentation in a later stage. What do you prefer?

hansthen commented 7 months ago

Yeah I see the other use cases now. I will add the documentation in this PR.