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

npm run pandoc for Anki Card's data (and design tradeoffs) #98

Closed
4 tasks done
badlydrawnrob opened this issue Jan 13, 2024 · 3 comments
Closed
4 tasks done

npm run pandoc for Anki Card's data (and design tradeoffs) #98

badlydrawnrob opened this issue Jan 13, 2024 · 3 comments
Labels
difficulty: hard This could be difficult to achieve enhancement thinking about

Comments

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Jan 13, 2024

Compiling Markdown for your cards:

For short snippets of Markdown, use code.html;

  • themes/cards/missing/missing.md or /simple/simple.md are preferred for viewing in browser.
  • However, themes/cards/*/*-stripped.md files are quicker to view/copy code.

In the root folder you can npm run pandoc or npm run Pandoc-stripped.

Unfortunately Safari doesn't show the nice unicode icons (like ) without -standalone flag. This is because Safari has latin1 formatting as standard over the more common UTF-8.

  • The non-stripped files add more "junk" to the HTML file;
  • This makes it a bit harder at-a-glance to grab our card data for Anki.
  • Compiled code.md or *-stripped.md are far nicer view/copy into our code block field.

Possible solutions

Best case scenario is to cut down the HTML code as much as possible.

  1. Go back to what we had before, and deal with the garbled output?
  2. Try and remove the header css from the HTML template header (link to main.css instead)
  3. Use the browser and inspect element each section to copy/paste ...
  4. Or just use your favourite text editor to preview once compiled.

Markdown options

Why?

Safari still defaults to (Western ISO Latin 1) charset

If Safari doesn't have the correct <meta> values, with content wrapped in a <body>, the unicode characters (stars etc) will be garbled (like the closed issue linked to above)

<html>
  <head>
      <meta charset="utf-8">
  </head>
  <body>
      /* content */
  </body>
</html>

Seems like this is a known frustratingly annoyingly stupid Safari bug that can be changed in browser preferences, but might have to be fixed with the above method (not raw html without the wrapping)

Oh what fun it is to code for the web 🤬

@badlydrawnrob
Copy link
Owner Author

badlydrawnrob commented Jan 13, 2024

Coding for browsers is a clusterfuck

Screenshot 2024-01-13 at 22 22 27 Screenshot 2024-01-13 at 22 38 30

@badlydrawnrob badlydrawnrob added difficulty: hard This could be difficult to achieve and removed difficulty: easy This is an easy edit labels Jan 14, 2024
@badlydrawnrob
Copy link
Owner Author

Marked as hard because it's part of the advanced documentation

@badlydrawnrob badlydrawnrob changed the title Design tradeoffs npm run pandoc npm run pandoc for Anki Card's data (and design tradeoffs) Jan 14, 2024
@badlydrawnrob badlydrawnrob changed the title npm run pandoc for Anki Card's data (and design tradeoffs) this npm run pandoc for Anki Card's data (and design tradeoffs) Jan 14, 2024
@badlydrawnrob badlydrawnrob changed the title this npm run pandoc for Anki Card's data (and design tradeoffs) npm run pandoc for Anki Card's data (and design tradeoffs) Jan 14, 2024
@badlydrawnrob
Copy link
Owner Author

badlydrawnrob commented Jan 18, 2024

Even the HTML view fucks up ★ unicode characters the in the inspector:

Screenshot 2024-01-18 at 15 31 53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: hard This could be difficult to achieve enhancement thinking about
Projects
None yet
Development

No branches or pull requests

1 participant