google / mdbook-i18n-helpers

Translation support for mdbook. The plugins here give you a structured way to maintain a translated book.
Apache License 2.0
126 stars 25 forks source link

Create `RenderContext` using a real book #122

Closed mgeisler closed 9 months ago

mgeisler commented 9 months ago

Instead of hard-coding a large JSON string, we can use the real infrastructure instead and setup an actual book, load it, and use it to generate a context.

Using the actual dependency is preferable to using a mocked dependency since it allows us to test against the real implementation.

mgeisler commented 9 months ago

This swaps a tempdir dependency for one on tempfile: we already use tempfile in the rest of the codebase and tempfile is still maintained (https://lib.rs/crates/tempdir says that tempdir is unmaintained).

mgeisler commented 9 months ago

Thanks for the quick review, I better take out the dbg! statements before merging this! :smile: