-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Yuval Shavit edited this page Aug 7, 2024
·
18 revisions
Tip
This page is a quick cheat-sheet for mdq's syntax.
Check out the tutorial or full user manual for more detail.
'# within some header | - look for lists | [with links]()'
^^^ ^^^
Make sure to quote the selector string, so that your shell doesn't interpret the pipes and other special characters. I recommend using '
unless you have apostrophes you need to match against.
# section title
[link text](url)
![img alt](url)
- unordered list item
1. ordered list item
- [ ] uncompleted task
- [x] completed task
- [?] any task
> block quotes
``` code-block
```language code-block
</> html
P: paragraph text
:-: table headers :-: table rows
An empty string matcher matches all elements; you can also use *
to make that explicit
unquoted text when unambiguous (must start with a letter)
matches any substring; prefix and trailing whitespace is trimmed
cAsE iNsEnSiTiVe
^☚can anchor to the start of a string...
or to the end... ☛$
^☚ or to both, for full string matching ☛$
"quoted text with \" escapes, including \u{2603} unicode"
^"☚ also supports anchors ☛"$
'matches any substring; prefix and trailing whitespace is NOT trimmed'
"Case Sensitive"
/reg(ex|ular expressions)/
/^ *\(also match substring, unless anchored\)$/
Mostly the usual, but two of note:
\u{2603} ⮕ ☃
\` ⮕ '
- unicode code points are
\u{...}
, with 1 - 6 hex digits - you can get a single quote (
'
) by escaping a backtick. Note that this nonstandard: an escaped backtick translates to a straight single-quote. See the full manual for the rationale.
-o json