lervag/apy

markdown_models option not working

AdrienLemaire opened this issue · 4 comments

Added my sub-deck Pro::IT / Tech to the list of markdown models.
Expected: creating a card should show markdown: true
Actual: always seeing markdown: false

Added my sub-deck Pro::IT / Tech to the list of markdown models.
Expected: creating a card should show markdown: true
Actual: always seeing markdown: false

I wonder: The markdown formatting is only applied for "non trivial" cards. Thus, if you simply write text without any formatting, it will not be passed through the markdown converter. Would this explain your issue, or are you having this issue even for "complex" cards?

You strike me as quite competent, so I wonder if you would be able to do some personal debugging here. In the lines:

https://github.com/lervag/apy/blob/master/apy/anki.py#L364-L365

Could you add a breakpoint() here to investigate what might be happening? E.g., change the code to

            breakpoint()
            if model_name not in cfg['markdown_models']:
                input_string += ['markdown: false']

which should start a debugger session when the code hits the breakpoint() in which you can investigate the content of cfg['markdown_models'] and the value of model_name and with that try to understand if the input_string += ... is running as expected.

@lervag sorry about that, I made you lose your time :( I had confused model names with deck names.

ipdb> cfg['markdown_models']
['Pro::IT / Tech']
ipdb> model_name
'Basic'

Confirmed that it works as expected with "markdown_models": ["Basic"]
Closing 🙇

@lervag sorry about that, I made you lose your time :( I had confused model names with deck names.

No problem, not much time was lost. And everyone makes mistakes, so no worries! :)