157 9
Sign in to rate

Power Format Pack: Markdown, code blocks, lists, tables, syntax highlight & more

0.87MB. Updated 2017-08-21. Only supports Anki 2.0.x.

Description

Power Format Pack IMPORTANT: This add-on gets updated quite frequently, so before posting an error or giving it one star, please update the add-on. Also, check if you are running the latest version of Anki. If, after updating, you still encounter a bug, kindly post a bug report on GitHub. I can't reply to your comments here, so if you want the issue fixed, you should really consider posting to GitHub. UPDATING is easy. First, remove the add-on from Anki (Tools > Add-ons > Power Format Pack > Delete...), remove the addon folder at <user>/Documents/Anki/power_format_pack, then install it again by using the number at the bottom of this page. New in version 0.8.9.* MARKDOWN You can use Markdown to style your notes. Markdown is a text-to-HTML conversion tool, that lets you quicky style your notes. If you don't know Markdown yet, have a look at this tutorial. Enable Markdown Markdown is disabled by default, to keep this add-on as modularised as possible. To enable it, go to settings and tick the checkbox next to "Markdown". Restart Anki to complete the process. Using Markdown When you click the Markdown button, your Markdown syntax will be translated into HTML and displayed. You are now in Markdown mode. Markdown mode is indicated by the changed background color and the warning message under the field you are editing. In Markdown mode, you cannot use any of the formatting buttons you would normally have access to. This is done to prevent any accidental editing of the displayed result. If you want to make changes to the card, first toggle the Markdown button again and go back to normal mode. However, if you absolutely need to edit the card in Markdown mode, you can choose to keep the buttons enabled from the options menu, by ticking the checkbox Allow editing of rendered Markdown. When you do add text to your card or alter the HTML directly in Markdown mode, a dialog box will appear asking whether you want to revert to your previous Markdown syntax, or try to incorperate the changes in your card. Be advised, however, that the result may lose some of your original Markdown syntax, especially if the original syntax was complex (footnotes, tables, code blocks). To make sure you always return to your original syntax when exiting Markdown mode, you can check the Always automatically revert back to saved Markdown checkbox in the options. Doing this will never show you the warning dialog box and will always discard any changes made in Markdown mode. Don't use Markdown in combination with other formatting I recommend you use either Markdown or the rich formatting buttons, but not both at the same time. Markdown was designed to be a fast and simple way to quickly write relatively simple formatted text. As such, it won't know what to do with complex cards that use formatting unknown to the Markdown specification. So when clicking the Markdown button, it _will_ "erase" formatting that it does not know how to handle. You were warned. Extra Markdown syntax This addons supports some Markdown syntax not found in John Gruber's original Markdown: CODE BLOCKS Code blocks can be created by indenting four spaces with a white line before and after the code block. The syntax can be specified either by: :::java public class Test { } or by using: ```python def print_me(this): print "Printing: ", this ``` Code blocks can be styled by choosing a predefined styling in the settings, or by creating your own stylesheet. More (technical) details on code blocks (e.g. highlighting of lines) can be found on the Python Markdown project. DEFINITION LISTS A definition list can be created as follows: Apple : Pomaceous fruit of plants of the genus Malus in the family Rosaceae. Orange : The fruit of an evergreen tree of the genus Citrus. Make sure there is a white line between the different definitions. FOOTNOTES Footnotes[^1] have a label[^@#$%] and the footnote's content. [^1]: This is a footnote content. [^@#$%]: A footnote on the label: "@#$%". A footnote label must start with a caret ^ and may contain any inline text (including spaces) between a set of square brackets []. Only the first caret has any special meaning. A footnote content must start with the label followed by a colon and at least one space. The label used to define the content must exactly match the label used in the body (including capitalization and white space). The content would then follow the label either on the same line or on the next line. The content may contain multiple lines, paragraphs, code blocks, blockquotes and most any other markdown syntax. The additional lines must be indented one level (four spaces or one tab). More (technical) details on footnotes (e.g. multiple blocks of content) can be found on the Python Markdown project. ABBREVIATIONS The Markdown syntax: The HTML specification is maintained by the W3C. *[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium will be rendered as: <p>The <abbr title="Hyper Text Markup Language">HTML</abbr> specification is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p> TABLES Tables have the same syntax as described below for the table button. Tables can be styled with CSS in your stylesheet. ATTRIBUTES An example attribute list might look like this: {: #someid .someclass somekey='some value' } A word which starts with a hash (#) will set the id of an element. A word which starts with a dot (.) will be added to the list of classes assigned to an element. A key/value pair (somekey='some value') will assign that pair to the element. Be aware that while the dot syntax will add to a class, using key/value pairs will always override the previously defined attribute. Consider the following: {: #id1 .class1 id=id2 class="class2 class3" .class4 } The above example would result in the following attributes being defined: id="id2" class="class2 class3 class4" Say you have a CSS class: .large { font-size: 32px; } You can add this class to a paragraph like this: A person often meets his destiny on the road he took to avoid it. {: .large} More (technical) details on attributes (e.g. block-level and inline attributes) can be found on the Python Markdown project. FORMATTING BUTTONS Besides Markdown, this add-on adds the following supplementary formatting buttons to Anki: CUSTOM USER-DEFINED KEYBINDINGS You can change the default keybindings to your liking by going to Tools > Power Format Pack add-on (options) > Keybindings... You will be presented with a table view of all available functionality on the left and the associated keyboard shortcuts on the right. To change a particular keybinding, double click on the shortcut and press the desired keyboard combination. Be aware that all keyboard combinations will be accepted, although some of them won't actually work in practice. If you assign the keyboard shortcut 'A' to a certain functionality, for example, the shortcut won't actually do anything. Also keep in mind that there is no check for duplicate keybindings. This means that when a keybinding is already taken by either your OS, Anki, this add-on, or some other running program, the result is undefined. You can sort either on functionality ('Action') or keybindings by clicking on the appropriate header columns. If you want to revert to the default keybindings provided by Power Format Pack, click the 'Restore Defaults' button. You can undo any changes you made and keep the dialog window open by pressing the 'Reset' button. 'Cancel' will do the same but will also close the window. Lastly, when you click 'Save', the dialog window will close and your changes will be applied. DISABLING UNUSED BUTTONS The buttons can be enabled or disabled individually in Tools > Power Format Pack (options), so feel free to disable the buttons you don't use. SOURCE CODE The source code is available on GitHub. If you have any issues, please report them there! CHANGELOG -------------------------------------------------- 28-08-2014 v0.1.0: initial release 29-08-2014 v0.1.1: bug fix and outdent button added 30-08-2014 v0.1.2: <code> element bug fixed 03-09-2014 v0.1.3: added definition lists and tables 06-09-2014 v0.1.4: bug fixes 24-09-2014 v0.2.0: definition list greatly improved and tables redesigned with light look 25-09-2014 v0.2.1: added proper icons 28-09-2014 v0.2.2: bug fixed with empty definition list 11-10-2014 v0.2.3: bug fix for code tag and improved pre tags to also include a CSS class 19-10-2014 v0.2.4: changed shortcuts for indent and outdent buttons, because they interfered with core Anki shortcuts in Browser 24-10-2014 v0.3.0: improved tables: selected text can now be converted to a table; added hyperlink and keyboard key buttons; improved options menu 25-10-2014 v0.3.1: bug fix with hyperlinks where it would in some cases incorrectly prepend a second http:// 27-10-2014 v0.3.2: bug fix where empty lists would be duplicated to complete field when using <code> format 28-10-2014 v0.3.3: added Unicode support to stop tables and other stuff from breaking when non-English is entered (sorry about that :), added optional alignment to tables 16-11-2014 v0.4.0: added text background color 25-11-2014 v0.4.1: add-on now remembers last used color 25-11-2014 v0.4.2: bug fixes 17-02-2015 v0.5.0: highlight colors on all platforms! (yes, it took it while) added text alignment, headings, and blockquotes 24-02-2015 v0.5.1: fixed preference handling, it will now revert to the default settings upon encountering an error; bug fix for tables where HTML (or anything in brackets) wouldn't be escaped; changed shortcut for text align center to Ctrl+Shift+Alt+B to prevent conflict with cloze deletions 24-02-2015 v0.5.2: fixed bug in path location of preference file (was hard-coded) 22-05-2015 v0.6.0: enhanced types of ordered list, added <abbr> tag, added About dialog, cleaned up preferences, refactored code 26-05-2015 v0.6.1: re-enabled text highlighting on Mac OS X and Windows 29-09-2015 v0.7.0: added user-defined keybindings; added author to block quote 29-11-2015 v0.8.0: added Markdown 10-12-2015 v0.8.1: fix for assertion error when keybinding is not Unicode 21-12-2015 v0.8.2: made hyperlink functionality more liberal (will now not force http:// prefix) 06-01-2016 v0.8.3: fixed assertion-related errors 10-01-2016 v0.8.3.1-0.8.3.5: minor bug fixes 02-02-2016 v0.8.6.2: added way to change position of button bar; fixed Markdown issues 05-02-2016 v0.8.6.3: fix for error in Windows where username is not ASCII 09-02-2016 v0.8.6.4: fix for backwards compatibility with older versions of Anki 12-08-2016 v0.8.6.5: fix for fixed ordered list error 13-10-2016 v0.8.8.0: made Markdown optional, allow editing of rendered Markdown, added option for tables with optional styling 22-10-2016 v0.8.8.1: workaround for deletion of font-weight attribute in first span by Anki 26-01-2017 v0.8.8.3: added option to use user CSS for styling code blocks; miscellaneous bug fixes and improvements 13-05-2017 v0.8.8.4: performance and stability improvements for Markdown 21-08-2017 v0.8.9.0: edit keyboard shortcuts from within Anki

Download

As add-ons are programs downloaded from the internet, they are potentially malicious. You should only download add-ons you trust.

To download this add-on, please copy and paste the following code into the desktop program:

162313389

If you were linked to this page from the internet, please open Anki on your computer, go to the Tools menu and then Add-ons>Browse & Install to paste in the code.

Other Anki 2.0.x Add-Ons Ask a Question

Reviews

on 2018-04-20
Amazing! Very useful for folks that also use Anki to memorize programming/command line facts. Thanks.
on 2018-04-09
This + image occlusion are absolutely essential for students making flashcards.
on 2018-03-24
Great addon! I'm using this now for almost every flashcard I make!
I recently updated to the newest version and now I get this message when Anki starts:

Traceback (most recent call last):
File "aqt\addons.py", line 41, in loadAddons
File "C:\Users\User\AppData\Roaming\Anki2\addons\Supplementary Buttons Anki.py", line 2, in <module>
import extra_buttons.extra_buttons
ImportError: No module named extra_buttons

Could anybody please tell me what's the problem and how to solve it?
on 2018-03-07
Really excellent addon! I appreciate the time you took to make this.
on 2018-03-03
Thank you very much.
on 2018-03-02
At least half of these buttons should be in standard Anki editor (lists, simple table creation). Impatiently waiting port for Anki 2.1
on 2018-02-04
Invalid code !!!
on 2018-01-17
Loved this format pack!!
...but....
I can't use it anymore :(

would be cool if you could update it for Anki 2.1??

thanks for the hard work!
on 2018-01-15
love the control man ! <3
on 2018-01-14
I like that footnotes are supported but they leave behind broken links. Fortunately I found a nice workaround to clean them up. Just put this code into your card's stylesheet. It disables the superscript link and hides the return arrow.

.footnote-backref {
display: none;
}

.footnote-ref {
pointer-events: none;
cursor: default;
}
on 2018-01-07
Best Anki addon - eagerly awaiting its availability for 2.1
on 2017-12-05
i'd like to try it
on 2017-11-11
Great Add-on

PLEASE, I REQUEST THIS ADD-ON TO BE DEVELOPPED FOR ANKI 2.1, TOO.:)
on 2017-09-29
Mobile

Great on the computer for formatting, my only issue is that it becomes wonky-looking with the iOS app
on 2017-08-16
"Code format text" destroys content

Anyone else have this problem with 8.8.4? I selected a small area of text, applied the Code format text option and found that the text below the selection was removed from the text area and added as a window label (in the same type of area where 'Front' and 'Back' are located - the remaining text was added as a gigantic label after the text entry area where I made the change). This label was of course uneditable, and in fact, the text was lost.
on 2017-08-15
Almost

I give this four stars because its the best option I've seen for bullet points, but the shortcut hint on Anki for indenting does not perform its function—it instead flips over to your decks. Please fix.
on 2017-07-16
Broken by design

Might be cool but broken by design. This plugin converts your Markdown into HTML and stores it in the database. Then after, if you want to edit your card, plugin _parses_ HTML back to Markdown. What's more important, if later you'll want to export your cards and use them somewhere else, you'll get *surprise, surprise* ugliest HTML code.
on 2017-07-09
Brilliant Add-on! Video tutorial below.

Across all of the dozens of add-ons I have installed this is the one I probably use the most. Having the ability to create lists, tables, and any other type of formatting you can think of with a simple button-press is an incredible time-saver.

The add-on is documented very well, but I know that some people prefer video tutorials. For that reason I've recorded a quick instructional video that goes over the most important aspects of the add-on. I hope it's OK if I share it here:

https://www.youtube.com/watch?v=e6HMD32hngQ
on 2017-07-06
A bit hard to start, but then awesome tool!

Took me a while to learn how to use it. However now, I can't imaging using Anki without it.
on 2017-06-15
What a massive accomplishment! Infinitely useful, tons of tools.

The negative feedback below is just a handful of ignorant and spoiled. They have no idea of the time, effort and skill required to make such a wonderful piece of software like this.

Thank you very much for the wonderful job!
on 2017-06-11
Adding extra rows/columns

Was looking for something to create tables and this is pretty much perfect. Thanks so much!
One question: If I add a table and then regret the number of rows/columns, is it possible to delete or add extra rows/columns after having made the table? Maybe I'm missing something, but I have to delete the entire table and make it from new.
on 2017-06-01
For those who said there is no markdown button:

Read the content please.
"Markdown is disabled by default, to keep this add-on as modularised as possible. To enable it, go to settings and tick the checkbox next to "Markdown". Restart Anki to complete the process."
on 2017-05-30
Amazing and Essential Add-on

I can't use Anki without this add-on. The only drawback I see is how the pygments used is ancient and hasn't been updated since forever.
on 2017-04-29
Thank you!

It's very useful , thank you author.
on 2017-04-28
Absolutely Terrific.

Sometimes you come across a great piece of software, that solves a problem fast and dirty. This is just it - I got code inside my Anki cards in seconds. Thank you!
on 2017-04-25
Almost too many features.

I said "almost", because each has their use, it's just I don't require that use in every instance. Still a little overwhelming.

My only caveat is that bullet points can't be centered, so they have to left-aligned, and this is incredibly frustrating as they're my most-used feature. Any chance of changing this?
on 2017-03-31
Should be Standard

This should be built into Anki.
on 2017-03-17
Hackish Crap

All I want is a way to have cards with formatted C code. This is an inelegant and hackish pos that ended up corrupting some of my cards. Lame.
on 2017-02-14
Native Integration

Adds a great deal of functionality to Anki. I think the Power Pack should become native to the application and integrated as part of the software instead of as an add-on.
on 2016-10-23
Best tables addon out there

I made a feature request on GitHub. A few hours later, the guy gave me a snippet of code to paste into cards -> style, and voila, my need to have automatically minimal-sized tables was solved!

table {
width: auto !important;
}

Hero.

BTW: my cloze -> cards -> style looks like this:

.card {
font-family: arial;
font-size:21px;
color: black;
background-color: white;
text-align: left;
margin-left: 10%;
margin-right: 10%;
}

.cloze {color: blue;}

table {
width: auto !important;
margin: 0 auto;
}

th {width: auto !important;}

table tbody tr:nth-child(2n+1) {background-color:#f2fffd;}

Looks nice and doesn't take up the whole screen with white space. Doesn't delete data like the other table addons.
on 2016-05-27
Avoid

Randomly deletes information.
on 2016-03-04
Add-on tries to do too much.

Somewhat useful, but formatting ends up taking too much time, with a risk of corrupting the note, and loosing all the content.
on 2016-02-21
Seems a solid plugin for Markdown, works great with my theme!

I was a little hesitant to use this plugin at first, but I think it's really going to speed up my workflow. Currently use highlight.js in my Anki theme, but I think this will compliment it nicely:

https://github.com/badlydrawnrob/anki

Not super keen on the injected spans, but Pygments might be worth a look to include as an extra option (highlight.js is buggy on Desktop). The way the Markdown works is brilliant, I thought it mightn't save HTML properly without the plugin installed — but your checksum comment method works like a charm. The HTML is far cleaner than Anki's using Markdown too, so that's a big bonus!
on 2016-02-12
completely usefull add on

works as it promised
when i updated anki to latest version the problem resolved.
special thanks to programmer.
on 2016-01-26
Works well, Slows down editing

Works as promised and adds extreme functionality to making high quality cards. but it really slow down opening/closing the editor. For ex when reviewing if i need to make a quick card edit, opening the editor takes just a second longer than normal and switching fields freezes anki for about a second. Nothing dramatic, but noticeable and got annoying enough for me to uninstall :/
on 2016-01-18
Great

Thx man it's fabulous.
on 2015-09-24
Markdown Support

It would be awesome to have markdown based formatting instead of buttons(/or keyboard shortcuts). Anyway, this is a must have add-on.
on 2015-09-01
end the code status

It's a pity.I can start up the code environment via the "ctrl+,""ctrl+.",but who can tell me how to end the code environment to write a normal text.
on 2015-08-07
I Love This Add-On

This was already one of my favorite add-ons, but now that I can configure ordered list to format however I want; I wish I could put a sixth start. Only wish I have would be the ability to easily change table column widths or even to have an auto-width feature that shrinks columns with few characters to make room for those with many. Still this is definitely in the top 2 add-ons for me.
on 2015-07-24
Great!

Thanks a lot for this add-on. I don't want work without it.
on 2015-07-19
amazing

So good, its almost not optional for anki users
on 2015-05-23
VERY useful!

Using this A LOT, thanks!

PLEASE, PLEASE bring back TEXT HIGHLIGHTING ...
on 2015-02-22
Start to crash when I try to Highlight, but it istill being the best formatting

Traceback (most recent call last):
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.webview", line 18, in run
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.editor", line 449, in bridge
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.editor", line 497, in mungeHTML
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/aqt.editor", line 870, in _filterHTML
File "C:\cygwin\home\dae\win\build\pyi.win32\anki\outPYZ1.pyz/BeautifulSoup", line 612, in __getitem__
KeyError: 'style'
on 2015-01-06
Must have add-on

This add-on is a must have for me. I haven't figured out yet how to change the apeareance of the code bock style (I'm not that programming savy), but outherwise, it's brilliant. Especially the keyboard stroke and diagram features do the job for me.
Excellent!
on 2014-12-08
wow, best tool ever!
it was a pain entering lists and arranging texts before, but now it has become so convenient by having the buttons which we expect to be v. essential in any text editor software (no mater how simplistic it is).
i believe this tool will significantly decrease anki's barrier of entry, thus it should become a standard part of the software!
on 2014-10-31
All of my favorite editing features in one convenient add-on

I especially like the pipe-delimited table feature -- very Wiki-esque.