jdlorimer / incremental-reading

Anki add-on providing incremental reading features
https://ankiweb.net/shared/info/935264945
ISC License
216 stars 38 forks source link

2 minor changes + allow to paste source to a field on quickkey use #62

Closed ghost closed 6 years ago

ghost commented 6 years ago

The blank line before '(source: ...)' is deliberate. If the Cloze type is used with the source in the 'Extra' field, it visually separates the text from the source; and whatever the note type, if the user wants to write something before the source in the same field, it's faster.

jdlorimer commented 6 years ago

I agree with the direction of these changes, but I think if there needs to be extra vertical space between content and source (or other formatting), that should be done in CSS. All my notes have something like <div>{{Text}}</div><div>{{Source}}</div>, with div padding added via the stylesheet.

Also, does the change to setField actually make any difference? It's only used with new notes, so there is never any existing content, right?

ghost commented 6 years ago

You're probably right, but I don't know how to do that... Would you mind doing the change?

As for setField, there can already be existing content in one case: if the text and the source are pasted to the same field.

jdlorimer commented 6 years ago

Okay, so I'll do a manual merge and a bit of testing. My suspicion is that there's no situation where you really want text and source in the same field. But let me play around with it a bit.

jdlorimer commented 6 years ago

I've pushed the changes. Let me know what you think.

I will update the IR3 template to include the source field by default, and update model.css with some decent styling.

For the situation where you are extracting to, e.g., the cloze type, just clone it and do something like div { margin: 20px auto } in the styling section, and have:

<div>{{cloze:Text}}</div>
<div>Source: {{Extra}}</div>

in the back template.

ghost commented 6 years ago

Looks good! I'll see that when you update the template and model.css, but it's not a big deal anyway.