Skip to content
RisingOrange edited this page Aug 25, 2021 · 8 revisions

Building

Building is done using aab (the Anki add-on builder package by Glutanimate)

pip install -r requirements.txt

aab build -d ankiweb

or

aab build -d local

aab...

  • cleans the build (deletes all files that were not commited from the build)
  • copies the license
  • creates a manifest.json file
  • builds ui and resource files (resulting .py files are put into src//gui/forms/anki21 and src//gui/resources/anki21 respectively)
  • packages everything into .ankiaddon file (result will be in build/)

Building Ui

To build just the UI (compile .ui, .qrc files), run this in the project root directory:

pip install -r requirements.txt

aab build ui

Releasing

Use the "create release" GitHub action. It...

  • creates a "Bump version to " commit with the version you declared when starting the action
  • creates a new tag
  • builds .ankiaddon file and uploads it as a release to GitHub

File structure

addon.json

designer/ and resources/

files from here will be compiled (by aab) into the forms and resources folders in src/*/gui/

designer/

  • contains the .ui files created using QtDesigner
  • there is an options.ui file that contains the design for an Anking options menu with icons that take you to anking/ankipalace webpages/socials when clicked

resources/

contains qt resource files (.qrc), for the icons in the options menu (see above)

src/*/gui

options.py

  • defines the Anking menu and options dialog
  • uses AnkingOptions class from anking_options.py which sets up the anking menu and openWeb actions for the link icons and provides buttons for saving, cancelling and resetting to default settings

src/*/libaddon (link)

this is an Anki add-on development package by Glutanimate

it is currently only used for the options menu and config

libaddon...

  • contains useful classes for dialogs and widgets
  • standardizes config managment
  • standardizes the retrieval of data about Anki and the add-on
  • provides utilities for logging, third-party add-on imports, etc.

src/*/config.py

defines the config manager of the project (using libaddon.anki.config.manager)