Skip to content
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

HTML attribution #58

Closed
martinfleis opened this issue Aug 3, 2021 · 2 comments · Fixed by #60
Closed

HTML attribution #58

martinfleis opened this issue Aug 3, 2021 · 2 comments · Fixed by #60
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@martinfleis
Copy link
Member

We currently store attribution as a basic string only. I've noticed that interactive packages like ipyleaflet tend to add HTML links to OpenStreetMap and others. It might be good to add a support of html_attribution which would return HTML string with proper links.

@darribas
Copy link
Contributor

darribas commented Aug 3, 2021

This is a good idea. If nothing else is available (I think some providers do suggest HTML), we could have a build_html_attribution method with a simple yet stylish version?

@jorisvandenbossche
Copy link
Member

For the leaflet provider sources, the original actually has html attribution, which currently gets converted to plain text (for simple usage with matplotlib):

# convert html text to plain text
converter = html2text.HTML2Text(bodywidth=1000)
converter.ignore_links = True
value = converter.handle(value).strip()

So for those sources it should be easy to keep both in the parsed data.

@martinfleis martinfleis self-assigned this Aug 3, 2021
@martinfleis martinfleis added this to the 2021.08 milestone Aug 3, 2021
@martinfleis martinfleis added the enhancement New feature or request label Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants