-
Notifications
You must be signed in to change notification settings - Fork 30
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
Adding embeddable cards in a backward compatible way. #91
base: main
Are you sure you want to change the base?
Conversation
…ng the scope of the processing to the content between <!-- BEGIN_ANKI_CARDS --> and <!-- END_ANKI_CARDS --> comments.
Hey @vavdoshka thanks for this PR, looks good. I’ll try and take a proper look |
I just updated the logic slightly. |
5f5813b
to
42929da
Compare
Hey @vavdoshka, Implementation looks good, it may be worth adding a test here or here |
@@ -56,33 +56,30 @@ export class MarkdownFile { | |||
|
|||
|
|||
private extractMarkedText(content: string): string { | |||
// extract the text between markers - markdown comments <!-- BEGIN_ANKI_CARDS --> text <!-- END_ANKI_CARDS --> | |||
// if the markers are not present then return the entire content | |||
// Extract the text between markers - markdown comments <!-- BEGIN_ANKI_CARDS --> text <!-- END_ANKI_CARDS --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move these comments above the function using /** */
syntax?
its just so then you would get the function description when hovering over the symbol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, cool, thanks. I'll do it as soon as I can.
Yes, I am also planning to add an action (command) to start the embedded Anki card, which will paste the markers under a cursor and move the cursor inside the quotes.
<!-- BEGIN_ANKI_CARDS -->
|
<!-- END_ANKI_CARDS -->
Any suggestions for the naming of that action? Thought of Anki: Start Embedded Cards
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anki: Start Embedded Cards
Should this be offered as a snippet instead? It looks more like a snippet than a full-on-command. I think the extension can contribute snippets
Pings @vavdoshka are you still active on this? |
Added embeddable cards in a backward-compatible way. Allows limiting the scope of the processing to the content between
<!-- BEGIN_ANKI_CARDS -->
and<!-- END_ANKI_CARDS -->
comments.I found it helpful to embed the Anki Cards definitions into documents with some knowledge base data.
This change is backward compatible and should work with all the existing features from how far I've tested.