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

markdown option #32

Closed
AdrienLemaire opened this issue Sep 12, 2020 · 4 comments
Closed

markdown option #32

AdrienLemaire opened this issue Sep 12, 2020 · 4 comments

Comments

@AdrienLemaire
Copy link
Contributor

AdrienLemaire commented Sep 12, 2020

I have a problem with the markdown extension:

  • It sets a huge data-original-markdown attribute to the containing element
  • Modifying a card on Ankidroid breaks the layout, and then modification will be changed next time I reedit on the computer with markdown.

The only solution I've found at this point is to stop using the markdown plugin, but it appears that you add it by default for Basic cards:

apy/apy/anki.py

Line 357 in e51eac8

if model_name != 'Basic':

Can you allow us to set our preference in apy.json ?

The default could be something like:

{
    "markdown_models": ["Basic"]
}

In my case, I'd set "markdown_models": []

Edit: Checking again on the options, the presets config could be extended to enable/disable markdown as well

@lervag
Copy link
Owner

lervag commented Sep 12, 2020

I have a problem with the markdown extension:

* It sets a huge `data-original-markdown` attribute to the containing element

Yes, this is done to save the raw markdown. Anki displays the HTML, and so to be able to reedit the Markdown we need to store it somewhere.

* Modifying a card on Ankidroid breaks the layout, and then modification will be changed next time I reedit on the computer with markdown.

Not surprising. If you use the markdown "feature", you need to avoid editing on Ankidroid and instead mark the cards your are not happy with and edit them on your computer (this is what I do). I find Markdown very useful for e.g. creating cards with code snippets.

The only solution I've found at this point is to stop using the markdown plugin, but it appears that you add it by default for Basic cards:

apy/apy/anki.py

Line 357 in e51eac8

if model_name != 'Basic':

Yes. As you've probably realized, I've mainly developed apy to satisfy my own need. But I'm happy to improve and polish to make it more usable by others!

Can you allow us to set our preference in apy.json ?

The default could be something like:

{
    "markdown_models": ["Basic"]
}

Good idea!

In my case, I'd set "markdown_models": []

Edit: Checking again on the options, the presets config could be extended to enable/disable markdown as well

Yes, I think I'd like the first option primarily, but perhaps this could also be used and have priority? Note, currently the presets only have an effect on apy add-single.

lervag added a commit that referenced this issue Sep 12, 2020
This option allows to specify for which models apy will use the Markdown
convert by default.

refer: #32
@lervag
Copy link
Owner

lervag commented Sep 12, 2020

I've added "markdown_models" now, please test.

@AdrienLemaire
Copy link
Contributor Author

AdrienLemaire commented Sep 12, 2020

apy add will successfully put markdown: false in my new cards:

This is probably the fastest feature request resolution I've ever seen on github ^^' Thank you!

@lervag
Copy link
Owner

lervag commented Sep 12, 2020

This is probably the fastest feature request resolution I've ever seen on github ^^' Thank you!

Haha, no problem :)

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

No branches or pull requests

2 participants