Closed timvink closed 3 years ago
Hee, thanks for letting me know!
I would like to reproduce this issue locally, but both mkdocs build
and mkdocs serve
work fine for me. Perhaps you have a minimal reproducable example? Or even better, an alternative solution?
Tim
Hee, thanks for letting me know!
I would like to reproduce this issue locally, but both
mkdocs build
andmkdocs serve
work fine for me. Perhaps you have a minimal reproducable example? Or even better, an alternative solution?Tim
Hey Tim,
as mentioned mkdocs build
works like a charm. When i start mkdocs serve
it initially looks fine, but the error occurs, when i try to navigate in the dev
server site.
Cheers
Can confirm @rmueck.
Same exception "Tried to write more data than Content-Lenght"
Thanks @rsansores .
I don't have time to work on this currently, hope to revisit in a couple of weeks or so. Feel free to pick up the PR :)
Hello! Any update on this PR? Does it work with latest version of mkdocs-material? (5.3.0)
I have a suggestion. You should specify parser for icon. Example: icon = BeautifulSoup(icon, 'html.parser')
Thanks @Kanaduchi for the pointer! Quite sure that will fix the HTTPOutputError
.
I also fixed the icon size, which was wrong. If someone can confirm that it works for them as well, we can flag this as ready for merge to zhaoterryy.
Thanks @Kanaduchi for the pointer! Quite sure that will fix the
HTTPOutputError
.I also fixed the icon size, which was wrong. If someone can confirm that it works for them as well, we can flag this as ready for merge to zhaoterryy.
I verified it locally.
One issue that I see is:
I think you also need to remove a.string = '\uE2C4'
I think you also need to remove
a.string = '\uE2C4'
That line was already removed. I now also removed any unnecessary attributes from the svg.
Renders correctly on chrome and safari, and latest mkdocs-material
version:
Now it looks great! Thank you! Hope this PR will be merged soon
@zhaoterryy ready for merge 😃
I found & fixed another bug, present on master
and also in this fix-download-icon
branch
soup = BeautifulSoup(html, 'html.parser')
actually does more than just parse the HTML, it also applies some 'fixes'. This leads to unintended side effects (other than inserting the button). For example, when used in combination with mknotebooks BeautifulSoup will break the HTML and the jupyter notebooks don't render correctly (on some browsers / platforms). Took a while to find that bug, but solution was easy: insert the button using basic python string manipulation.
@timvink cheers!
Fixes download icon for material theme, #83
Demo: