Add details on how to initiate a collection and add a helper function in support of that. #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pretty much what the title says.
For a fledgling Anki developer writing a non-add-on program, it is not obvious, even after reading mounds of source code and docs, that one can find and pass your collection.anki2 path to Collection() to initialize a col.
Anki Forums, Reddit, and unsolved PRs/Issues on 3rd party projects such as genanki, panki, and others are full of advanced users although perhaps new to Anki searching for (and at times unnecessarily and unknowingly trying to duplicate) functionality that already readily exists via the official module. They just can’t figure out how to use it without building an add-on.
I understand this is hosted on a domain with “addon” literally in the name, and this change doesn't directly impact Anki add-on development. However, it could be useful knowledge for add-on developers for testing. Also these docs are the only thorough documentation on Anki extensibility via its official module. I think educating users on working with collections with external scripts via the Anki module certainly falls under extensibility and provides a gateway to making Anki add-ons.
[Updated] Regarding the helper function, it has now been tested on Linux, Mac, and Windows.