mkdocs-with-pdf
mkdocs-with-pdf copied to clipboard
custom admonition type in PDF
The custom admonition type in PDF cannot be displayed, only the default style is displayed. Please instruct me how to set it?
Hi @cooper-lzy.
Now, mkdocs-material
generates style is:
.md-typeset .note>summary:before {
background-color: #448aff;
mask-image: var(--md-admonition-icon--note);
...
}
But, WeasyPrint not supports mask-image
.
This plugin set custom css.
To customize the icon, you need to set it yourself in your styles, e.g:
@media print
.md-typeset .note > .admonition-title::before, .md-typeset .note > summary::before {
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox=....") !important;
}
See this polyfill:
https://github.com/orzih/mkdocs-with-pdf/blob/65f36ba383b022627df54db00d885d9e06dedd09/custum_style_src/material-polyfills/src/stylesheets/extensions/_admonition.scss#L62-L76