Open garylavayou opened 1 year ago
Yes, you can refer to https://github.com/zjp-CN/mdbook-theme#avoid-repeating-call-on-this-tool-when-mdbook-watch
One solution is to set
[preprocessor.theme]
turn-off = true
once you don't modify the theme any more.
the auto-reload mechanism that detects the changes
mdbook always auto triggers mdbook-theme as long as you define a table [preprocessor.theme]
in your book.toml
, but this plugin hasn't considered comparing the differences[^differences], instead it always replaces...
I think to keep things simple, as stated in the link I give, you can also avoid repeating by commenting out the whole [preprocessor.theme]
table, meaning mdbook-theme
won't run, because the generated files under theme
folder won't change.
[^differences]: setting options result in various comparison strategies, like some options need to find the value in a file and compare it with the value in book.toml, but others need to detect whether there is already the replacement.
In the code (
src/theme/mod.rs
), it lacks a logic to determine if the currentindex.hbs
file already has thesidetoc
block. Hence, during each processing, thesidetoc
block will be added again.The results in
index.hbs
,In addition, if I run
mdbook serve
, the block will be inserted again and again, due to the auto-reload mechanism that detects the changes ofindex.hbs