Closed matthias-colt closed 1 year ago
I think the fix you're looking for is about
Where title_text
should be an explicit str.
@2bndy5 thanks for your quick reply!
You are right, if I change this code line to pass explicit string, then sphinx works:
textnodes, messages = self.state.inline_text(str(title_text), self.lineno)
A PR is welcome if you want to submit this yourself.
Yes, I will provide a PR after some more testing.
Seems that the source of the class type title text comes from self.default_title
in line https://github.com/jbms/sphinx-immaterial/blob/0570eadc78e205892dd90f7a0f03762a91c41643/sphinx_immaterial/custom_admonitions.py#L185
Could be sufficient to make this explicit string.
I think that may be better yes. This was my first attempt at handling translated strings 😊
fix released with v0.11.2
I've changed from recommonmark to MyST renderer for markdown and now get an exception error if I try to create the documentation with sphix:
The stacktrace indicates an issue in the
mardown_it
package which is used bymyst_parse
The issue is that the
parseInline
function in themain.py
module ofmarkown-it-py
expects to receive a string type object but it seems to get asphinx.locale._TranslationProxy
instead from thesphinx_immaterial
extension.If I use a different theme like standard
alabaster
, then I don't get this issue and the document renders as expected.As a workaround I changed the string check in line 283 in
mardown-it-py
as below, it works.But I think the correct solution should be that this
sphinx-immaterial
theme correctly passes a string object to the markdown parser and not<class 'sphinx.locale._TranslationProxy'>
as it currently seems to do.