View_Size_Adjust and Incremental_Reading_Extension addons
103 posts by 27 authors
Frank
3/11/13
As suggested, I am adding a topic for a couple of related addons that I've contributed:  The View_Size_Adjust addon and the Incremental_Reading_Extension addon. They are related in that the Incremental Reading Extension is much more useful with the View Size Adjust addon, which provides several functionalities that while generally useful in Anki, are critical to an effective Incremental Reading capability:

  • Adjusting the size of the text when reading longer articles (Ctrl++ or Ctrl+-)
  • Navigation keys for arrow up/down, page up and page down
  • Ability to save the position in an article to support coming back at a later point in time and picking up where you left off (hence the term 'incremental')
  • Ability to highlight text to indicate where cards have already been extracted, or simply to highlight the text if you plan to keep the longer article and read it with highlighted portions.
  • Ability to add custom shortcuts for extracting and adding cards to Anki using specific card models and decks
Most of these capabilities are useful independent of the Incremental Reading concept, so I have View Size Adjust as a separate addon. Arguably, it is poorly named at this point since the majority of functionality is really about navigation and shortcuts, but in order to avoid littering the Anki addon landscape with previously named versions, I kept it the same. 

Latest update added some more customization options to the custom shortcuts:

  • Added ability to specify shortcuts with any combination of Ctrl + Alt + Shift + Key. This includes the ability to set single key shortcuts. This allows the ability to override the default behavior of the 'x' and 'c' shortcuts.
  • Added the 'showEditCurrent' dialog option when creating a new shortcut. This is unchecked by default. It mirrors the original 'x' and 'c' shortcut operation and opens the 'Edit Current' window to allow you to edit the current card while you are also adding another card in the separate 'Add Cards' dialog.
I will try to monitor this thread, but please understand that this is a purely voluntary effort as time permits. Hope that you can get some use out these plugins.

--Frank

2 messages have been deleted.
Frank
3/19/13
New Incremental Reading Extension update includes a NEW Queue-Based Scheduler (independent of SRS scheduling) and Organizer.

Full rewritten explanation of the Incremental Reading Extension below (formatting works better in the forum than in the Anki Addons site). Search for the Scheduler to see what's new. 

Incremental Reading Extension

Incremental Reading is a way to read many articles concurrently and efficiently add spaced repetition cards to Anki in the process. In essence, you add reading material to an Incremental Reading deck in Anki and read it as time permits. As you read, you can highlight important passages and extract them into separate cards in Anki, either for further refinement, or as final SRS cards in another Anki deck. When you have finished reading an article, you will have incorporated all the important knowledge into your Anki deck(s) and can delete it, confident that the knowledge will be continually reinforced by Anki’s core SRS function.

Example using Add Cards Shortcut defined to create a new card in Incremental Reading 2 deck with IRead2 model and using yellow highlight to mark the extracted text in the original article.


The Incremental Reading Extension addon relies on the View Size Adjust addon for several important navigation and keyboard shortcut capabilities. Be sure to add both addons before you begin.

NOTE on UPGRADING:  This version changes the IRead2 model. Changing the model will require you to modify your existing IRead2 cards (removing little used Model and Deck fields, adding Title) or delete the IRead2 model and all associated cards before installing the upgrade.

NOTE on the original Incremental Reading addon:   The Incremental Reading Extension addon is a fork (an alternative) of the original Incremental Reading addon. Do not attempt to install both concurrently.


Features 

The Incremental Reading Extension, along with the View Size Adjust addon, supports incremental reading in Anki with the following features:

·      Keyboard navigation

o   PgUp, PgDn, ArrowUp, ArrowDown

o   Also available from the Edit menu

·      Keeping track of where you left off in each article

o   Scroll to last viewed text when the card is loaded

o   Uses same ‘zoom factor’ you last used for the same card

·      Adjust the size of the text as needed

o   Ctrl-- to increase text size

o   Ctrl-- to decrease text size

o   Saves selected size with each card and reapplies when shown

o   Also available from the Edit menu

·      Highlighting of text

o   Select and hit ‘h’

o   Custom colors (Hit Alt-2 to open a dialog. Also available from Edit menu)

o   Anti-highlighting option (color text, rather than background)

·      Custom keyboard shortcuts for adding cards efficiently

o   Alt-1 to create a custom shortcut

o   Choose deck, card model, shortcut key combination, highlighting, field into which to paste selected text, and to whether or not you want to see the add/edit dialogs.

o   Automatically copies Tags from source Incremental Reading card to the new card created using the keyboard shortcut.

o   Automatically copies Source field from Incremental Reading card to the new card created using the keyboard shortcut (if new card model has a Source field).

o   Shortcuts are added to the Edit menu as they are created.

o   Removing a shortcut is done by disabling it using the same dialog. Hit Alt-1, choose the same key combination and uncheck ‘Enabled’ checkbox.

·      (NEW) Independent scheduling algorithm more suitable to Incremental Reading

o   Queue depth based, rather than time-based

o   Configurable ‘Soon’ and ‘Later’ scheduling buttons. Dialog for editing these options is available in the Tools menu (‘Incremental Reading Scheduler Options’). Options include:

§  Push a card to a specific depth (count or position) in the queue

§  Push a card to a percentage depth into the queue

§  Apply randomness to either approach

o   Custom organizer dialog.

§  Move any card to any position in the queue

§  Bulk moves

§  Opened from Tools menu (‘Incremental Reading Organizer’).

§  Also opened from ‘custom’ answer button when working with Incremental Reading cards in the Anki Reviewer.

 

To Show Editor or Not to Show Editor

A couple of options on the Add Shortcut dialog (Alt-1) require explanation:

Show Add Cards dialog – This checkbox is checked by default. When you invoke the keyboard shortcut, the Add Cards dialog will be opened as it normally is when you add cards in Anki. It will be prepopulated with the Deck and Card Model you’ve chosen. If this checkbox is unchecked, the shortcut will add the card automatically without opening the Add Cards dialog. This is a convenience for incremental reading where a frequent activity is creating smaller, but still large, extracts from a source article and feeding those back into the Incremental Reading deck. The shortcut takes care of populating all fields with reasonable values in that case, making opening the dialog inconvenient (because you then have to close it).

Show Edit Current dialog – The original Incremental Reading addon opened two dialogs every time you attempted to add a new card. First it opened the Edit Current dialog, which contains the same card you were just looking at, but in editing mode. Second it opened the Add Cards dialog that you would normally expect. The advantage to this option is that you can delete the text from the original article as you do extracts, rather than highlighting. Personally, I prefer highlighting and deleting the entire original article at the end when I’m done with it.


Scheduling Algorithm for Incremental Reading

Anki’s normal scheduling algorithm is designed to support Spaced Repetition and address the “forgetting curve.” It makes very little sense to try to schedule reading material using the “forgetting curve” and its increasing intervals. Instead, incremental reading is really a matter of prioritizing a large number of articles based on your interest level and the importance you place on each article. Accordingly, a different scheduling algorithm is required.

For incremental reading, the goal is to manage a queue of articles and to be able to reprioritize each article every time you read it. It should also be possible to find an article you want to see, no matter where it is in the queue, and bring it forward. And periodically, you may want to review the entire queue and organize it in a specific way.

The scheduling algorithm attempts to meet the above goals without interfering with Anki’s normal scheduler or dramatically changing the Anki interface. To do so, it effectively removes the Incremental Reading cards from the Anki scheduler and keeps all the incremental reading cards permanently in the NEW queue. This keeps all Incremental Reading cards available all the time (not hidden away in a REVIEW queue to be shown again in a few days, weeks or months).

An incremental reading card will always have three buttons labeled ‘Soon’, ‘Later’ and ‘Custom’.  The meaning of ‘Soon’ and ‘Later’ is configurable, but essentially means ‘This is important and I want to see it again Soon’ or ‘This is less important, don’t show it to me again until Later.’  If, despite configuration, you don’t get the behavior you want, or if you want to handle a card specially, there is the ‘Custom’ button, which opens the Organizer dialog to let you put that card wherever you want in the queue.

Configuration of the ‘Soon’ and ‘Later’ scheduling options is available from the Tools -> Incremental Reading Scheduler Options menu item. Options include:

·      Position – Treat the configured value as a simple position number.

·      Percent – Treat the configured value as a percentage value

·      Random – Apply some randomness to the placement of the item using the configured count or percentage value.

·      Value – The numeric value. It represents either a count or a percentage.

Position vs Percent

If you choose Position and don’t apply Random, then hitting the button in question will directly place the card at the position you indicated. If you apply Random, it will place the card at a random position between 1 and the Position you indicated.

If you choose Percent and don’t apply Random, then hitting the button in question will calculate the position as a percentage of the queue depth and place the card at that position. If you apply Random, it will place the card at a random position between 1 and the calculated position by percentage.

The above explanations apply for the ‘Soon’ button. The ‘Later’ button differs only in that the placement of the card will be between the Position or Percentage given for ‘Soon’ and the Position or Percentage given for ‘Later’. Thus, if you specify 10 Percent for ‘Soon’ and 50 Percent for ‘Later’, the ‘Later’ button will place the card at a position between 10 and 50 percent into the queue.

Organizer 

The Organizer is a dialog that shows a list of all the cards in the Incremental Reading deck. It can be accessed from the Tools menu. 

There is a checkbox next to each card that can be used to select an individual card or many cards and move them up or down in the queue.  To move a card up, check the box next to that card and click the ‘Up’ button. To move a card down, click the ‘Down’ button. If multiple cards are checked, they move up or down together.

If a selected card cannot be moved up because it has hit the top of the queue or because the card above it is also selected, it will not be moved. Cards selected below it can move up until all selected cards make a contiguous block. The same applies for moving cards down alone or in bulk.

The ‘Pin Top/Bottom’ checkbox at the top locks the top-most (or bottom-most) item in place while ‘Up’ or ‘Down’ are clicked to move other selected items, allowing you to ‘anchor’ a block of selected items anywhere in the queue.

The Card Position field at the top of the Organizer allows you to specify a position to directly move the top-most selected item to. If multiple items are selected, they move up or down together.

 

Compatibility and Upgrading

Update your View Size Adjust addon. You need the most recent of both the Incremental Reading Extension addon and the View Size Adjust addon.

IRead2 Card Model has changed.

·      Removed Model and Deck fields.  The original IRead2 card has Model and Deck fields that were needed by the predecessor Incremental Reading addon. With the custom shortcuts approach used by Incremental Reading Extension, they are no longer needed. Accordingly, they have been removed.

·      Added ‘Title’ field. Using the Organizer requires you to be able to identify each card sufficiently to be able to prioritize it in the queue. Adding a ‘Title’ field makes that possible.

Changing the IRead2 model means that for those of you who are upgrading, there is a little work. Here are the options for doing the upgrade.

Option 1 – Delete the IRead2 card model before applying the new addons. This will delete all IRead2 cards in your collections. The addons will create the new IRead2 card model when installed.

Option 2 – Modify the IRead2 model before updating the addon.

·      Delete the Anki Deck field and the Model field. Anki will warn you that it will be modifying your collection in a way that makes it incompatible with the copy in the cloud or on other devices. You will need to do a full sync afterwards.

·      Add the Title field and position it as the first field in the model. Also check the radio button that says to use that field for sorting in the Browser. 

- show quoted text -
tmbb
3/19/13
This "extension" of yours is getting pretty serious... Do you want to "take over" the name "incremental Reading"?
I'll not be developping it anymore, and since your version is much better than mine, there is no reason for mine to continue to exist.

Should I erase my addon so that you can upload the code under that name?
- show quoted text -
Frank
3/19/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Tiago? 

Yes, it has gotten pretty involved, but hopefully not a lot more is needed. A different way to schedule material was the big gap for me. 

To your offer to consolidate under one title, I think it would save confusion. I worry slightly that some folks might be annoyed, because there are apparently quite a few downloads of the original still happening. However, I believe I have made it possible to replicate exactly the behavior of the original if that's what they want, so it probably isn't really a problem.

