tommilligan / mdbook-admonish

A preprocessor for mdbook to add Material Design admonishments.
MIT License
171 stars 18 forks source link

While converting the book to pdf, the admonish blocks are not rendered properly. #151

Closed csk111165 closed 10 months ago

csk111165 commented 10 months ago

Hi @tommilligan,

Good morning. I tried to use the admonish block for creating the mdbook and tried to convert the book to pdf using below two options:

But both the method yielded in not getting the proper formatted block.

Could you please help @tommilligan

PDF output

image

tommilligan commented 10 months ago

Hi, thanks for reporting this issue. Agreed that from your screenshot the rendering looks different than in browser.

I'm guessing we can investigate CSS/HTML that renders better both in the browser and in PDF printing. I'm not aware of how mdbook-pdf works - I guess looking at the rendering engine there might give some hints. It may just be that we need to transpile/fallback a bunch of the CSS to target the renderer?

This isn't something I'm particularly interested in doing myself. I'm very open to PRs and reviewing anything you come up with though.

csk111165 commented 10 months ago

Thanks @tommilligan for acknowledging the same, as mentioned above that I used browser's inbuilt functionality of converting the html to pdf using ctrl+p (in windows) but again the result were same as converting it into pdf using mdbook-pdf. I would have loved to contribute to this fix but my technical expertise restricts me from raising a PR as I am now well versed with front end side. I request you to please provide a fix as it is important in many case.

Please do consider the request, Thank you :)

tommilligan commented 10 months ago

You can try the fix for this out locally with

cargo install --git https://github.com/tommilligan/mdbook-admonish --branch main

It will also be included in the next release. Let me know any other feedback you have!