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

[FEAT] Support questions within admonition code blocks #747

Open
DanielChicoUGR opened this issue Sep 23, 2023 · 12 comments
Open

[FEAT] Support questions within admonition code blocks #747

DanielChicoUGR opened this issue Sep 23, 2023 · 12 comments
Labels
enhancement New feature or request

Comments

@DanielChicoUGR
Copy link

Modify the parser to search inside the code blocks. With the use of the Admonition plugin, the text inside is not detected as flashcard.

@DanielChicoUGR DanielChicoUGR added the enhancement New feature or request label Sep 23, 2023
@ronzulu
Copy link
Collaborator

ronzulu commented Sep 24, 2023

Hi there, can you include some sample Markdown.

@DanielChicoUGR
Copy link
Author

Here is what i mean.
Screenshot_2023-09-25-11-47-35-723_md.obsidian.jpg

Screenshot_2023-09-25-11-47-45-987_md.obsidian.jpg

Thats part of my Fundaments of networks homework

I have looked the code of the parser but i dont know where to edit, (obviusly in the parser file....)

@ronzulu
Copy link
Collaborator

ronzulu commented Sep 26, 2023

Hi there

The parse function seems to explicitly skip over the content of code blocks, anything starting with ``` or ~~~.

I can imagine that in general that makes sense, code could easily have :: within a line for example,

A couple of options come to mind for implementation

  1. Include a new user option which would specify which types of code blocks should be parsed for questions.
  2. Some kind of markup within individual code blocks... perhaps just some variation of the standard
    <!--SR:!2023-09-20,1,230-->

Cheers
Ronny

@DanielChicoUGR
Copy link
Author

OOOO u are right, ill try something and i will make a pull req if i have something interesting

@Stefanuk12
Copy link

Expanding on a possible implementation, ignore any "termination" tokens if we are currently within a code block. The regex could be altered to account for this.

@reinvanimschoot
Copy link

Hey guys, is there any update on this? Or any workaround? I made an admonition called sr-cards only to realise that the cards are not picked up inside it haha. But it is much cleaner to have a folded admonition to store the cards, so I'm hoping for a workaround!

@DanielChicoUGR
Copy link
Author

Next week i end the smester and try some thoughts 😅😅😅😅

@DanielChicoUGR
Copy link
Author

panding on a possible implementation, ignore any "termination" tokens if we are currently within a code block. The regex could be altered to account for this.

Reading about this, how do u implement this way???

@Stefanuk12
Copy link

You can probably get AI to write the regex for the most part but if you match a ```, then don't match any ==, until the next. I'm not sure myself but it was just an ide.

@DanielChicoUGR
Copy link
Author

I got it, how can i make the pull request?, if i can, i can eve paste the code here, there was not so much code.

Questions before, i need to upgrade the doc, where i put that?

And last question, it pass the test but the summary dont say that
image

image

What i need to do?

@ronzulu
Copy link
Collaborator

ronzulu commented Feb 24, 2024

Hi @DanielChicoUGR

I got it, how can i make the pull request?, if i can, i can eve paste the code here, there was not so much code.

Pull requests are on a menu near the top of this page. Otherwise, here is the direct link:
https://github.com/st3v3nmw/obsidian-spaced-repetition/pulls

Questions before, i need to upgrade the doc, where i put that?

Great, most people don't think about documentation 😄
https://www.stephenmwangi.com/obsidian-spaced-repetition/contributing/

And last question, it pass the test but the summary dont say that !

Ideally, we would have 100% code coverage for non-GUI classes. We don't have that, but at the moment a handful of classes that the test framework Jest has been configured to check.

This includes parser.ts

image

Cheers
Ronny

@DanielChicoUGR
Copy link
Author

If just created the pr, if u need me to modify something just ask :)

@ronzulu ronzulu changed the title [FEAT] Code integration [FEAT] Support questions within admonition code blocks Jul 20, 2024
@github-project-automation github-project-automation bot moved this to In progress in Roadmap Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

4 participants