GithubHelp home page GithubHelp logo

hgiesel / closet Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 6.0 8.23 MB

The Web Framework for Flashcards

Home Page: https://closetengine.com

License: GNU General Public License v3.0

JavaScript 9.84% TypeScript 72.00% Shell 1.45% Nearley 1.72% Python 9.28% HTML 2.02% SCSS 0.96% CSS 1.43% MDX 1.30%
anki image-manipulation template-language text-manipulation

closet's People

Contributors

abdnh avatar hgiesel avatar kleinerpirat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

closet's Issues

Zoom functionality for occlusion editor

  • Add a slider option to make the picture bigger during occlusion creation:
    • Set zoom style attribute on container
  • Prevent labels from grow when using zoom: Otherwise they get so big, you can't see anything.

Feature Request: Closet inside Mathjax

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:
image

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:
image

Correct:
image

I could imagine that this would be impossible or either very hard to implement, it would however certainly be very nice.

Basic closet features no longer works

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.

Closet should execute before MathJax

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.

Update not Loading Closet js

after the latest update, only the closet setup script seems to be loaded by asset manager, not the closet script itself.

Make tag values more adaptable / save some processing

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.

Block tags `[[#mixl]]` `[[/mixl]]`

Could automatically unwrap inner <br> tags.
Should still accept partial values:
[[#mixl::attr1::attr2]]<attr3 stripped by one layer of <br> (if exists)>[[/mixl]]

Format of template data

[ { :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

Question/ Feature Request: syntax highlighting

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.

Local context of function is lost

(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.

Picking concept

Both pick / eval, as well as unique constraints should be built on listStore.

MathJax bug

Describe the bug
Other than the generated mathjax formula itself a piece of light gray text is shown. As can be seen here:
image

Code used for note:

\(x^2\) [[c1::hallo]]

However after one review this grey text disappears:
image

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:
image

Code used for note:

\(x^2\) [[c1::\(x^1\) hallo]]
[[c2::\(test\)]]
[[c3::\[test\] ]]
  • Anki client: Anki Desktop, version 2.1.35 (From th
    official releases), Linux openSUSE Tumbleweed

Debug information

Method 1

initCloset() fails, this doesn't make a whole load of sense though given that clozes without mathjax are working just fine.
image

Method 2

(The file has an added .zip extension)
test.apkg.zip

On Homepage Filter Manager

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

Make occlusion editor make occlusions update in place

This would require two special divs:

  • The template must have a div with id="closetOcclusionContainer, for the first insertion.
  • Into this, we would then insert another div, containing all occlusions with id="closetOcclusionOcclusions"

Found a bug on linux (no error shown)

i add the following picture inside Anki and using Closet:
image
when i display the card :
image

Can you fix it please ?

My system is : Linux Mint
Anki Version :
image

Help me create image occlusion cards

Describe the bug

  • Anki client: [e.g. AnkiDesktop, AnkiDroid, AnkiMobile on iOS, AnkiWeb]
  • if AnkiDesktop, please name your OS [e.g. Windows, macOS, Linux]
  • if AnkiDesktop, please name the version. You can find it in the "About" section [e.g. 2.1.26] 2.1.35

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

Method 1

No error in console log to be found.

Method 2

Thanks a lot again.
CH topic voc.zip

Doc render buttons

Same button clicked again: discard memory

another button clicked: retain memory

[usability] Bind key for separator insertion

This requires:

  • using the cursorOffset function to detect position in field
  • a new parser for parsing a closet text into a function number → maybe<tag>, which shows which tag is active at the current position of the cursor

Absorb Persistence into Closet

Once Label support is available in asset manager, so we can have one dynamic import execute asynchronously, and that's it.

Occurence numbers are not constant over iterations

This is a big issue.
I use occurence numbers to uniquely identify tags within some filters.
However they are not:

Failing example

However this works:

Working example

This will render wrong.
The correct solution would be to:

  1. drag along the tag factor
  2. drag along the parser
  3. flatMap the innerTags rather than reduce
  4. parse resulting texts, and insert via the templateApi

`sel` filter

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?

Uniform treatment of "empty" elements

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.

Option to automatically fill specific field with markup when accepting occlusions [usability]

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.

  • Ideally the occlusions would be accepted (and therefore pasted) automatically when clicking on "Add" to prevent accidental loss of meticulously placed occlusions.

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.


mockup GIF

Conflict with Japanese Support add-on

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.

Numbered clozes don't work

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.