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

Remove '<h2>' when passing to Anki #81

Open
rubisco57 opened this issue Jul 20, 2022 · 4 comments
Open

Remove '<h2>' when passing to Anki #81

rubisco57 opened this issue Jul 20, 2022 · 4 comments

Comments

@rubisco57
Copy link

Thank you for sharing this plugin!

I would like to remove the h2 tag resulting from the usage of markdown level 2 headings as card separator. It is nice for visual display in vscode, but ugly on the flashcards. Mapping ## to another tag in the conversion or just nothing, would be a good solution.
Could you provide some build instructions? I could not get it to work, as it is the first time I am using esbuild.

@jasonwilliams
Copy link
Owner

jasonwilliams commented Jul 20, 2022

Mapping ## to another tag in the conversion or just nothing, would be a good solution.

I think you're right, we can probably just map it to nothing which may be better than a H2. Looks like we already do this for cloze cards so could probably just do it across the board.

I could not get it to work, as it is the first time I am using esbuild

You shouldn't need to do anything special with esbuild, just:

  • $ npm install
  • $ npm run watch
  • Make sure Anki is up and running
  • in VSCode go to debug and launch "Run Extension"

This should give you access to a debug view, you may need to disable the production version of the extension while you do this. Once the above works you can start off by breakpointing here https://github.com/jasonwilliams/anki/blob/main/src/markdown/parsers/cardParser.ts#L61

@rubisco57
Copy link
Author

Thank you for your time, @jasonwilliams, and for guiding me in compiling my first VSCode extension. The Anki cards now follow the standard format.

@jasonwilliams
Copy link
Owner

@rubisco57 you don't want to offer a PR to have it fixed upstream?

@jasonwilliams jasonwilliams reopened this Jul 21, 2022
@jasonwilliams
Copy link
Owner

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