Just FYI -- I would never have started this or gotten as far without your original. This is my first Python project (though I've been programming for many years). Thanks for the leg up. 

- show quoted text -
- show quoted text -
- show quoted text -
--
You received this message because you are subscribed to a topic in the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons?hl=en.
 
 

This message has been deleted.
Frank
3/21/13
Yes. It examines the currently selected deck to determine if it contains IRead2 cards, since Incremental Reading scheduling and organization should not be applied to regular SRS. That would really mess with SRS behaviors and statistics. 

On Tuesday, March 19, 2013, Jay Dugger wrote:
Frank:

Thank you for reworking the scheduler. 

An error message appears when I try to open the Incremental Reading Organizer: "Please select an Incremental Reading deck." I've a deck open with cards of type other than IRead2. I assume that's the source of the error. Does that seem right to you?

--
You received this message because you are subscribed to a topic in the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons?hl=en.
 
 
Aleksej
3/29/13
I've installed the add-ons yesterday.  Bugs (#3 is dataloss):

1. The Alt+1 window's values are not retained.
2. The Alt+1 window's "Paste Text to Field" drop-down shows fields of
the last note type in the alphabetical list of note types.  That's not
IRead2.
3. I've created an IRead2 card yesterday, but deleted it.  Today, at
some point, shutting Anki down started to crash it, so the reviews are
lost every time.  Creating an IRead2 card didn't help.

$ anki
Traceback (most recent call last):
  File "/usr/share/anki/aqt/main.py", line 607, in closeEvent
    self.onClose()
  File "/usr/share/anki/aqt/main.py", line 613, in onClose
    self.unloadProfile(browser=False)
  File "/usr/share/anki/aqt/main.py", line 234, in unloadProfile
    runHook("unloadProfile")
  File "/usr/share/anki/anki/hooks.py", line 26, in runHook
    func(*args)
  File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
104, in savePluginData
    self.ir2data =
{'zoomAndScroll':self.zoomAndScroll,'highlightColor':self.highlightColor,'doHighlightFont':self.doHighlightFont,'schedIROptions':self.schedIROptions}
AttributeError: 'IRead2' object has no attribute 'doHighlightFont'

Arthur Chen
4/3/13
I'm getting errors with switching profiles.
When switching profiles:
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 234, in unloadProfile
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.hooks", line 26, in runHook
  File "C:\Users\Art\Documents\Anki\addons\Incremental_Reading_Extension.py", line 104, in savePluginData
    self.ir2data = {'zoomAndScroll':self.zoomAndScroll,'highlightColor':self.highlightColor,'doHighlightFont':self.doHighlightFont,'schedIROptions':self.schedIROptions}
AttributeError: 'IRead2' object has no attribute 'doHighlightFont'

When using Check Database:
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 843, in onCheckDB
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 376, in reset
  File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 329, in moveToState
AttributeError: 'AnkiQt' object has no attribute '_profileManagerState'
- show quoted text -
Frank
4/3/13
Sorry you are having issues. 

1. Yes, the previously selected values are not retained. It's a convenience I intended eventually to address, but it was not as critical as other things since creating shortcuts should be a fairly infrequent activity and selecting new values on those few occasions shouldn't be too much trouble. However, I will look to address that.
2. The 'Paste Text to Field' drop down shows the fields of the model indicated in the model drop down. Per your point No. 1, when the dialog loads, it will most likely not be showing IRead2 as the selected Model, even if that was the last one you used. However, when you select IRead2, it should update the 'Paste to' dropdown values to reflect the fields of the IRead2 model. 
3.  I will post a fix for the error you mentioned momentarily.  
- show quoted text -
Frank
4/3/13
This is similar to the error reported by Aleksej. I will post a fix momentarily. 
- show quoted text -
Aleksej
4/3/13
2. It does not update, and here is what appears in the console when the
window opens:

JS error on line 126: SyntaxError: Parse error
JS error on line 0: ReferenceError: Can't find variable: setFieldsForModel


Also, because of this it is not really clear what the deck is target
for; I had thought that you could define multiple Alt+n shortcuts for
different target decks, to make final cards, which are not IRead anymore.


A smaller issue with the window:
The drop-down lists are not easy to use with a very big number of
entries (subdecks in my case).  I can only click them, and while
holding, press the first letter of an entry, which scrolls the list so
that the first entry with that first letter is at the bottom.  The list
cannot be overviewed using only keyboard or without holding the click.


3. Thanks, it didn't crash right away.
- show quoted text -
> --
> You received this message because you are subscribed to the Google
- show quoted text -
Frank
4/3/13
You are correct that the idea is you can create multiple shortcuts to target different decks and models. 

I have seen that behavior with the window not remaining open unless you hold the click. It is not consistent, though, and only happens rarely for me. That is probably something to do with the Qt web kit and there might be little I can do about it. I will look into adding keyboard navigation of the list, which might have the side effect of keeping that drop down open. 

Regarding the error that is keeping it from updating the 'Paste To' drop down, I'm guessing that it must have something to do with the values it is trying to populate (ie. your model or field names), since I don't have the same error. I tested with a few special characters in the field names (e.g. @&<>!#%*^~') and found that the use of the single quote (or apostrophe) causes this same error. It may not be the only character that could cause the issue. I will see if I can escape it, but in the meantime you might take a look for the use of quotes or other special characters in field names and rename the field. 
- show quoted text -
Aleksej
4/3/13
I couldn't identify any model names with characters "worse" than /?(чá.
 So maybe a field.  I have over 90 models...
- show quoted text -
>     <http://groups.google.com/group/anki-addons?hl=en>.
- show quoted text -
Aleksej
4/3/13
Found the field with an apostrophe ("Y'all" for a verb note type).  Now
it should work.  Thanks.
- show quoted text -
Frank
4/4/13
I uploaded a new version of View Size Adjust addon that escapes the special characters in the field names of the Add Cards Shortcut dialog (Alt + 1). Also added persistence of the selected drop down values for decks, models and fields, and the various checkboxes and radio buttons. 
- show quoted text -
Aleksej
4/4/13
Now Alt+1 leads to an error:

Traceback (most recent call last):
  File "/home/fca/Anki/addons/View_Size_Adjust.py", line 321, in
showAddCardQuickKeysDialog
    javascript += "var pasteToFieldValue = '" +
self.lastDialogQuickKey.get('fieldName', '') + "';\n";
TypeError: cannot concatenate 'str' and 'NoneType' objects
- show quoted text -
Aleksej
4/4/13
Wrapping the self.lastDialogQuickKey.get('fieldName', '') in "str()"
seems to fix it.

Accessibility: the window's width and height are about 55% of what it
needs, at least with my font (DejaVu Sans size 15, Bold in qtconfit-qt4,
Book in GTK).
- show quoted text -
Aleksej
4/5/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
I want to start IR with the manual for the add-ons.  I've added the
images from it, and encountered a problem: when IRE adds yellow
highlighting to a card, the "+" signs in the image names become %-escaped.

I am looking for good ways to make cards from web pages.  The biggest
question with most of them is whether and how to copy formatting.  The
manual is one of those pages.
Did you use MS Office to write the manual?  The HTML code contains some
uses of CSS (non-semantic and thus seemingly bigger than needed) with
mentions of it.  That doesn't affect the resulting view, but maybe the
code will be more readable if you use something like Markdown or
ReStructuredText.
Frank
4/5/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
If by "the manual", you mean the first entry in this forum post, then yes, I used MS Word. It never occurred to me that anyone would attempt to paste that content into Anki, but I can see why it could cause issues. MS HTML is awful. In my experience, most content added to Anki from web pages is entered smoothly and there are no issues.
- show quoted text -
Aleksej
4/5/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Sorry, I was writing that at night and without good thinking.

1. Yes, that manual.

2. The issue of MS HTML is that the code is not readable.

3. By "Markdown or ReStructuredText" I meant to say "an editor that uses
a simpler markup language".
* The editor I took the language names from (but haven't used before) is
ReText <http://sourceforge.net/p/retext/>; a screenshot
<http://sourceforge.net/p/retext/screenshot/retext-kde.png> — on the
left is the editor, on the right is the auto-updated preview; there is
no information on whether it works on Windows.
* Another editor, which is WYSIWYG and according to the FAQ runs also on
Windows, is a desktop wiki called Zim (the site says it was written in
it): http://www.zim-wiki.org/

4. The real issue is what happens to the image names (%-encoding).  It
doesn't happen with manual editing.


5. Yes, entering HTML code from web pages works, of course.  Only some
articles like "sleep.htm" at supermemo.com are too long to be used in
Anki without splitting.  Also, images do not get included by copying the
code.

But I would like to be able to copy links to paste into my browser.
Anki and the browser are running from different accounts, and I don't
really want to connect them.  But maybe link copying could be added to Anki.
- show quoted text -
Soren Bjornstad
4/5/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
"It is written in Python using Qt libraries, able to run on any platforms."

There doesn't appear to be a Windows installer, though, so you'd have to use the source package (no compiling necessary, though).


- show quoted text -
- show quoted text -
- show quoted text -
--
You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons?hl=en.



Aleksej
4/7/13
Thanks, that's better.

"Incremental Reading Scheduler Options" also suffers this.
- show quoted text -
Aleksej
4/7/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
1. I've renamed the files to use %, and then the %s were encoded.

2. IR Organizer does not open if a title contains non-ASCII text:

Traceback (most recent call last):
  File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
375, in callIRSchedulerDialog
    self.showIRSchedulerDialog(None);
  File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
389, in showIRSchedulerDialog
    cardDataList = self.getCardDataList(deckID, cardID);
  File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
683, in getCardDataList
    if(note.model()['name'] == 'IRead2'): cardData['title'] =
str(note['Title'])[:64].encode('string_escape');
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0430' in
position 25: ordinal not in range(128)
- show quoted text -
Aleksej
4/15/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
This seems to fix it.  There is still a problem that the 64 characters
include any HTML formatting.

=================================
diff --git a/Incremental_Reading_Extension.py
b/Incremental_Reading_Extension.py
index 4242ced..d7323dd 100644
--- a/Incremental_Reading_Extension.py
+++ b/Incremental_Reading_Extension.py
@@ -680,7 +680,9 @@ class IRead2(object):
                 cardData['nid'] = nid;
                 note = mw.col.getNote(nid);

-                if(note.model()['name'] == 'IRead2'): cardData['title']
= str(note['Title'])[:64].encode('string_escape');
+                if(note.model()['name'] == 'IRead2'):
+                    cardData['title'] = (note['Title'][:64].encode('ascii',
+
errors='xmlcharrefreplace')).encode('string_escape')
                 else: cardData['title'] = 'No Title';
                 #cardData['title'] = 'No Title';
================================

On 2013-04-07 00:18, Aleksej wrote:
> 2. IR Organizer does not open if a title contains non-ASCII text:
>
> Traceback (most recent call last):
>   File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
> 375, in callIRSchedulerDialog
>     self.showIRSchedulerDialog(None);
>   File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
> 389, in showIRSchedulerDialog
>     cardDataList = self.getCardDataList(deckID, cardID);
>   File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
> 683, in getCardDataList
>     if(note.model()['name'] == 'IRead2'): cardData['title'] =
> str(note['Title'])[:64].encode('string_escape');
> UnicodeEncodeError: 'ascii' codec can't encode character u'\u0430' in
> position 25: ordinal not in range(128)
Aleksej
4/20/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hi Frank.  If you have time, please add the/a fix to the official
version.  This issue complicates non-English use a lot if you need the
Organizer.
- show quoted text -
Aleksej
4/25/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
The .dat files stored in collection.media are found by Anki to be
"unused media", so Anki deletes them as such.
Aleksej
4/28/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
A workaround: add "_" prefix to the file names.
- show quoted text -
Ryan Moore
5/13/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Sorry if this is a silly question, but I am wondering how you are adding html into the Text field. Whenever I try to add a webpage's source, the card will just show the html code and not the formatted output.

Thanks

On Friday, April 5, 2013 6:45:15 AM UTC-4, Aleksej wrote:
Sorry, I was writing that at night and without good thinking.

1. Yes, that manual.

2. The issue of MS HTML is that the code is not readable.

3. By "Markdown or ReStructuredText" I meant to say "an editor that uses
a simpler markup language".
* The editor I took the language names from (but haven't used before) is
ReText <http://sourceforge.net/p/retext/>; a screenshot
<http://sourceforge.net/p/retext/screenshot/retext-kde.png> — on the
left is the editor, on the right is the auto-updated preview; there is
no information on whether it works on Windows.
* Another editor, which is WYSIWYG and according to the FAQ runs also on
Windows, is a desktop wiki called Zim (the site says it was written in
it): http://www.zim-wiki.org/

4. The real issue is what happens to the image names (%-encoding).  It
doesn't happen with manual editing.


5. Yes, entering HTML code from web pages works, of course.  Only some
articles like "sleep.htm" at supermemo.com are too long to be used in
Anki without splitting.  Also, images do not get included by copying the
code.

But I would like to be able to copy links to paste into my browser.
Anki and the browser are running from different accounts, and I don't
really want to connect them.  But maybe link copying could be added to Anki.


On 2013-04-05 06:03, Frank wrote:
> If by "the manual", you mean the first entry in this forum post, then yes,
> I used MS Word. It never occurred to me that anyone would attempt to paste
> that content into Anki, but I can see why it could cause issues. MS HTML is
> awful. In my experience, most content added to Anki from web pages is
> entered smoothly and there are no issues.
>
> On Thursday, April 4, 2013 5:12:18 PM UTC-5, Aleksej wrote:
>>
>> I want to start IR with the manual for the add-ons.  I've added the
>> images from it, and encountered a problem: when IRE adds yellow
>> highlighting to a card, the "+" signs in the image names become %-escaped.
>>
>> I am looking for good ways to make cards from web pages.  The biggest
>> question with most of them is whether and how to copy formatting.  The
>> manual is one of those pages.
>> Did you use MS Office to write the manual?  The HTML code contains some
>> uses of CSS (non-semantic and thus seemingly bigger than needed) with
>> mentions of it.  That doesn't affect the resulting view, but maybe the
>> code will be more readable if you use something like Markdown or
>> ReStructuredText.
>>
>

Aleksej
5/13/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Ctrl+Shift+X (or an item of the drop-down menu from the toolbar) —
<http://ankisrs.net/docs/manual.html#features>.
- show quoted text -
>     articles like "sleep.htm" at supermemo.com <http://supermemo.com>
- show quoted text -
> --
> You received this message because you are subscribed to the Google
> Groups "Anki Add-ons" group.
> Visit this group at http://groups.google.com/group/anki-addons?hl=en.
>  
>  

Ryan Moore
5/21/13
Error after adding a new card to the deck....

An error occurred in an add-on. Please contact the add-on author.

Traceback (most recent call last):
  File "/Users/ryanmoore/Documents/Anki/addons/Incremental_Reading_Extension.py", line 375, in callIRSchedulerDialog
    self.showIRSchedulerDialog(None);
  File "/Users/ryanmoore/Documents/Anki/addons/Incremental_Reading_Extension.py", line 389, in showIRSchedulerDialog
    cardDataList = self.getCardDataList(deckID, cardID);
  File "/Users/ryanmoore/Documents/Anki/addons/Incremental_Reading_Extension.py", line 683, in getCardDataList
    if(note.model()['name'] == 'IRead2'): cardData['title'] = str(note['Title'])[:64].encode('string_escape');
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 193: ordinal not in range(128)


I had a couple of papers imported into my Incremental Reading deck and when I used the keyboard shortcut to add a new card from a line in the paper and got the above error. I'm not sure how Anki does its character encoding by default, so any help would be appreciated.

Thanks.
Aleksej
5/21/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
I suppose it happens when you open the organizer.  This patch I posted
here on 2013-04-15 fixes it:


diff --git a/Incremental_Reading_Extension.py
b/Incremental_Reading_Extension.py
index 4242ced..d7323dd 100644
--- a/Incremental_Reading_Extension.py
+++ b/Incremental_Reading_Extension.py
@@ -680,7 +680,9 @@ class IRead2(object):
cardData['nid'] = nid;
note = mw.col.getNote(nid);

- if(note.model()['name'] == 'IRead2'): cardData['title'] =
str(note['Title'])[:64].encode('string_escape');
+ if(note.model()['name'] == 'IRead2'):
+ cardData['title'] = (note['Title'][:64].encode('ascii',
+ errors='xmlcharrefreplace')).encode('string_escape')
else: cardData['title'] = 'No Title';
#cardData['title'] = 'No Title';



- show quoted text -
Ryan Moore
5/21/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
I'm not sure how to use what you have here to fix the plugin. Should I just delete the add-on and redownload, or add part of it to the source?

Thanks
- show quoted text -
Aleksej
5/21/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
The proper way to apply the patch is using the "patch" program, or
something like git (which is used for Anki).  The lines starting with
"-" show what to remove, and those starting with "+" show what to add.

Actually, the patch should look like this (I copied it from my comment
at https://ankiweb.net/shared/info/2880922486 , where it had lost
formatting...):

=================================
diff --git a/Incremental_Reading_Extension.py
b/Incremental_Reading_Extension.py
index 4242ced..d7323dd 100644
--- a/Incremental_Reading_Extension.py
+++ b/Incremental_Reading_Extension.py
@@ -680,7 +680,9 @@ class IRead2(object):
                 cardData['nid'] = nid;
                 note = mw.col.getNote(nid);

-                if(note.model()['name'] == 'IRead2'): cardData['title']
= str(note['Title'])[:64].encode('string_escape');
+                if(note.model()['name'] == 'IRead2'):
+                    cardData['title'] = (note['Title'][:64].encode('ascii',
+
errors='xmlcharrefreplace')).encode('string_escape')
                 else: cardData['title'] = 'No Title';
                 #cardData['title'] = 'No Title';
================================
- show quoted text -
- show quoted text -
Aleksej
5/21/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
A couple of lines seem to have wrapped.  They should not.
- show quoted text -
Aleksej
5/21/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
A git commit of the patch (there are links to download the raw patch):
https://gitorious.org/vsa_and_ire/vsa_and_ire/commit/d44bfd9d5f435596d300cfbc1fe9f07c278fcd97
Peter DeBiase
5/28/13
Dear Frank,

Your IR implementation is the bees knees. I'm just getting started, but loving every minute of it.

I have a quick question for you: how can I make the title field "sticky" so that when I extract cards from the Incremental Reading deck to the destination deck, they will inherit the IRead2 card's title field like they inherit the source field and tags?

I've been digging around in the source code a little bit, but I'm just getting started with coding too. So far I've tried uncommenting the following line:

setField(new_note, TITLE_FIELD_NAME, getField(cur_note, TITLE_FIELD_NAME))

and adding the following lines (trying to mirror the source field-related code):
  • model_field['sticky'] = True     #Added this beneath the `model_field = mm.newField(TITLE_FIELD_NAME)` line
  • title_field['sticky'] = True  #Added this beneath the `title_ord, title_field = fmap[TITLE_FIELD_NAME]` line

but I'm not getting the same sticky behavior that the source field exhibits. I apologize in advance if this is a dumb question. Like I said, just getting started with programming stuff.

Dazed and confused,

Pete

Soren Bjornstad
5/29/13
I said I wanted to try this add-on way back when it was first released, and I'm now getting a chance to! Thanks for your work.

Two issues:
1) When the "show add cards dialog" option is turned off and I have the model and deck set to IRead (for extracting smaller pieces of an article), when I select something and press the combination, it just highlights it and pops up a dialog box complaining that the first field is empty (presumably the title field of the IRead2 note type). Am I missing a step?

2) Anytime I add a new card, the main Anki window goes to that display of "Waiting for editing to finish, click here to resume." If I click the button, my position isn't saved and I have to scroll manually. I can get around this by closing the add window after adding a single card, but this is kind of annoying (even though I only have to press Escape), since I have two monitors and have plenty of space. I don't know if there's anything you can do to fix this, but it would be nice. (Another solution would be to automatically close the add window after adding one card.)

On Sunday, March 10, 2013 6:55:03 PM UTC-5, Frank wrote:
As suggested, I am adding a topic for a couple of related addons that I've contributed:  The View_Size_Adjust addon and the Incremental_Reading_Extension addon. They are related in that the Incremental Reading Extension is much more useful with the View Size Adjust addon, which provides several functionalities that while generally useful in Anki, are critical to an effective Incremental Reading capability:

  • Adjusting the size of the text when reading longer articles (Ctrl++ or Ctrl+-)
  • Navigation keys for arrow up/down, page up and page down
  • Ability to save the position in an article to support coming back at a later point in time and picking up where you left off (hence the term 'incremental')
  • Ability to highlight text to indicate where cards have already been extracted, or simply to highlight the text if you plan to keep the longer article and read it with highlighted portions.
  • Ability to add custom shortcuts for extracting and adding cards to Anki using specific card models and decks
Most of these capabilities are useful independent of the Incremental Reading concept, so I have View Size Adjust as a separate addon. Arguably, it is poorly named at this point since the majority of functionality is really about navigation and shortcuts, but in order to avoid littering the Anki addon landscape with previously named versions, I kept it the same. 

Latest update added some more customization options to the custom shortcuts:

  • Added ability to specify shortcuts with any combination of Ctrl + Alt + Shift + Key. This includes the ability to set single key shortcuts. This allows the ability to override the default behavior of the 'x' and 'c' shortcuts.
  • Added the 'showEditCurrent' dialog option when creating a new shortcut. This is unchecked by default. It mirrors the original 'x' and 'c' shortcut operation and opens the 'Edit Current' window to allow you to edit the current card while you are also adding another card in the separate 'Add Cards' dialog.
I will try to monitor this thread, but please understand that this is a purely voluntary effort as time permits. Hope that you can get some use out these plugins.

--Frank

Soren Bjornstad
5/29/13
Also, FWIW, is 'x' supposed to open the edit and add windows, or is that left over from an earlier version? I don't see it anywhere in the docs. (line 861 in my_reviewer_keyHandler)
- show quoted text -
nom...@gmail.com
5/29/13
I'd like to try it but it's not working on my system.

Anki 2.0.9 Beat
Fedora Linux

After installing the add-on, Anki pops up an error message (see: below).
I don't understand this: "Once you have a new deck, add a new IRead2 card to the deck".
 - Does it mean that a New Note Type "IRead2" should be available? If so, then it is missing.

msg:

An error occurred in an add-on.
Please post on the add-on forum:
https://groups.google.com/forum/#!forum/anki-addons

Traceback (most recent call last):

File "/usr/share/anki/aqt/addons.py", line 39, in loadAddons

__import__(file.replace(".py", ""))

File "/home/mt/Anki/addons/Incremental_Reading_Extension.py", line 26, in <module>

from View_Size_Adjust import ViewManager

ImportError: No module named View_Size_Adjust

/home/mt/Anki/addons/code_highlight_addon/pygments/plugin.py:39: UserWarning: Module anki was already imported from /usr/share/anki/anki/__init__.py, but /usr/lib/python2.7/site-packages is being added to sys.path

import pkg_resources


nom...@gmail.com
5/29/13
I just saw the print-screens.

Effectively, I don't have a IRead note type, and the Tools menu has not Incremental Reading entries (looking at the print-screens on the top of this page).
Aleksej
5/29/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
You need to install the View Size Adjust add-on too.
- show quoted text -
nomnex
5/30/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
> On Wed, 29 May 2013 14:16:54 +0400
> Aleksej <deletes...@gmail.com> wrote:
>
> You need to install the View Size Adjust add-on too.

Thanks Aleksej. I will install it and give it another try.

--
nomnex <nom...@gmail.com>
Freenode: nomnex
Registered Linux user #505281. Be counted at: http://linuxcounter.net
Nico
6/7/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hi, thanks for the great work. Unfortunately, I deal with many digitized books, for whom highlighting doesn't work well. What about adding support for drawing over images as a form of tracking one's progress? I have done some research: http://ianli.com/sketchpad/
- show quoted text -
Nico
6/8/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Also, I tried enabling the editing mode on the main reviewer content pane. This means you can write directly inside the reviewer window without having to open the editor.

When reading an article, alt+shift+e enables editing mode. You can now edit text on the reviewer pane. alt+shift+e saves the changes to the current card. alt+shift+d disabled editing mode. Note that normal single-letter shortcuts don't work in editing mode (for obvious reasons..). For this reason, alt+h replaces 'h' to highlight text.

It's very rough around the edges (no html verification, etc..) but I think this is a very interesting concept. Merging the reading and editing process enhances the workflow in many ways (no need to scroll again, HTML is rendered, etc..)

Nico
Attachments (1)
inPlaceEditing.py
1 KB   View   Download
nom...@gmail.com
6/8/13
This add-on is a wonder (many thanks to Frank), but I have a usage question.

I copy the content of an article (first card creation)

Title
Text
Source

Then I select some text to create a new card using Ctrl-0 (preferences: Past text to field: Text). (second card creation)

The title field is empty
Text
Source

My question is related to the text field, and more generally about the cards created from the main article. I first copied the title in each new card, but anki uses the first field to check duplicates and the Incremental Reading Organizer uses the title field. That was not a very good idea.

So please tell me

A. do you add a custom title for each new card extract? e.g. (original title) "Want to Remember Everything You'll Ever Learn? Surrender to This Algorithm". What title would you give to the subsequent cards created from the original article?

B. Do you extract the text of the main card in the Title field (default setting)? That does not seem right to me, but it would solve question A. Then, do you keep the Text field empty?
nom...@gmail.com
6/8/13
I modify the front template of the IRcard type

<b>{{Title}}</b>
<br /><br />
{{Text}}

That's the result after reviewing the card and highlighting some text (see:print-screen)

The HMTL added is pretty dense. Looks like I can't modify the template to my liking. Any thought on that?

---

<style>

button {

font-weight: normal;

}

hr { background-color:#ccc; margin: 1em; }

body { margin:1.5em; }

img { max-width: 95%; max-height: 95%; }

.marked { position:absolute; right: 7px; top: 7px; display: none; }

#typeans { width: 100%; }

.typeGood { background: #0f0; }

.typeBad { background: #f00; }

.typeMissed { background: #ccc; }

</style>

<img src="qrc:/icons/rating.png" draggable="false" />

<div id="qa"><style>.card {

font-family: arial;

font-size: 20px;

text-align: left;

color: black;

background-color: white;

}

</style><b>Cognition</b><br />

<br /><style>

button {

font-weight: normal;

}

hr { background-color:#ccc; margin: 1em; }

body { margin:1.5em; }

img { max-width: 95%; max-height: 95%; }

.marked { position:absolute; right: 7px; top: 7px; display: none; }

#typeans { width: 100%; }

.typeGood { background: #0f0; }

.typeBad { background: #f00; }

.typeMissed { background: #ccc; }

</style>

<img src="qrc%3A/icons/rating.png" />

<div id="qa"><style>.card {

font-family: arial;

font-size: 20px;

text-align: left;

color: black;

background-color: white;

}

</style><b>Cognition</b><br />

<br /><div><span id="s13706858007" hiclr="yellow" hifont="false"></span>In science, cognition is a group of mental processes that includes attention, memory, producing and understanding language, learning, reasoning, problem solving, and decision making<span id="e13706858007" style="font-size:xx-small"><a href="javascript:" onclick="unhighlight(13706858007, false); return


---


Attachments (1)
ir_template_problem.png
60 KB   View   Download
Viktor Tábori
6/9/13
I have mac 10.7.5 with Anki 2.0.9, I try to install the plugin from here:

It says it was successful, but I get this message at the startup:
"An error occurred in an add-on.

Please post on the add-on forum:
https://groups.google.com/forum/#!forum/anki-addons

Traceback (most recent call last):

File "aqt/addons.pyc", line 39, in loadAddons

File "/Users/sved/Documents/Anki/addons/Incremental_Reading_Extension.py", line 25, in <module>

ImportError: cannot import name pyqtconfig"

How can I fix it?

Thanks,
Viktor
- show quoted text -
nom...@gmail.com
6/9/13
I have read the documentation a bit mroe, and Soren's post regarding the same question.

A. I assume the common usage to generate new cards from the main article is to use (Ctrl+0) "Past text to field: Text", and to input a custom title for each new card. That's what appears in Frank's print-screen.

Say, the original title of my article is "Cognition",  I could name the subsequent cards as "Cognition, Social Process" or "Cognition, Part 1", etc.

B. "Show add cards dialog: If this checkbox is unchecked, the shortcut will add the card automatically without opening the Add Cards dialog": The only way I can have it work is by swapping the fields Title < --> Text (Text become the first field) and keeping the shortcut setting "Past text to field: Text". The cards are automatically generated with an empty Title field. They will have to be edited later, so I see little benefit comparing to point A. -- perhaps, the manual could be updated?
- show quoted text -
This message has been deleted.
Damien Elmes
6/9/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
This isn't really the add-on's fault, and should be fixed when I release 2.0.10.


- show quoted text -
- show quoted text -

--
You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons?hl=en.
 
 

2 messages have been deleted.
nom...@gmail.com
6/9/13
Sorry about that, I have deleted 2 previous posts related to the same problem. I hope this one will explain better.

I have a problem with the highlighting function, and I think it's a bug.

* In my previous posts, I pasted some HTML. I though that was some garbage, but it is not. I had to correct that.

* I also claimed the bug was triggered when I was highlighting the first line of text in the Text field. The location is irrelevant. I had to correct that too.

This is what I experience:

1. When I highlight some text (any paragraph), and I use the default IR card template (a single front {{Text}} field)

=> The card will display some artifact at the top (usually a graphic placeholder) as soon as I edit the card (see: print-screen)

2.  When I highlight some text (any paragraph), and I use a modified IR front card template such as:

<b>{{Title}}</b>
<div style="margin-top: 14px;">{{Text}}</div>

=> The card will display some artifact at the top, and the titles will be duplicated two or three times (see: print-screen)
Attachments (2)
IR_1.png
39 KB   View   Download
IR_2.png
36 KB   View   Download
This message has been deleted.
nom...@gmail.com
6/9/13
I do like the concept of IR, and that something I effectively wanted to try but could not. One "problem" I see using this ad-don is with the stats. I think it's best to create a separate profile to keep IR and Study separated. What do you think?
nom...@gmail.com
6/10/13
To Frank

Could you take a look at this post: https://anki.tenderapp.com/discussions/ankidesktop/1387-anki-210-209-beta-text-alignment-in-warning-box

I have experienced a warning window with misaligned text while using you add-on. Damien asks if the message is generated by the ad-don. Thank you.

nom...@gmail.com
6/15/13
There is something I don't understand about the add-on.
My Incremental deck setting is: 5 new cards/day.
Every time I open this deck, all cards are new (that's explained in the add-on documentation).
I have only 5 cards in my deck. When I study this deck, the new count cards goes from 5 to 1, but then all the cards are shown again in a loop. Why doesn't the study session terminate after displaying the fifth card?
Viktor Tábori
6/17/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Thanks Damien!

In release 2.0.11 it still has the same error. Can I fix it somehow?

Thanks,
Viktor
- show quoted text -
Damien Elmes
6/18/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
I'm guessing it didn't get correctly bundled on OSX. I've added it to the todo list, but it may be faster to contact the add-on author and ask them to update the add-on.


- show quoted text -
- show quoted text -
Visit this group at http://groups.google.com/group/anki-addons.
 
 

Pietro Speroni di Fenizio
6/24/13
Please forgive me if this has been discussed before. I did make a search but I could not find it.

Would it be feasible to have a javascript button in the browser that clicking on it will automatically open Anki, with the correct URL inout to send a text in an Incremental Reading page?

Something similar to: javascript:var d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1180383478&u='+e(l.href)+'&t='+e(d.title);1;try{if(!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z){a=function(){if(!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=0,width=626,height=436'))l.href=f+p};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)

but for the application Anki and not for the application Facebook.

Thanks,
Pietro
Soren Bjornstad
6/24/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
I dealt with this issue by putting all my study decks under a superdeck called "Collection", so when I want to view stats for everything, I select the Collection deck and then view stats for the "deck". It's kind of a hack, but it works a lot better than having a separate profile and having to move cards across.


On Sun, Jun 9, 2013 at 4:15 AM, <nom...@gmail.com> wrote:
I do like the concept of IR, and that something I effectively wanted to try but could not. One "problem" I see using this ad-don is with the stats. I think it's best to create a separate profile to keep IR and Study separated. What do you think?

--
You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons?hl=en.
 
 

nom...@gmail.com
6/25/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:


On Monday, June 24, 2013 10:32:45 PM UTC-9, Soren Bjornstad wrote:
I dealt with this issue by putting all my study decks under a superdeck called "Collection", so when I want to view stats for everything, I select the Collection deck and then view stats for the "deck". It's kind of a hack, but it works a lot better than having a separate profile and having to move cards across.

That's effectively a better idea. Thanks Soren.
Peter Pan
6/25/13
When I set the Model field to IRead2 the Paste to Text field does not adjust.
It always says Back and Front no matter what Model I chose. This leads to an error message when I try to create a new IR card with the shortcut.
Could you give me any advise. It used to work. Thanks.
Arthur Chen
7/11/13
I found a bug. I created a new hotkey that creates a new card without opening the 'Add Card' window. Using it causes Anki to scroll back to the top of the card I'm working on.

在 2013年3月18日星期一UTC-4下午8时44分51秒,Frank写道:
New Incremental Reading Extension update includes a NEW Queue-Based Scheduler (independent of SRS scheduling) and Organizer.

Full rewritten explanation of the Incremental Reading Extension below (formatting works better in the forum than in the Anki Addons site). Search for the Scheduler to see what's new. 

Incremental Reading Extension

Incremental Reading is a way to read many articles concurrently and efficiently add spaced repetition cards to Anki in the process. In essence, you add reading material to an Incremental Reading deck in Anki and read it as time permits. As you read, you can highlight important passages and extract them into separate cards in Anki, either for further refinement, or as final SRS cards in another Anki deck. When you have finished reading an article, you will have incorporated all the important knowledge into your Anki deck(s) and can delete it, confident that the knowledge will be continually reinforced by Anki’s core SRS function.

Example using Add Cards Shortcut defined to create a new card in Incremental Reading 2 deck with IRead2 model and using yellow highlight to mark the extracted text in the original article.


The Incremental Reading Extension addon relies on the View Size Adjust addon for several important navigation and keyboard shortcut capabilities. Be sure to add both addons before you begin.

NOTE on UPGRADING:  This version changes the IRead2 model. Changing the model will require you to modify your existing IRead2 cards (removing little used Model and Deck fields, adding Title) or delete the IRead2 model and all associated cards before installing the upgrade.

NOTE on the original Incremental Reading addon:   The Incremental Reading Extension addon is a fork (an alternative) of the original Incremental Reading addon. Do not attempt to install both concurrently.


Features 

The Incremental Reading Extension, along with the View Size Adjust addon, supports incremental reading in Anki with the following features:

·      Keyboard navigation

o   PgUp, PgDn, ArrowUp, ArrowDown

o   Also available from the Edit menu

·      Keeping track of where you left off in each article

o   Scroll to last viewed text when the card is loaded

o   Uses same ‘zoom factor’ you last used for the same card

·      Adjust the size of the text as needed

o   Ctrl-- to increase text size

o   Ctrl-- to decrease text size

o   Saves selected size with each card and reapplies when shown

o   Also available from the Edit menu

·      Highlighting of text

o   Select and hit ‘h’

o   Custom colors (Hit Alt-2 to open a dialog. Also available from Edit menu)

o   Anti-highlighting option (color text, rather than background)

·      Custom keyboard shortcuts for adding cards efficiently

o   Alt-1 to create a custom shortcut

o   Choose deck, card model, shortcut key combination, highlighting, field into which to paste selected text, and to whether or not you want to see the add/edit dialogs.

o   Automatically copies Tags from source Incremental Reading card to the new card created using the keyboard shortcut.

o   Automatically copies Source field from Incremental Reading card to the new card created using the keyboard shortcut (if new card model has a Source field).

o   Shortcuts are added to the Edit menu as they are created.

o   Removing a shortcut is done by disabling it using the same dialog. Hit Alt-1, choose the same key combination and uncheck ‘Enabled’ checkbox.

·      (NEW) Independent scheduling algorithm more suitable to Incremental Reading

o   Queue depth based, rather than time-based

o   Configurable ‘Soon’ and ‘Later’ scheduling buttons. Dialog for editing these options is available in the Tools menu (‘Incremental Reading Scheduler Options’). Options include:

§  Push a card to a specific depth (count or position) in the queue

§  Push a card to a percentage depth into the queue

§  Apply randomness to either approach

o   Custom organizer dialog.

§  Move any card to any position in the queue

§  Bulk moves

§  Opened from Tools menu (‘Incremental Reading Organizer’).

§  Also opened from ‘custom’ answer button when working with Incremental Reading cards in the Anki Reviewer.

 

To Show Editor or Not to Show Editor

A couple of options on the Add Shortcut dialog (Alt-1) require explanation:

Show Add Cards dialog – This checkbox is checked by default. When you invoke the keyboard shortcut, the Add Cards dialog will be opened as it normally is when you add cards in Anki. It will be prepopulated with the Deck and Card Model you’ve chosen. If this checkbox is unchecked, the shortcut will add the card automatically without opening the Add Cards dialog. This is a convenience for incremental reading where a frequent activity is creating smaller, but still large, extracts from a source article and feeding those back into the Incremental Reading deck. The shortcut takes care of populating all fields with reasonable values in that case, making opening the dialog inconvenient (because you then have to close it).

Show Edit Current dialog – The original Incremental Reading addon opened two dialogs every time you attempted to add a new card. First it opened the Edit Current dialog, which contains the same card you were just looking at, but in editing mode. Second it opened the Add Cards dialog that you would normally expect. The advantage to this option is that you can delete the text from the original article as you do extracts, rather than highlighting. Personally, I prefer highlighting and deleting the entire original article at the end when I’m done with it.


Scheduling Algorithm for Incremental Reading

Anki’s normal scheduling algorithm is designed to support Spaced Repetition and address the “forgetting curve.” It makes very little sense to try to schedule reading material using the “forgetting curve” and its increasing intervals. Instead, incremental reading is really a matter of prioritizing a large number of articles based on your interest level and the importance you place on each article. Accordingly, a different scheduling algorithm is required.

For incremental reading, the goal is to manage a queue of articles and to be able to reprioritize each article every time you read it. It should also be possible to find an article you want to see, no matter where it is in the queue, and bring it forward. And periodically, you may want to review the entire queue and organize it in a specific way.

The scheduling algorithm attempts to meet the above goals without interfering with Anki’s normal scheduler or dramatically changing the Anki interface. To do so, it effectively removes the Incremental Reading cards from the Anki scheduler and keeps all the incremental reading cards permanently in the NEW queue. This keeps all Incremental Reading cards available all the time (not hidden away in a REVIEW queue to be shown again in a few days, weeks or months).

An incremental reading card will always have three buttons labeled ‘Soon’, ‘Later’ and ‘Custom’.  The meaning of ‘Soon’ and ‘Later’ is configurable, but essentially means ‘This is important and I want to see it again Soon’ or ‘This is less important, don’t show it to me again until Later.’  If, despite configuration, you don’t get the behavior you want, or if you want to handle a card specially, there is the ‘Custom’ button, which opens the Organizer dialog to let you put that card wherever you want in the queue.

Configuration of the ‘Soon’ and ‘Later’ scheduling options is available from the Tools -> Incremental Reading Scheduler Options menu item. Options include:

·      Position – Treat the configured value as a simple position number.

·      Percent – Treat the configured value as a percentage value

·      Random – Apply some randomness to the placement of the item using the configured count or percentage value.

·      Value – The numeric value. It represents either a count or a percentage.

Position vs Percent

If you choose Position and don’t apply Random, then hitting the button in question will directly place the card at the position you indicated. If you apply Random, it will place the card at a random position between 1 and the Position you indicated.

If you choose Percent and don’t apply Random, then hitting the button in question will calculate the position as a percentage of the queue depth and place the card at that position. If you apply Random, it will place the card at a random position between 1 and the calculated position by percentage.

The above explanations apply for the ‘Soon’ button. The ‘Later’ button differs only in that the placement of the card will be between the Position or Percentage given for ‘Soon’ and the Position or Percentage given for ‘Later’. Thus, if you specify 10 Percent for ‘Soon’ and 50 Percent for ‘Later’, the ‘Later’ button will place the card at a position between 10 and 50 percent into the queue.

Organizer 

The Organizer is a dialog that shows a list of all the cards in the Incremental Reading deck. It can be accessed from the Tools menu. 

There is a checkbox next to each card that can be used to select an individual card or many cards and move them up or down in the queue.  To move a card up, check the box next to that card and click the ‘Up’ button. To move a card down, click the ‘Down’ button. If multiple cards are checked, they move up or down together.

If a selected card cannot be moved up because it has hit the top of the queue or because the card above it is also selected, it will not be moved. Cards selected below it can move up until all selected cards make a contiguous block. The same applies for moving cards down alone or in bulk.

The ‘Pin Top/Bottom’ checkbox at the top locks the top-most (or bottom-most) item in place while ‘Up’ or ‘Down’ are clicked to move other selected items, allowing you to ‘anchor’ a block of selected items anywhere in the queue.

The Card Position field at the top of the Organizer allows you to specify a position to directly move the top-most selected item to. If multiple items are selected, they move up or down together.

 

Compatibility and Upgrading

Update your View Size Adjust addon. You need the most recent of both the Incremental Reading Extension addon and the View Size Adjust addon.

IRead2 Card Model has changed.

·      Removed Model and Deck fields.  The original IRead2 card has Model and Deck fields that were needed by the predecessor Incremental Reading addon. With the custom shortcuts approach used by Incremental Reading Extension, they are no longer needed. Accordingly, they have been removed.

·      Added ‘Title’ field. Using the Organizer requires you to be able to identify each card sufficiently to be able to prioritize it in the queue. Adding a ‘Title’ field makes that possible.

Changing the IRead2 model means that for those of you who are upgrading, there is a little work. Here are the options for doing the upgrade.

Option 1 – Delete the IRead2 card model before applying the new addons. This will delete all IRead2 cards in your collections. The addons will create the new IRead2 card model when installed.

Option 2 – Modify the IRead2 model before updating the addon.

·      Delete the Anki Deck field and the Model field. Anki will warn you that it will be modifying your collection in a way that makes it incompatible with the copy in the cloud or on other devices. You will need to do a full sync afterwards.

·      Add the Title field and position it as the first field in the model. Also check the radio button that says to use that field for sorting in the Browser. 


On Sunday, March 10, 2013 6:55:03 PM UTC-5, Frank wrote:
As suggested, I am adding a topic for a couple of related addons that I've contributed:  The View_Size_Adjust addon and the Incremental_Reading_Extension addon. They are related in that the Incremental Reading Extension is much more useful with the View Size Adjust addon, which provides several functionalities that while generally useful in Anki, are critical to an effective Incremental Reading capability:

  • Adjusting the size of the text when reading longer articles (Ctrl-- or Ctrl--)
  • Navigation keys for arrow up/down, page up and page down
  • Ability to save the position in an article to support coming back at a later point in time and picking up where you left off (hence the term 'incremental')
  • Ability to highlight text to indicate where cards have already been extracted, or simply to highlight the text if you plan to keep the longer article and read it with highlighted portions.
  • Ability to add custom shortcuts for extracting and adding cards to Anki using specific card models and decks
Most of these capabilities are useful independent of the Incremental Reading concept, so I have View Size Adjust as a separate addon. Arguably, it is poorly named at this point since the majority of functionality is really about navigation and shortcuts, but in order to avoid littering the Anki addon landscape with previously named versions, I kept it the same. 

Latest update added some more customization options to the custom shortcuts:

  • Added ability to specify shortcuts with any combination of Ctrl - Alt - Shift - Key. This includes the ability to set single key shortcuts. This allows the ability to override the default behavior of the 'x' and 'c' shortcuts.
  • Added the 'showEditCurrent' dialog option when creating a new shortcut. This is unchecked by default. It mirrors the original 'x' and 'c' shortcut operation and opens the 'Edit Current' window to allow you to edit the current card while you are also adding another card in the separate 'Add Cards' dialog.
I will try to monitor this thread, but please understand that this is a purely voluntary effort as time permits. Hope that you can get some use out these plugins.

--Frank

TehOtServer
7/12/13
One question: how do you import pdfs? Can pdfs be added to a card?

Another thing about importing: if I want to import a wikipedia article, I copy paste the source code of the wikipedia page in the html editor of anki. Most of the formatting is correct, but it's not exactly like the original. For example the text is centre aligned, which is a bit annoying. Can I improve that?

Thanks!
Soren Bjornstad
7/14/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Anki cannot display PDFs at the moment, so your best bet is probably to
run it through a PDF-to-HTML converter first. The formatting doesn't
look great, but it usually works.

The way I usually add website content is by simply copying and pasting
right out of the browser instead of from the source code, and I don't
generally run into issues like that, so you might consider trying that.
- show quoted text -
> --
> You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.
> Visit this group at http://groups.google.com/group/anki-addons.
>
>
Susan Gmeiner
7/22/13
After adding a card an clicking close I get this message:

An error occurred in an add-on.
Please post on the add-on forum:
https://groups.google.com/forum/#!forum/anki-addons

Traceback (most recent call last):

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.addcards", line 188, in reject

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 417, in maybeReset

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 400, in reset

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.main", line 353, in moveToState

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.hooks", line 61, in repl

File "C:\Users\Susan\Documents\Anki\addons\View_Size_Adjust.py", line 771, in vsa_reviewState

self.web.setHtml(curNote['Text']);

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 98, in __getitem__

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/anki.notes", line 95, in _fieldOrd

KeyError: 'Text'


The screen then says waiting for editing to finish.  The Resume Now button doesn't work.  I ahve to reopen the Incremental Reading deck.  My place is not saved so I need to scroll down to wear I was.  


Thanks.


Susan


Aleksej
7/27/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
On 2013-07-22 02:12, Susan Gmeiner wrote:
> KeyError: 'Text'

Have you renamed that field in the note type?

Or maybe the wrong note type is being used (related to the requirement
to update one when switching to IRE?).
Susan Gmeiner
7/29/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Thank you.  I was using the wrong note type.  I had done it correctly for the first few articles and then forgot to set it for the last one I created.  

When I create a card from a selected portion of an IRead2 card  I think the selected portion should be automatically pasted into
the field I chose when I used Alt-1.  This is not happening.   How do I fix this?

Thanks for your help.
- show quoted text -
Kacper Zieliński
8/6/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:

Traceback (most recent call last):

File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.addons", line 39, in loadAddons

File "c:\pyi\iu.py", line 436, in importHook

File "c:\pyi\iu.py", line 521, in doimport

File "C:\Users\Samsung\Documents\Anki\addons\Incremental_Reading_Extension.py", line 26, in <module>

from View_Size_Adjust import ViewManager

File "c:\pyi\iu.py", line 455, in importHook

- show quoted text -
Aleksej
8/6/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
You also need to install the View Size Adjust add-on.
- show quoted text -
This message has been deleted.
Frank
11/4/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Tom - Sorry for late reply. Have not been following Anki for a while (just too busy at my day job). You can remove a shortcut by hitting Alt+1 to open the add shortcut dialog, selecting the key combination that you want to delete, and unchecking the 'enable' checkbox (the last checkbox in the dialog). Not very intuitive, I know. Perhaps an update over the Thanksgiving holiday. 


On Mon, Oct 21, 2013 at 8:35 AM, Tom <tluc...@gmail.com> wrote:
Hello,

Is there a way I can delete redundant Add Card shortcuts that I have created in the Edit menu?

Thanks in advance.
Tom


On Monday, 11 March 2013 10:55:03 UTC+11, Frank wrote:
As suggested, I am adding a topic for a couple of related addons that I've contributed:  The View_Size_Adjust addon and the Incremental_Reading_Extension addon. They are related in that the Incremental Reading Extension is much more useful with the View Size Adjust addon, which provides several functionalities that while generally useful in Anki, are critical to an effective Incremental Reading capability:

  • Adjusting the size of the text when reading longer articles (Ctrl++ or Ctrl+-)
  • Navigation keys for arrow up/down, page up and page down
  • Ability to save the position in an article to support coming back at a later point in time and picking up where you left off (hence the term 'incremental')
  • Ability to highlight text to indicate where cards have already been extracted, or simply to highlight the text if you plan to keep the longer article and read it with highlighted portions.
  • Ability to add custom shortcuts for extracting and adding cards to Anki using specific card models and decks
Most of these capabilities are useful independent of the Incremental Reading concept, so I have View Size Adjust as a separate addon. Arguably, it is poorly named at this point since the majority of functionality is really about navigation and shortcuts, but in order to avoid littering the Anki addon landscape with previously named versions, I kept it the same. 

Latest update added some more customization options to the custom shortcuts:

  • Added ability to specify shortcuts with any combination of Ctrl + Alt + Shift + Key. This includes the ability to set single key shortcuts. This allows the ability to override the default behavior of the 'x' and 'c' shortcuts.
  • Added the 'showEditCurrent' dialog option when creating a new shortcut. This is unchecked by default. It mirrors the original 'x' and 'c' shortcut operation and opens the 'Edit Current' window to allow you to edit the current card while you are also adding another card in the separate 'Add Cards' dialog.
I will try to monitor this thread, but please understand that this is a purely voluntary effort as time permits. Hope that you can get some use out these plugins.

--Frank

--
You received this message because you are subscribed to a topic in the Google Groups "Anki Add-ons" group.

Jevon Hill
11/7/13
I have the same issue as Susan Gmeiner. After highlighting a portion of the card that is being shown and pressing Ctrl+0 for Add Card, when the add card dialog opens, the highlighted text is not inserted into the specified field. This happens with any card type and field I choose. The only field that works is source when picking the IRead2 card type. Any idea? I am using Anki 2.0.16 and have done a complete re-install.
Frank
11/10/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Uncertain. Do you have the Incremental Reading Extension addon installed as well? There is some interplay between them, but I thought that I had removed all dependencies in View Size Adjust. Might try installing it and see if that makes any difference. Let me know if it does and I'll try to eliminate the dependency.


On Wed, Nov 6, 2013 at 10:52 PM, Jevon Hill <pingp...@gmail.com> wrote:
I have the same issue as Susan Gmeiner. After highlighting a portion of the card that is being shown and pressing Ctrl+0 for Add Card, when the add card dialog opens, the highlighted text is not inserted into the specified field. This happens with any card type and field I choose. The only field that works is source when picking the IRead2 card type. Any idea? I am using Anki 2.0.16 and have done a complete re-install.

--
You received this message because you are subscribed to a topic in the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons.

Michael Fogleman
11/10/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hello Frank,

Thank you so much for developing this extension. I realize you are very busy right now, but I just wanted to mention some feedback for you, which may be helpful if you have time to do an update over the Thanksgiving holiday, or for other readers.

- The comments on the IR extension have a link to a bugfix that enables the Organizer to read titles of IRead2 cards that have Unicode characters in the title. I've experienced that problem, so I tried to put the patch in myself and it seems to be working now. It changes one line and adds two more. It should be pretty easy for you to replicate the bug, look at the patch, and see if you want to include it.
- I experienced a bug where a card was deleted... it was trivial to add it back in, but frustrating. If it happens again, I will try to post more information so you can diagnose the bug.
- Right now, IR is inconsistently remembering my location (sometimes it does, sometimes it doesn't), and not remembering my preference for size on cards. The size preference carries over to other cards in the deck as well as to the deck menu. The sizing seems like a bug, but I may be using the location-remembering feature incorrectly. If anyone has any ideas, please let me know.
- I would definitely love a more intuitive shortcut browser / editor, but the current one is functional.
- I'd also love to get a user-discussion going about workflow. It is still blowing my mind that IR is available in a stable form for Anki, and, having never used it in Supermemo, I'm still trying to figure out the best / most efficient way to use it. 

Thanks everybody.

MWF
- show quoted text -
Jevon Hill
11/12/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Ah I just realised I wasn't "highlighting" properly. What I was doing was highlighting by selecting the text, pressing "h", deselecting the text, then pressing Add Card instead of keeping the text selected before pressing Add Card.
- show quoted text -
Diego José Vigueras
11/19/13
Hello Frank

Thank you very much for this extension.

I've downloaded it -and the Visual extension too, as you recommended-, but I've founded this problem, it seems an error. Could you please help me? 
Thanks!

This is the message, trying to go into the Tools/Incremental Reading Organizer:

"Traceback (most recent call last):

File "/Users/Diego/Documents/Anki/addons/Incremental_Reading_Extension.py", line 375, in callIRSchedulerDialog

self.showIRSchedulerDialog(None);

File "/Users/Diego/Documents/Anki/addons/Incremental_Reading_Extension.py", line 389, in showIRSchedulerDialog

cardDataList = self.getCardDataList(deckID, cardID);

File "/Users/Diego/Documents/Anki/addons/Incremental_Reading_Extension.py", line 683, in getCardDataList

if(note.model()['name'] == 'IRead2'): cardData['title'] = str(note['Title'])[:64].encode('string_escape');

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 38: ordinal not in range(128)"


Thank you very much. I'd like to use Incremental Reading.

Cheers

Diego

Aleksej
11/19/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
It's a bug, here is a patch:
https://gitorious.org/vsa_and_ire/vsa_and_ire/commit/d44bfd9d5f435596d300cfbc1fe9f07c278fcd97
- show quoted text -
Diego José Vigueras
11/19/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hi, Aleksej

Thank you for your quick answer.
My problem is that I don't know what to do with that patch.
I've just come into the anki universe and I don't know anything about python.
Sorry. Could you, please, give me some instructions about how to use that patch?
Cheers
Diego
- show quoted text -
Aleksej
11/19/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
A patch (diff) shows what you remove and what you add.  You can apply it
using the "patch" utility from diffutils, or manually.

Look at this version:
https://gitorious.org/vsa_and_ire/vsa_and_ire/commit/d44bfd9d5f435596d300cfbc1fe9f07c278fcd97.diff

The file is in Anki/addons directory.
- show quoted text -
Diego José Vigueras
11/19/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hi!
I've got it. It works now. 
Thank you very much Aleksej :)
Cheers!
Diego
- show quoted text -
Jonathan Leathwood
11/25/13
Can anyone help me with this problem?

I am trying to open this dialogue: Create Add Cards Shortcut (Alt+1)

It used to work. Now when I click on this menu item or press Alt+1 I get this error message:

Traceback (most recent call last):

File "/Users/jonathanleathwood/Documents/Anki/addons/View_Size_Adjust.py", line 276, in showAddCardQuickKeysDialog

colorTextField = "<span style='font-weight:bold'>Source highlighting color (IRead2 model only): </span><input type='text' id='color' value='" + colorValue + "' />";

TypeError: cannot concatenate 'str' and 'NoneType' objects

Soren Bjornstad
12/7/13
This is just a small bug report: not a huge deal, but it's kind of annoying. Every time I switch profiles, the Incremental Reading options get added to the Tools menu again. So after I've switched a few times, I wind up with "Incremental Reading Organizer" and "Incremental Reading Scheduling Options" on my tools menu five times.


On Sunday, March 10, 2013 6:55:03 PM UTC-5, Frank wrote:
As suggested, I am adding a topic for a couple of related addons that I've contributed:  The View_Size_Adjust addon and the Incremental_Reading_Extension addon. They are related in that the Incremental Reading Extension is much more useful with the View Size Adjust addon, which provides several functionalities that while generally useful in Anki, are critical to an effective Incremental Reading capability:

  • Adjusting the size of the text when reading longer articles (Ctrl++ or Ctrl+-)
  • Navigation keys for arrow up/down, page up and page down
  • Ability to save the position in an article to support coming back at a later point in time and picking up where you left off (hence the term 'incremental')
  • Ability to highlight text to indicate where cards have already been extracted, or simply to highlight the text if you plan to keep the longer article and read it with highlighted portions.
  • Ability to add custom shortcuts for extracting and adding cards to Anki using specific card models and decks
Most of these capabilities are useful independent of the Incremental Reading concept, so I have View Size Adjust as a separate addon. Arguably, it is poorly named at this point since the majority of functionality is really about navigation and shortcuts, but in order to avoid littering the Anki addon landscape with previously named versions, I kept it the same. 

Latest update added some more customization options to the custom shortcuts:

  • Added ability to specify shortcuts with any combination of Ctrl + Alt + Shift + Key. This includes the ability to set single key shortcuts. This allows the ability to override the default behavior of the 'x' and 'c' shortcuts.
  • Added the 'showEditCurrent' dialog option when creating a new shortcut. This is unchecked by default. It mirrors the original 'x' and 'c' shortcut operation and opens the 'Edit Current' window to allow you to edit the current card while you are also adding another card in the separate 'Add Cards' dialog.
I will try to monitor this thread, but please understand that this is a purely voluntary effort as time permits. Hope that you can get some use out these plugins.

--Frank

This message has been deleted.
Aleksej
12/11/13
Lately I am getting this error sometimes while "rating" an IRE card
(Anki 2.0.19):


Traceback (most recent call last):
   File "/usr/share/anki/aqt/webview.py", line 21, in link
   File "/usr/share/anki/aqt/reviewer.py", line 315, in _linkHandler
   File "/usr/share/anki/anki/hooks.py", line 61, in repl
   File "/home/fca/Anki/addons/Incremental_Reading_Extension.py", line
909, in my_reviewer_answerCard
   File "/usr/share/anki/aqt/reviewer.py", line 263, in _answerCard
   File "/usr/share/anki/aqt/reviewer.py", line 104, in nextCard
   File "/usr/share/anki/aqt/reviewer.py", line 214, in _showQuestion
   File "/usr/share/anki/anki/hooks.py", line 26, in runHook
   File "/home/ankiuser/Anki/addons/Incremental_Reading_Extension.py",
line 192, in adjustZoomAndScroll
   File "/home/ankiuser/Anki/addons/View_Size_Adjust.py", line 70, in
setZoomFactor
   File "/home/ankiuser/Anki/addons/View_Size_Adjust.py", line 611, in
savePluginData
IOError: [Errno 24] Too many open files: u'/home/ankiuser/Anki/User
1/collection.media/_ViewSizeAdjustAddon.dat'
Jae Hoon
12/20/13

Thank you for these great add-ons! I find them to be incredibly helpful in my studies. As of late, however, I am encountering a bug I have not been able to find a solution for.

Alt+1 doesn't work. I get the following error:

 

Traceback (most recent call last):
  File "C:\Documents and Settings\user\My Documents\Anki\addons\View_Size_Adjust.py", line 321, in showAddCardQuickKeysDialog
    javascript += "var pasteToFieldValue = '" + str(self.lastDialogQuickKey.get('fieldName', '')) + "';\n";
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

I hope someone out there can lend a helping hand! Thanks in advance.
Aleksej
12/20/13
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
- show quoted text -
Try this patch:
https://gitorious.org/vsa_and_ire/vsa_and_ire/commit/d44bfd9d5f435596d300cfbc1fe9f07c278fcd97

miq...@gmail.com
12/20/13
Hello

I get this error in OS X when Anki starts:
 

Traceback (most recent call last):

File "aqt/progress.pyc", line 69, in handler

File "aqt/main.pyc", line 109, in setupProfile

File "aqt/main.pyc", line 243, in loadProfile

File "anki/hooks.pyc", line 26, in runHook

File "/Users/mika/Documents/Anki/addons/Incremental_Reading_Extension.py", line 90, in loadPluginData

self.ir2data = pickle.loads(tmp);

File "pickle.pyc", line 1382, in loads

File "pickle.pyc", line 858, in load

File "pickle.pyc", line 966, in load_string

ValueError: insecure string pickle


It seems that this causes all hotkeys I have defined in View Size Adjust plugin to be lost. It also seems that this errors happens only when I have used Anki in Windows then use it in OS X. Everything works fine other way around.

-Mika 
Konrad
1/7/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Thanks a lot for your great extension and this patch. Unfortunately, I still get the same error after patching - even when using nothing else than pure ASCII. Do you have any idea why this might be?
System: Ubuntu
Anki Version 2.0.19
Qt 4.8.1 PyQt 4.9.1

thanks
Konrad
- show quoted text -
Lookanio
1/18/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
- show quoted text -

I have v. similar issue but with View_Size_Adjuct (when I press Alt+1):


Traceback (most recent call last):

File "/home/luser_name/Anki/addons/View_Size_Adjust.py", line 321, in showAddCardQuickKeysDialog

javascript += "var pasteToFieldValue = '" + str(self.lastDialogQuickKey.get('fieldName', '')) + "';\n";

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 3: ordinal not in range(128)


I will appreciate for any help. Thank you in advance.


Lookanio
1/20/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
- show quoted text -

I solved it by myself :-) Put:

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

into View_Size_Adjust.py

Seems to work out :-)

BTW Thank you for you keeping this extension better and better.
Marius V
2/11/14
Hello ppl, have a question here. as per copying content from the web, as we now, original html formating gets stripped all away (or is it just mine? :)), and when there's specific text formatting like italicizing, bolding, sub and superscripting is gone, that's very inconvenient when considering text readability. So the question is - are there any possible roundabouts for this kind of problem? smth like editing the paste or card options in anki? btw i'm new but old to anki :) so there;s no need to hold back :)
Marius V
2/11/14
oh, sorry, my bad. just disabled the option from preferences menu 'Strip HTML when pasting text' :)


2014 m. vasaris 11 d., antradienis 10:41:02 UTC+2, Marius V rašė:
Hello ppl, have a question here. as per copying content from the web, as we now, original html formating gets stripped all away (or is it just mine? :)), and when there's specific text formatting like italicizing, bolding, sub and superscripting is gone, that's very inconvenient when considering text readability. So the question is - are there any possible roundabouts for this kind of problem? smth like editing the paste or card options in anki? btw i'm new but old to anki :) so there;s no need to hold back :)
Aleksej
2/11/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
A very old message, but…

Python 2.7 documentation says in python-doc/html/library/pickle.html:

Warning

The pickle module is not intended to be secure against erroneous or maliciously constructed data. Never unpickle data received from an untrusted or unauthenticated source.


There is also a faster implementation called cPickle.  I hope "import cPickle as pickle" is the right way to make IRE use cPickle instead of pickle.

However, I have found some time ago when working with tables of megabytes in size, that the csv module works much faster than cPickle does, and has no security issue.  However, switching to it requires some coding.
- show quoted text -
- show quoted text -
--
You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.

solve...@gmail.com
2/18/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:

HI,

Thanks for the addon.  Really like the scheduling.

What about the load from url feature of the first ankiIR? 

Does anyone know of a automated way to load from browser? 
Would love to have a keyboard shortcut that lets me just load to my IR queue from the browser...
(right now have a break in workflow, copy paste into anki...)


Aleksej
2/20/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
FWIW, I am not the developer of the add-ons,  Frank is.


On 2014-01-07 03:52, Konrad wrote:
Thanks a lot for your great extension and this patch.

solve...@gmail.com
2/21/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
OK,

Well Ive been looking at the codebase this evening for the Incremental_Reading_Extension.py
And I dont quite understand how the initial IRead2 type is saved after we manually paste into the editor fields, ie Title, Text, Source.  (I guess this is built into Anki editor functions, so when we hit the add button, that is a built-in feature...?)

The first author, Frank, in the AnkiIR.py (first one), made a doAddURL() function to just load the page into anki.  But that uses Fact, tidyHTML.. none of which is available in Anki2, which uses note, type, ... 

In the new version, there is an extract function, which uses setField to pull in the copied mimeData to the next note? ..(sorry if confusing the terminology between anki1/2), and i guess it just uses the builtin editor options to save the IRead2 type.

Im new to anki, but does anyone know where I should look to insert into the editor field? 
In the aqt folder there's:
field.py (has a promising sounding fillFields(),
models.py (has a onAdd function )
editor.py (some js functions like setFields, saveField)

a pointer in the right direction, on how to auto-fill fields and save from url,  would be great!

-thanks
- show quoted text -
Aleksej
2/21/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
On 2014-02-21 11:57, solve...@gmail.com wrote:
Well Ive been looking at the codebase this evening for the Incremental_Reading_Extension.py
And I dont quite understand how the initial IRead2 type is saved after we manually paste into the editor fields, ie Title, Text, Source.  (I guess this is built into Anki editor functions, so when we hit the add button, that is a built-in feature...?)
Yes, there is a checkbox in the Fields window for a note type.

There is also an add-on to toggle that near the fields themselves: Frozen Fields by tmbb  https://ankiweb.net/shared/info/2819760111 https://github.com/tmbb/FrozenFields


In the new version, there is an extract function, which uses setField to pull in the copied mimeData to the next note? ..(sorry if confusing the terminology between anki1/2), and i guess it just uses the builtin editor options to save the IRead2 type.

Maybe you need http://ankisrs.net/docs/addons.html
solve...@gmail.com
2/26/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
Hi,

Sorry for the questions(new to anki/busy)
Why do the images not display for all websites?  (meaning when i copy paste the html, sometimes images render, somethimes not)  is there a way to 'deep copy' a web-page and paste it.

Or(there is no deep-copy) the images are normally dwnld and stored as well, but mine are just not getting set somehow ?

again thank you for this wonderful tool !
- show quoted text -
Aleksej
2/26/14
Re: [anki-addons] Re: View_Size_Adjust and Incremental_Reading_Extension addons
Other recipients:
1. Unless you are just thanking me for telling you about it, you've misread: I am *NOT* the developer of these add-ons.  The developer is Frank Kmiec, who forked "Incremental Reading" by tmbb.

2. The image download question concerns Anki itself.  I enabled HTML pasting only recently, and noticed this problem, too.

The add-on also has an image-related issue, which is that images sometimes disappear when extracting.  Also, highlights *might* be disappearing when I open the HTML code editor.

3. I have previously criticized the add-on's prioritization capabilities.  While they indeed look weak compared to SuperMemo's micromanagement-friendly UI, I have found some details I had been missing:
 a) I had "Later" configured with "60%", which meant the cards in the farther 40% would not be shown until I removed or cut down some of the cards in the nearer 60%.  Now I changed it to 100% and can get to the newest cards without repositioning them manually.
 b) You can reposition cards without touching Anki's scheduling algorithm, and thus without touching statistics!  For that, *instead of* pressing "Show answer", press "1" or "2" on your keyboard (or "3" for "Custom").  The card's queue position will be changed, but the card won't be closed.  If you are satisfied with the position, press "s" twice to go to the next card without "rating" this one.  There will be no record in the card's history.
- show quoted text -
- show quoted text -
--
You received this message because you are subscribed to the Google Groups "Anki Add-ons" group.
Visit this group at http://groups.google.com/group/anki-addons.