Testing local changes #73
-
Hi all! Do you have any tips for testing the executables in this helpers repo? I am working on #67 and currently have some changes made in the main function to It looks like it may be possible to call it directly, I just cannot find the correct shape for the RenderContext config:
Is there an example 'input' to this executable that someone could give me the template for? Or alternatively, is there a way that I can use this 'local' version of mdbook-i18n-helpers in a repository that uses it already like Comprehensive Rust? I was looking at this, but since Comprehensive Rust uses a specific version I wasn't sure if I could point the dependency on mdbook-i18n-helpers to a specific commit or similar in this repository. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Figured out the solution 😄 For others who are interested:
|
Beta Was this translation helpful? Give feedback.
-
As a side-note, the way to test this would be to write a unit test. The let split_depth = cfg
.get("split-depth")
.ok_or_else(|| anyhow!("Missing output.xgettext.split-depth config value"))?
.as_int() // or similar, I didn't look up the toml API
.ok_or_else(|| anyhow!("Expected an integer for output.xgettext.split-depth"))?; You should probably not error out if the value isn't set: instead use a default so that users get the current behavior. |
Beta Was this translation helpful? Give feedback.
Figured out the solution 😄
For others who are interested:
comprehensive-rust
repository (or the repository that makes use of this that you want to use)mdbook-i18n-helpers
with the local copy (keep in mind you will need tocargo install mdbook-i18n-helpers
when you want to go back to the real versioncargo install --path ../mdbook-i18n-helpers/
xgettext
specifically, set the config and then build the bookMDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' mdbook build -d po