hgiesel / closet Goto Github PK
View Code? Open in Web Editor NEWThe Web Framework for Flashcards
Home Page: https://closetengine.com
License: GNU General Public License v3.0
The Web Framework for Flashcards
Home Page: https://closetengine.com
License: GNU General Public License v3.0
zoom
: Otherwise they get so big, you can't see anything.[[show::rect{,2}]]
=> rect and rect2
[[show::*]]
=> everything
What I mean by closet inside Mathjax is the following:
\( \square [[c1::( \square \varphi \to \psi ) ]] \lor \square ( \square \psi \to \varphi ) \)
Why?
Using native anki clozes and closet clozes) you can do this without requiring a cloze inside of the mathjax formula:
\(\forall \varphi, \psi ( \mathcal{F}\models\){{c1::\(\square ( \square \varphi \to \psi ) \lor \square ( \square \psi \to \varphi) ) \)}} \( ) \)
With the corresponding render:
This however has quite some disadvantages, namely a lot of extra cruft to split one mathjax formula into multiple mathjax formulas, not being able to use \left( \right
(and other variants) and incorrect alignment of symbols as can be seen in the screenshot above and more clearly here:
In this case the spacing is incorrect, in latex the \models
symbol is aligned better too I believe, such that the following symbol is centered on the y-axis but this is a more general mathjax/ anki mathjax bug I believe.
Incorrect:
I could imagine that this would be impossible or either very hard to implement, it would however certainly be very nice.
I followed along, and made closet cards with closet/asset manager per your video tutorial 3+ weeks ago. I revisited it today and updates seems to have broken basic functionality. for example, a very basic cloze syntax " [[c1::...]]
isn't working.
I basically tested this by making a copy of the Commands
sample deck. I tested that both Commands
and Commands copy
work before updating Commands copy
with the asset manager button Write to Templates
.
If Closet executes while MathJax is rendering, that's a bug.
Now that Closet executes before MathJax is rendering, that's fine.
But best would be if Closet could reliably execute before MathJax starts rendering. Atm that's not quite possible, because Closet executes asynchronous, but the Anki ts hooks are synchronous.
Some examples:
closet__shuffle-1
closet__shuffle-2
closet__cloze
closet__cloze-hint
closet__multiple-choice--correct
closet__multiple-choice--correct-1
closet__multiple-choice--correct-2
This will include a lot of ::before
and ::after
in __closet.css, e.g.
span:last-child::after {
content: '・';
}
span:last-child::after {
content: '';
}
after the latest update, only the closet setup script seems to be loaded by asset manager, not the closet script itself.
functions on the tag object:
valueString(trim: bool): string => get raw values
values(sep: str, trim: bool): string[] => get values separated by sep
values2d(sep: str, sep1: str, trim: bool): string[][] => get 2d values separated by TAG_SEP first, then sep
values3d(sep: str, sep1: str, sep2: str, trim: bool): string[][][] => ...
This would mean that everything which works with tags must be reworked, e.g. the Stylizer => FullStylizer wouldn't be necessary anymore: even now it's basically just two Stylizer postcomposed.
Could automatically unwrap inner <br>
tags.
Should still accept partial values:
[[#mixl::attr1::attr2]]<attr3 stripped by one layer of <br> (if exists)>[[/mixl]]
Hi hgiesel!,
There´s no way to make "flashcard features" work. I spent 2 days trying it and now it´s time for some help. I followed the instructions in youtube video. I have lastes stable Anki 2.35 an latest Closet update.
Here´s an exported deck with one single card if it helps to undestand what is happening or what i´m doing wrong: https://www.dropbox.com/s/mi6zoalf9qt5v5u/Reveal%20On%20Key%20Press%20Test.apkg?dl=0
Thanks for your time!!
Similar to Event propagation I also have a capturing phase and a bubbling phase.
[ { :id [0 0]
:alts [ { :kind "text"
:value "This is some text" }
{ :kind "vs"
:fullName "c1"
:name "c"
:idx 1
:sub 0
:values ["clozed text", "hint"]
...wrapped in an atom, ofc
I was wondering whether syntax highlighting using something like highlightjs would be possible. I'm not well versed enough in web technologies and such to estimate whether it would be. But if it is possible in the current closet framework I could investigate and see if I'd be able to get it working.
What I'd like to see is being able to have the following example code (are linebreaks permitted?):
[[code::
const frontStylizer = backStylizer.toStylizer({
mapper: wrapWithBrackets,
})
]]
Appear as:
const frontStylizer = backStylizer.toStylizer({
mapper: wrapWithBrackets,
})
And to be able to add a cloze with properly highlighted code while the cloze is properly styled too:
const frontStylizer = backStylizer.toStylizer({
mapper: [[c::wrapWithBrackets]],
})
Although this might need to be part of a more generalized styling part of closet given that customizations such as being able to set the monotype font to use in [[code::...]]
should be part of a generalized way to set customs fonts and such.
(defn check [pre, c]
#(and (starts-with? pre %)
(= (count %) c)))
(def my-check (check [0,0] 3))
(my-check [0,0,1]) /* error resolving pre and c */
Context of check
is lost along the way.
Both pick / eval, as well as unique constraints should be built on listStore
.
whether or not an empty string constitues a value to continue on
Can be uniformly accessed with window.getComputedStyle(element)
Having arguments like [[mix::argument one<SEP>"argument \" two <SEP"<SEP>'argument \' three <SEP>']]
has two arguments:
. escape characters (open, close)[]
. argument separator, could be space
[[mix::abc def "ghi jkl"]]
Describe the bug
Other than the generated mathjax formula itself a piece of light gray text is shown. As can be seen here:
Code used for note:
\(x^2\) [[c1::hallo]]
However after one review this grey text disappears:
The gray text only reappears when stopping the reviewer i.e. exiting to the browse window.
More weird stuff happens when I include a mathjax formula in the cloze:
Code used for note:
\(x^2\) [[c1::\(x^1\) hallo]]
[[c2::\(test\)]]
[[c3::\[test\] ]]
Debug information
initCloset()
fails, this doesn't make a whole load of sense though given that clozes without mathjax are working just fine.
(The file has an added .zip
extension)
test.apkg.zip
It looks like it is mixing in the preview window but not when actually studying...
Link to my 2 card types https://drive.google.com/file/d/1xwVGVapA7ttB_STlOsqzr51ODZeA1MLZ/view?usp=sharing
mac os Catalina
anki 2.1.33
It is what is used by Anki alternate build
Looks like it would be great, and would give an excuse to play with React:
I would want to at least wait for the v2 release, though.
Not sure how this should behave, maybe a toggle?:
Rename references to FilterManager to Setups
=> more human friendly.
make setups composable => you can choose multiple setups in tester, in docs, they should be able to be previewed in a concatenated manner.
add "Export setup" button to tester
This would require two special divs:
div
with id="closetOcclusionContainer
, for the first insertion.div
, containing all occlusions with id="closetOcclusionOcclusions"
Will require extending the occlusion editor EventTarget
to cover all update actions.
Describe the bug
Hi, first of all, thank you for your work! I'm having a hard time getting images occlusions to work though. It seems everything is fine until I try to review them and only the first card is generated from the first occlusion on the image. Btw I read on the add-on page that the add-on only works with anki up to 2.1.32. Is it still the case?
Debug information
No error in console log to be found.
Thanks a lot again.
CH topic voc.zip
Same button clicked again: discard memory
another button clicked: retain memory
they should add an easy function name and wrap it in something like:
function thisIsTheName(filterManager, preset, memory) {
...the code...
}
This requires:
cursorOffset
function to detect position in fieldnumber → maybe<tag>
, which shows which tag is active at the current position of the cursorSpecifically TAG_OPEN
, TAG_CLOSE
, ARG_SEP
.
Once Label support is available in asset manager, so we can have one dynamic import execute asynchronously, and that's it.
I'm waiting on webpack to implement it.
This is a big issue.
I use occurence numbers to uniquely identify tags within some filters.
However they are not:
However this works:
This will render wrong.
The correct solution would be to:
flatMap
the innerTags rather than reducetemplateApi
Works like mix, but evaluates. This will be similar to how the eval
filter will work, but it picks according to the card type.
select
and ???
[[select]]
will evaluate to the thing
[[provide1]]
provides for card 1
[[provice0]]
provides for all
[[provide]]
provides for all with low precedence?
With two separators:
[[mc::foo::]]
turns into `[["foo"], []]
however
[[mc::::foo]]
turns into [[""], ["foo"]]
Second should work like first, empty field is like definiting nothing at all.
So initially, cmds 0
+ cmds 1
will be shown, if 1 is filled, 2 will be revealed in Editor. This functionality belongs into the Closet add-on, not collapsible fields.
Should be settable from Closet menu option
Needs to have higher priority
It would be nice to be able to assign a specific field as a container for the "rect-block" when making image occlusions, so Closet could automatically fill it (see mockup below) instead of only adding the markup to the clipboard, since it's quite easy to forget pasting it before adding a note.
Adding the commands manually seems like a redundant task for the use case of standard image occlusions, and should be automated in my opinion, because it is unintuitive for non-tech-savy users. One could even argue that visible commands aren't even necessary for the majority of users and should therefore be hidden somewhere outside of the fields, but auto-pasting them would be a good compromise.
both add-ons use the [ ] bracket on cards to trigger their effects. so when i try to use you cloze deletion on my cards I get the un hidden part of the sentence with the cloze deletion code as furigana above it.
Describe the bug
The front card is working fine, but my problem is in the backcard where I can see [[c1::abc]] instead of just "abc"
Debug information
here is the web inspecter of the card
And here is the console log
here is my anki card
Default__Computer Science.zip
Thank you for your patient
Hi there!,
Numbered clozes don't work for me. I don't know if I´m doing something wrong but they always show revealed.
One example:
[[c1::Test]] The word Text is always on display
[[cr1::Test]] Works great
[[ch1::Test]] Works great
I´m using Anki 2.1.34 on Mac with latest Closet for Anki update.
Or rather, make it possible and show off on website
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.