Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple wordlists via command line parameter #169

Closed
grhm opened this issue May 26, 2022 · 1 comment · Fixed by #179
Closed

Allow multiple wordlists via command line parameter #169

grhm opened this issue May 26, 2022 · 1 comment · Fixed by #179

Comments

@grhm
Copy link
Contributor

grhm commented May 26, 2022

I have a sphinx build that is embedded in a larger build process and adding/editing the conf.py that is generated is non-trivial.
We have been adding our custom word list via a -D spelling_word_list_filename=my_words.txt parameter on the sphinx command line.

The documentation says you can use multiple text files with words to be added to the dictionary, if you set the spelling_word_list_filename to a list. This works if you set the list in the conf.py file, but using a -D parameter only allows the addition of a single word list. We'd like to add several, but the way that command line parameter is handled, it is always given to sphinxcontrib-spelling as a string.

It would be nice if I could add a list of filenames via -D spelling_word_list_filename=[my_words.txt,other_words.txt] or some similar format.

Looking at the code, I think a small change in builder.py to check the incoming string and, if it starts and ends with square brackets, split it into a list would work.
i.e. just before Line 109 (https://github.com/sphinx-contrib/spelling/blob/master/sphinxcontrib/spelling/builder.py#L109).

Would you consider adding this? If so, I can probably contribute a pull request to add it.

dhellmann added a commit to dhellmann/spelling that referenced this issue May 30, 2022
Add tests for previous work to support multiple wordlist filenames.

Clean up documentation for the configuration option.

Refactor wordlist filename handling in the builder to make it more
testable.

Fixes sphinx-contrib#169
@mergify mergify bot closed this as completed in #179 May 30, 2022
@dhellmann
Copy link
Member

This work was released in 7.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants