jasonwilliams / anki

Anki VSCode Plugin
MIT License
278 stars 32 forks source link

Using level-four headings to separate cards leads to some issues #123

Open Colbyzn opened 10 months ago

Colbyzn commented 10 months ago

Problem Description

When I use level-four headings to separate cards, some errors occur:

  1. The noteID annotations cannot be automatically inserted (even though I have enabled this feature);

    image image

  2. The content on the back of the card includes level-three headings that it shouldn't.

    image

jasonwilliams commented 10 months ago

Hey thanks for raising

if you’re setting level 4 headings as a separator then it won’t separate on level 3 headings if I understand correctly. It will just include that like any other content.

Am I missing something here?

As for the NoteIDs we will have to look into that as it’s quite beta at the moment.

I’m also open to contributions as I don’t have much time to maintain this project at the moment

Colbyzn commented 10 months ago

I think you may have misunderstood my point.

I write the content in the markdown format following the structure of book, chapter, and section, which are represented by level-one, level-two, and level-three headings, respectively. The level-four headings represent questions, and the content below them represents answers.

If I write according to the standard markdown rules, where the headings are incremental, then the answer content corresponding to the level-four headings can include level-five and level-six headings. However, it should not include headings smaller than level-four, such as level-three, level-two, and level-one headings.

Therefore, headings smaller than level-four should not be placed within the answer.

I believe that when processing the content on the back of the card, a judgment condition should be added: if headings smaller than level-four are found in the content, they should be removed.

I understand that you are quite busy.

I have also considered making my own contributions to this project, but my programming skills are not yet sufficient to do so.

Therefore, I may need to spend more time studying your code and then thinking about how to implement the relevant features.

And until then, I can only hope that you can solve these problems.

Colbyzn commented 9 months ago

supplement:

The processing logic for the content on the back of the card should be determined by the card separator set by the user, deciding which titles should not be included on the back of the card.

For example:

  1. If the user uses level 2 headings as the card separator, then the back of the card should not include level 1 headings.
  2. If the user uses level 3 headings as the card separator, then the back of the card should not include level 1 headings and level 2 headings.
  3. If the user uses level 4 headings as the card separator, then the back of the card should not include level 1、level 2 and level 3 headings. ......

From the perspective of the hierarchy of the mind map, I would not want the level 3 headings 'CSS 选择器' to be processed as the answer to the level 4 headings 'CSS 作用'.

image