codeButton is an Anki addon that modifies the note editor toolbar to add a formatting button which wraps the currently-selected text in <code></code> HTML tags. This is useful for notes that include command line interface (CLI) commands, programming keywords, and so on.
The following instructions assume that you already:
- Clone this repository to your computer (
git clone https://github.com/mschon/anki-addon-editor-codeButton.git). - In Anki, select Tools, then Add-ons.
- In the Add-ons menu, select View Files.
- This should open your add-ons directory, which may be called
addons21. - Copy the repository directory created in step 1 into the add-ons directory.
- The add-ons directory should now contain a directory called
anki-addon-editor-codeButton, which contains a file called__init__.py. - Restart Anki (i.e. exit and reopen).
After reopening Anki, click the Add button to open the note editor. In the top toolbar, you should now see an additional button at the end labeled <>.
Enter some text in any of the note fields, highlight a portion of that text, and click the <> button. The highlighted text should now appear in fixed-width font. If you view the HTML for the field, you should see the highlighted text is wrapped in <code></code> tags.
If the button doesn't appear, go to the main Anki window and select Tools, then Add-ons. Make sure that the anki-addon-editor-codeButton add-on is in the list and is enabled.
To disable the add-on, go to the main Anki window and select Tools, then Add-ons. Select the anki-addon-editor-codeButton add-on and click Toggle Enabled. It should then appear as disabled in your add-ons list. You can also click View Files to open the add-ons directory and delete the anki-addon-editor-codeButton subdirectory from it.
Refer to HISTORY.md
Refer to CONTRIBUTING.md
This add-on is available free of charge.
If you found this add-on useful, monetary gifts are appreciated via PayPal.
You are welcome to connect with me on LinkedIn.