These options are provided so that users can opt out from using the CDN and self-host the CSS and fonts.
static-css: mdbook-katex downloads the CSS and fonts using reqwest every time mdBook builds, and have to download again because mdBook wipes all the files in book/.
no-css: mdbook-katex does not inject CDN link any more. The user needs to add the CSS and fonts to their mdBook project themselves.
An example of using no-css is provided in mdbook-katex Static CSS Example using Python3.
(I also intend to move the code we currently have that is used to download the CSS and fonts into another repository to provide a Rust binary).
User impact deprecating static-css
Users using static-css = true will not have static CSS, rather, mdbook-katex will inject CDN header.
TODOs
[x] Provide a Rust binary that downloads CSS and fonts for the no-css option.
[x] Update README for the instructions to use no-css.
[x] Give a warning about deprecating static-css in v0.3.12.
[x] Remove option static-css in v0.4.0.
Deprecate mdbook-katex renderer
We have been asking users to add [output.katex] to their book.toml despite mdbook-katex is not a renderer.
(We only provide a fake renderer to force mdBook to output the artifact at book/html/ instead of book/. This is done so that we know where to inject the static CSS (always at book/html/) without having to worry about whether the user have other renderers.)
This is unnecessary and brought us many issues (#33, #48). Most users don't need static-css anyway and are instead confused why their artifacts are in book/html/.
User impact deprecating the renderer
Users will see an error complaining that katex does not support renderer when their book builds if they set [output.katex].
They will need to remove [output.katex] in their book.toml so it look like the book.toml in the README. Then, their artifact will be output at book/ instead of book/html/ if they don't have other renderer plugins.
TODOs
[x] Give a warning about deprecating [output.katex] in v0.3.12.
[x] Remove the fake renderer in v0.5.0.
Original issue opened on Feb 9
Currently, the renderer downloads the CSS files and fonts into the build target directory (book) if static-css option is turned on. There are two major drawbacks:
mdBook wipes book before each build, so everything needs to be downloaded again.
To ensure that we know where the output HTMLs are located, we created a dummy renderer.
What we should have done instead, is to download the CSS in the theme folder and the fonts in the theme/fonts folder and ask the users to add something like this to their book.toml:
Deprecate
static-css
in favor ofno-css
These options are provided so that users can opt out from using the CDN and self-host the CSS and fonts.
static-css
:mdbook-katex
downloads the CSS and fonts usingreqwest
every time mdBook builds, and have to download again because mdBook wipes all the files inbook/
.no-css
:mdbook-katex
does not inject CDN link any more. The user needs to add the CSS and fonts to their mdBook project themselves.An example of using
no-css
is provided in mdbook-katex Static CSS Example using Python3. (I also intend to move the code we currently have that is used to download the CSS and fonts into another repository to provide a Rust binary).User impact deprecating
static-css
Users using
static-css = true
will not have static CSS, rather,mdbook-katex
will inject CDN header.TODOs
no-css
option.no-css
.static-css
in v0.3.12.static-css
in v0.4.0.Deprecate
mdbook-katex
rendererWe have been asking users to add
[output.katex]
to theirbook.toml
despitemdbook-katex
is not a renderer.(We only provide a fake renderer to force mdBook to output the artifact at
book/html/
instead ofbook/
. This is done so that we know where to inject the static CSS (always atbook/html/
) without having to worry about whether the user have other renderers.)This is unnecessary and brought us many issues (#33, #48). Most users don't need
static-css
anyway and are instead confused why their artifacts are inbook/html/
.User impact deprecating the renderer
Users will see an error complaining that
katex
does not supportrenderer
when their book builds if they set[output.katex]
.They will need to remove
[output.katex]
in theirbook.toml
so it look like thebook.toml
in the README. Then, their artifact will be output atbook/
instead ofbook/html/
if they don't have other renderer plugins.TODOs
[output.katex]
in v0.3.12.Original issue opened on Feb 9
Currently, the renderer downloads the CSS files and fonts into the build target directory (
book
) ifstatic-css
option is turned on. There are two major drawbacks:book
before each build, so everything needs to be downloaded again.renderer
.What we should have done instead, is to download the CSS in the
theme
folder and the fonts in thetheme/fonts
folder and ask the users to add something like this to theirbook.toml
: