Skip to content

Markdown table style

Rubaiyat Khondaker edited this page Dec 12, 2020 · 4 revisions

Usage

Regex line: \|([^\n|]+)\|\n\|(?:[^\n|]+)\|\n\|([^\n|]+)\|\n?

  1. Create a file called test.md.
  2. Paste the following contents into the file:
| How do you use this style? |
| ---- |
| Just like this |

Of course, the script will ignore anything outside a table.

| Furthermore, the script | should also |
| ----- | ----- |
| Ignore any tables | with more than one column |

| Why might this style be useful? |
| --------- |
| It looks nice when rendered as HTML in a markdown editor. |

Obsidian Plugin users

  1. In the plugin settings, paste the Regex line into the 'Custom Regexps' field associated with 'Basic'
  2. Ensure that the 'Regex' option is checked
  3. Click the Anki icon on the ribbon to run the plugin

Python Script users

  1. Run the script, and check 'Config' to open up the config file:
    GUI
  2. Navigate to the "Custom Regexps" section
  3. Change the line
Basic =  

to

Basic = \|([^\n|]+)\|\n\|(?:[^\n|]+)\|\n\|([^\n|]+)\|\n?
  1. Save the config file
  2. Run the script on the file, with 'Regex' checked:
    GUI

All users

  1. You should see these cards in Anki:
    Table 1
    Table 2
Clone this wiki locally