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

Creat more field ? #336

Open
locpham122k opened this issue May 17, 2024 · 1 comment
Open

Creat more field ? #336

locpham122k opened this issue May 17, 2024 · 1 comment

Comments

@locpham122k
Copy link

I am developing my own dict. Alongside these field Expression, Reading, Definition, Definitions,... I wonder if there's any way to create more fields such as Synonyms, which would display on options window like the others ?

@ninja33
Copy link
Owner

ninja33 commented May 20, 2024

OK, assume you are familiar with HTML/CSS/JS realated tech stack.

you can put other fields data in spare fields like extrainfo, then you go to anki card template to put this fields on card front/back, the content of extrainfo can be any format of string (splitted by | , or even json string). but embrace it with a hidden class like

.hidden{
  display:none;
}

<div id='extra' class='hidden'>{{extrainfo}}</div>

so, you card will not display it by default, and then you can put some js code to retrieve those info

<script>
  const extrainfo=document.getElementById("extra").innerText;
  // manipulate, split or paser {{extrainfo}} as you wish and put it on card front/back DOM
</script>

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