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

Fixing mustache tags and comments (back template has a problem) #56

Closed
kayx23 opened this issue Jul 19, 2020 · 17 comments
Closed

Fixing mustache tags and comments (back template has a problem) #56

kayx23 opened this issue Jul 19, 2020 · 17 comments
Labels

Comments

@kayx23
Copy link

kayx23 commented Jul 19, 2020

Hello there,
I downloaded and opened the .apkg. The two cards were imported into "Themes" but when I tried to view the cards, they show

Back template has a problem:
Found '⁨{{! Anki only}}⁩', but there is no field called '⁨! Anki only⁩'

Is there anything I can do to fix it?

Thanks!

@abdulrcs
Copy link

had the same problem, have you found the solution yet?

@readybuilderone
Copy link

had the same problem too

@Goratra
Copy link

Goratra commented Oct 16, 2020

I had the same issue. I just deleted '⁨{{! Anki only}}⁩' and it did the job

@Arthur-Milchior
Copy link

For an explanation: up until last year, probably 2.1.28, anki used a tool called mustache, and "{{!foo}}" was interpreted as a comment.
This was removed, and anyway, as the author seems to know, it is useless since html allow for comments <!-- comment -->

@Arthur-Milchior
Copy link

Note that {{{foo}}} is not valid anymore, this now leave a trailing }

@peter-moran
Copy link

Would fixing this be as simple as removing the use of {{{triple braces}}} and {{! brace comments}} from files in https://github.com/badlydrawnrob/anki/tree/8a1b6f75bad54131a58485538a0b217966238d75/source/themes/cards?

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Nov 26, 2023

Some useful notes for later:

Also I'm getting bugged about automatic pull requests (the only one that seems worth it is this one):

And a good article on npm commands for moustache, using a json file to populate the templates:

I've been incommunicado for a good while, and it seems like there's been quite a few changes that I'll get around to looking at in the future. However, I haven't used Anki in about 4 years, and I'm not coding other than as a hobby, really.

I'll take a look at some simple changes soon, but there's a few annoying bugs which might be harder to fix.

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Nov 26, 2023

Also please see this issue as another example of Dependency Hell :(

@badlydrawnrob
Copy link
Owner

@Arthur-Milchior @peter-moran @kayx23 @readybuilderone If you guys are still interested, there should be some changes coming out soon (once I've tested things on Anki app) — the one thing I haven't figured out yet is why Anki throws errors on the Cloze fields (although creating a new card doesn't seem to be a problem).

As for editing your color themes, hopefully this page and this advanced documentation (plus links to Github issues) will go a long way to making the build process easier to understand?

Let me know if you have any suggestions. Thanks 👍

@badlydrawnrob badlydrawnrob changed the title "Back template has a problem" Fixing mustache tags and comments (back template has a problem) Dec 3, 2023
@badlydrawnrob
Copy link
Owner

@Arthur-Milchior @peter-moran @kayx23 @readybuilderone One thing that would be extremely helpful is if you could send me over a couple of decks using Anki Themes — I've just logged into Ankiweb and realised ALL my old cards have vanished. 🤔

@kayx23
Copy link
Author

kayx23 commented Dec 3, 2023

Sorry I haven't been using Anki for a while and lost track of what this was about. Hope the others can assist!

@peter-moran
Copy link

iirc I've modified the decks a bit locally over time (love the theme though), but here are 100 random notes from my deck https://drive.google.com/file/d/1BIqmv_vIvS5E6bltLRErJjrU1ML_jJCN/view?usp=share_link

@badlydrawnrob
Copy link
Owner

badlydrawnrob commented Dec 4, 2023

@peter-moran That's perfect thank you. Would you mind giving me a quick overview of the changes you made? It seems like you're using both the first and second version of Anki themes and:

  • Syntax (inline code) is floated to the right of the title
  • You've converted the Title field to a {{cloze:type}} and moved it's position in the code
  • You don't seem to be using the `Syntax (code block) fields at all
  • I assume you're not using Pandoc to convert markdown->html either.

When you uploaded the second version of Anki, did you have any problems with compatibility? Any error messages like below? I can't remember if I created brand new Note Type or not.

@badlydrawnrob
Copy link
Owner

@kayx23 That's no problem! I hope it helped you out when you did use it. You've actually had a very interesting career path, would you mind me connecting on LinkedIn? I might have a couple of DM questions :)

@badlydrawnrob badlydrawnrob mentioned this issue Dec 4, 2023
2 tasks
@kayx23
Copy link
Author

kayx23 commented Dec 4, 2023

@badlydrawnrob I don't mind, happy to connect :)

@badlydrawnrob
Copy link
Owner

A fix is coming in the next release. Thanks for being patient.

@badlydrawnrob
Copy link
Owner

This is now fixed in the latest release

This was referenced Dec 27, 2023
@badlydrawnrob badlydrawnrob unpinned this issue Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants