Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mini_format_pack/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"actions": [
{
"name": "setFontSize",
"tooltip": "Change font size",
"hotkey": "ctrl+shift+s"
},
{
"name": "strikeThrough",
"tooltip": "Apply strikethrough",
Expand Down Expand Up @@ -68,4 +73,4 @@
"hotkey": "ctrl+shift+alt+b"
}
]
}
}
Binary file added src/mini_format_pack/icons/setFontSize.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/mini_format_pack/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from aqt import mw
from aqt.qt import *
from aqt.utils import getOnlyText
from anki.hooks import addHook
from anki.utils import isWin, isMac

Expand All @@ -40,6 +41,11 @@ def strikeThrough(editor):
editor.web.eval("setFormat('strikeThrough')")


def setFontSize(editor):
fs = getOnlyText(_("New font size:"), default="5")
editor.web.eval("setFormat('fontSize', '{}px');".format(fs))


def indent(editor):
editor.web.eval("setFormat('indent')")

Expand Down