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

Adding hints in Front #68

Open
theottm opened this issue Mar 15, 2020 · 0 comments
Open

Adding hints in Front #68

theottm opened this issue Mar 15, 2020 · 0 comments

Comments

@theottm
Copy link

theottm commented Mar 15, 2020

Hello !
I read that it is pretty simple to add hints with html. https://chrisk91.me/2018/04/28/Adding-Hint-fields-in-Anki.html

So I achieved this by using EXPORT html in the Front section :

#+BEGIN_EXPORT html
<style>
#hintbutton {
 
 margin-top: 2em;
  font-size: 0.7em;
  width: 75px;
  background-color: lightgreen;
  border: 1px outset lime;
}

#hint {
 margin: 0.7em auto 0 auto;
 padding: 0.2em;
 border-radius: 5px;
 border: 1px lime outset;
 background-color: lightgreen;
 width: 75%;
}
</style>
#+END_EXPORT

What is blabla ? 

#+BEGIN_EXPORT html
<br /><button id="hintbutton">Hint</button>
<div id="hint" style="display:none"> This is an hint </div>

<script>
var hidden = true;
$("#hintbutton").click(function() {
  if(hidden)
  {
     $("#hint").fadeIn( );
  }
  else
  {
     $("#hint").fadeOut( );
  }
  hidden = !hidden;
});
</script>
#+END_EXPORT

I now have two questions:

  1. As you see I added a custom css style for this note. Is there a way to add this to the default css style used by anki-editor ?

  2. Where should I look in the anki-editor code if I would like anki-editor to export some part of text as hints using a specific syntax like

* card
** Front
What is blabla ?
[[hint][this is a hint]]
** Back 

and what kind of syntax should I preferably use ?

Thanks !

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

1 participant