Manipulate - Zettt/km-markdown-library GitHub Wiki

These macros are for text manipulation, as the name implies.

Indent/Outdent Text

Outdent and Indent Text are written by Brett Terpstra. I asked his permission to use his Markdown Service Tools here.

Header

The header macro works in two ways based on whether a text selection exists or not.

In any case a dialog asks you how many # header characters you want to insert. This is set to ### (3) by default. Change in the macro if you prefer another number.

Below is an option that will only be used in case there was a text selection, in which case you have the possibility to also Title Case your heading, all in one fell swoop. (Off by default)

One nifty feature version 2 adds is a process that removes all # from your text selection before re-applying the new heading. This is good in case you had a heading selecting (all with #) and now you decide that the heading number needs to be increased or decreased. Beware though that this will not work on multi-line text.

Ordered List and Unordered List

First, the name: why is it List *, *, * and List 1, 2, 3 and not Unordered List? The reason is pretty simple, less brainpower required. I don't know about you, but whenever I hear unordered list I have to think for a moment that the unordered list is the one without the numbers. So I decided to go with the one that makes more sense. Think of it this way "Make a list with asterisks" or "Make a list with numbers".

Lastly Rafael Bugajewski from Juicy Cocktail helped with the ordered list macro. This macro is smart enough to number lists like this:

  1. foo
  2. bar
    1. baz
    2. foobar
  3. barbaz

and not

  1. foo
  2. bar
    1. baz
    2. foobar
  3. barbaz

Both will create the correct result once process with Markdown, but the first one is easier on the eye.