Skip to content

fix --rules-dir in mathml2text CLI#543

Open
moritz-gross wants to merge 3 commits into
daisy:mainfrom
moritz-gross:fix-rulesdir-in-mathml2text
Open

fix --rules-dir in mathml2text CLI#543
moritz-gross wants to merge 3 commits into
daisy:mainfrom
moritz-gross:fix-rulesdir-in-mathml2text

Conversation

@moritz-gross
Copy link
Copy Markdown
Collaborator

While testing out the mathml2text CLI, I noticed that --rules-dir seems to not actually be used.
For example, the following shouldn't work right? cargo run --bin mathml2text -- --rules-dir /some/other/rules

Regarding the integration tests, I don't really know what I'm doing there.

* Added `resolve_rules_dir` function to handle `--rules-dir` resolution.
* Updated logging to display the resolved rules directory.
* Added tests ensuring correct behavior for explicit `--rules-dir` usage, default rules-dir fallback, and invalid rules-dir handling.
@masonium
Copy link
Copy Markdown
Contributor

@NSoiffer asked me to take a look. The actual rules_dir fix looks good. I'll leave a couple of other comments inline.

Comment thread tests/mathml2text.rs Outdated
Comment thread tests/mathml2text.rs
@NSoiffer
Copy link
Copy Markdown
Collaborator

@masonium: Should I close this without merging?

@moritz-gross
Copy link
Copy Markdown
Collaborator Author

moritz-gross commented Jun 4, 2026

I think the comments by @masonium make sense, I just forgot that this PR existed. I'll do it in the coming days.

side note: I'm unsure how I just update this branch. 99% sure I clicked "Sync fork" in my repo, so https://github.com/moritz-gross/MathCAT should've been affected. or what am I missing?

@moritz-gross
Copy link
Copy Markdown
Collaborator Author

@masonium is this what you had in mind? so far I've not written any fixtures for CLI or file system interaction, particularly in Rust.

Is the Drop trait needed when using temp_dir? From how I unterstood the docs, it is, but I'm usure.

failure of linting in main.rs seems unrelated to my changes.

@moritz-gross moritz-gross added the rust Coding in Rust label Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Coding in Rust

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants