-
Notifications
You must be signed in to change notification settings - Fork 1
/
ankiweb.html
55 lines (44 loc) · 4.95 KB
/
ankiweb.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<b># Use</b>
The shortcut (default is "Ctrl+0") to insert a table and some styling defaults can be configured using the new configuration dialogue of 2.1: Tools>Add-ons, select the add-on and click on "Config".
You can insert a table in two ways:
1. If you do not select any text, upon clicking the "Create a table button" (or pressing the shortcut) you will be presented with a dialog window asking you to specify some table properties (like number of rows, number of columns, alignment, styling). The dialog to insert tables looks like this:
<img src="https://raw.githubusercontent.com/ijgnd/anki21__PFP_table/master/screenshots/options.png">
2. If you have text selected you can usually convert a table (in a markdown-like format) into a full html table.
<code>header1 | header2</code>
<code>-|-</code>
<code>elem1 | elem2</code>
These will create a list with two columns and two rows. The <code>-|-</code> part is optional, but can be used to align the column to the left (<code>:-</code>), right (<code>-:</code>) or to the center (<code>:-:</code>). You can skip this line completely, but do make sure you add a pipe character | between elements to designate a border.
Limitations:
- This method is intended for one time use only. The original md-table is not saved so it can't be undone later. If you care about undoing use one of the markdown add-ons.
- The code in my add-on for transforming markdown tables is simple so that it doesn't convert all valid markdown tables. So it will fail sometimes. A fix for this is already on my todo list but it will take some time until this add-on is updated.
<b>Use the add-on at your own risk.</b>
<img src="https://user-images.githubusercontent.com/40218852/52268806-b13f4100-293c-11e9-8265-21a6b26add23.gif">
<img src="https://user-images.githubusercontent.com/40218852/52268914-f2cfec00-293c-11e9-8508-43d052c1dbab.gif">
<b># other relevant add-ons</b>
For editing tables there's the add-on <a href="https://ankiweb.net/shared/info/805891399" rel="nofollow">extended (table) editor</a>.
If you want to replace the PowerFormatPack in 2.1 you might also be interested in these add-ons:
- <a href="https://ankiweb.net/shared/info/295889520" rel="nofollow">Mini Format Pack</a>
- <a href="https://ankiweb.net/shared/info/1463041493" rel="nofollow">Syntax Highlighting for Code</a>
- <a href="https://ankiweb.net/shared/info/318752047" rel="nofollow">Add Hyperlink</a>
- <a href="https://ankiweb.net/shared/info/1030875226" rel="nofollow">Auto Markdown - convert Markdown to HTML</a>
- <a href="https://ankiweb.net/shared/info/476705431" rel="nofollow">Mini Format Pack Supplementary</a>
<b># Update notice</b>
- For styling the table versions after the update from 2020-07-24 now use "table_style_css_V<i>4</i>". Prior versions of this add-on used the config keys "table_style_css", "table_style_css_V2" or "table_style_css_V3". If you had modified one of these you'll have to copy over your changes to "table_style_css_V<i>4</i>". "V4" was introduced to better deal with Anki's night mode.
- This add-on does not delete your old customized config. The latest version just ignores the config keys "table_style_css", "table_style_css_V2" or "table_style_css_V3".
<b># Versions</b>
- 2020-07-24 better night mode compatibility, re-organized the code.
- 2020-04-27 classes for all defaults, better naming
- 2020-04-23 config.schema.json, function gc is more robust
- 2019-11-06 option to center table, fix for one line selection
- 2019-20-20 interoperability
- 2019-10-08 2.1 only, gui option for vertical alignment, set alignment in style, code cleanup
- 2019-02-24 Fix for UnicodeEncodeError in Anki 2.0 by khonkhortisan
- 2019-01-24 handle leading/trailing pipes and escaped pipes, fix shortcut for 2.0
- 2018-11-19 additional options in table creation dialog
- 2018-11-03 initial release
<b># Credits</b>
This add-on and parts of this description are a partial fork of the great add-on <a href="https://ankiweb.net/shared/info/162313389" rel="nofollow">Power Format Pack</a> (Copyright 2014-2017 Stefan van den Akker) because it won't be ported to 2.1 (as of 2018-11). I extracted the table function into a standalone version for 2.1 and in the latest version made some additions so that you can better customize the table inserted. All the good stuff in this add-on is from Stefan van den Akker.
<b># limitations, known bugs</b>
Short selections of text, mostly if the last line doesn't contain real content but just empty fields (like '|| |') usually gives unexpected/wrong results.
<b># bugs, errors, feedback</b>
Please do not use reviews for bug reports or support requests. I don't get notified of your reviews, and properly troubleshooting an issue through them is nearly impossible (formatting is limited and I can't reply multiple times). If you find a bug let me know <a href="https://forums.ankiweb.net/t/add-table-official-thread/543" rel="nofollow">in the official anki support forum</a>, on <a href="https://github.com/ijgnd/anki__editor_add_table/issues" rel="nofollow">github</a>.