Skip to content

Extended syntaxes to built-in markdown & What you see is what you get exporter.

License

Notifications You must be signed in to change notification settings

qjebbs/vscode-markdown-extended

Repository files navigation

Markdown Extended Readme

version installs

Markdown Extended is an extension extends syntaxes and abilities to VSCode built-in markdown function.

Markdown Extended includes lots of editing helpers and a what you see is what you get exporter, which means export files are consistent to what you see in markdown preview, even it contains syntaxes and styles contributed by other plugins.

Features

Post an issue on GitHub if you want other plugins.

Disable Plugins

To disable integrated plugins, put their names separated with ,:

"markdownExtended.disabledPlugins": "underline, toc"

Available names: toc, container, admonition, footnote, abbr, sup, sub, checkbox, attrs, kbd, underline, mark, deflist, emoji, multimd-table, html5-embed

Q: Why You Don't Integrate Some Plugin?

The extension works with other markdown plugin extensions (those who contribute to built-in Markdown engine) well, Both Preview and Export. Like:

The extension does not tend to do all the work, so just use them, those plugins could be deeper developed, with better experience.

Exporter

Find in command palette, or right click on an editor / workspace folder, and execute:

  • Markdown: Export to File
  • Markdown: Export Markdown to File

The export files are organized in out directory in the root of workspace folder by default.

Export Configurations

You can configure exporting for multiple documents with user settings.

Further, you can add per-file settings inside markdown to override user settings, it has the highest priority:

---
puppeteer:
    pdf:
        format: A4
        displayHeaderFooter: true
        margin:
            top: 1cm
            right: 1cm
            bottom: 1cm
            left: 1cm
    image:
        quality: 90
        fullPage: true
---
contents goes here...

See all available settings for puppeteer.pdf, and puppeteer.image

Helpers

Editing Helpers and Keys

Inspired by joshbax.mdhelper, but totally new implements.

Default Keyboard Shortcut bindings are removed due to conflict issues on platforms, please consider:

  • Switch to use command palette
  • Switch to use Snippets
  • Setup key bindings on your own
Command Keyboard Shortcut
Format: Toggle Bold Ctrl+B
Format: Toggle Italics Ctrl+I
Format: Toggle Underline Ctrl+U
Format: Toggle Mark Ctrl+M
Format: Toggle Strikethrough Alt+S
Format: Toggle Code Inline Alt+`
Format: Toggle Code Block Alt+Shift+`
Format: Toggle Block Quote Ctrl+Shift+Q
Format: Toggle Superscript Ctrl+Shift+U
Format: Toggle Subscript Ctrl+Shift+L
Format: Toggle Unordered List Ctrl+L, Ctrl+U
Format: Toggle Ordered List Ctrl+L, Ctrl+O
Table: Paste as Table Ctrl+Shift+T, Ctrl+Shift+P
Table: Format Table Ctrl+Shift+T, Ctrl+Shift+F
Table: Add Columns to Left Ctrl+Shift+T, Ctrl+Shift+L
Table: Add Columns to Right Ctrl+Shift+T, Ctrl+Shift+R
Table: Add Rows Above Ctrl+Shift+T, Ctrl+Shift+A
Table: Add Row Below Ctrl+Shift+T, Ctrl+Shift+B
Table: Move Columns Left Ctrl+Shift+T Ctrl+Shift+Left
Table: Move Columns Right Ctrl+Shift+T Ctrl+Shift+Right
Table: Delete Rows Ctrl+Shift+D, Ctrl+Shift+R
Table: Delete Columns Ctrl+Shift+D, Ctrl+Shift+C

Looking for Move Rows Up / Down?
You can use vscode built-in Move Line Up / Down, shortcuts are alt+↑ and alt+↓

Snippets

Index Prefix Context View
0 underline _under_ line under line
1 mark ==mark== ==mark==
2 subscript ~sub~script subscript
3 superscript ^super^script ^super^script
4 checkbox [] checkbox [ ] checkbox
4 tasklist - [] task [ ] tasklist
5 table Markdown Table
6 kbd <kbd>Keyboard</kbd> Keyboard
7 admonition note !!! warn
text
addmonition
8 footnote [^abc]
[^abc]: ABC
footnote
9 container markdown container
10 abbr *[ABBR]: Abbreviation abbr
11 attr **attr**{style="color:red"} attr{style="color:red"}
12 color color <font color=red>red</font> color red

Table Editing

tableEdit

moveCols

Move columns key bindings has been changed to ctrl+shift+t ctrl+shift+left/right, due to #57, #68

Paste as Markdown Table

Copy a table from Excel, Web and other applications which support the format of Comma-Separated Values (CSV), then run the command Paste as Markdown Table, you will get the markdown table.

pasteTable

Export & Copy

command

Extended Syntaxes

Admonition

Inspired by MkDocs

Nesting supported (by indent) admonition, the following shows a danger admonition nested by a note admonition.

!!! note

    This is the **note** admonition body

    !!! danger Danger Title
        This is the **danger** admonition body

admonition-demo

Removing Admonition Title

!!! danger ""
    This is the danger admonition body

admonition-demo

Supported Qualifiers

note | summary, abstract, tldr | info, todo | tip, hint | success, check, done | question, help, faq | warning, attention, caution | failure, fail, missing | danger, error, bug | example, snippet | quote, cite

See also: Python-Markdown Documentation for Admonitions

markdown-it-table-of-contents

[[TOC]]

markdown-it-footnote

Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.
[^longnote]: Here's one with multiple blocks.

Here is a footnote reference,[1] and another.[2]

markdown-it-abbr

*[HTML]: Hyper Text Markup Language
*[W3C]:  World Wide Web Consortium
The HTML specification
is maintained by the W3C.

The HTML specification is maintained by the W3C.

markdown-it-deflist

Apple
:   Pomaceous fruit of plants of the genus Malus in the family Rosaceae.
Apple
Pomaceous fruit of plants of the genus Malus in the family Rosaceae.

markdown-it-sup markdown-it-sub

29^th^, H~2~O

29th, H2O

markdown-it-checkbox

[ ] unchecked
[x] checked

unchecked checked

markdown-it-attrs

item **bold red**{style="color:red"}

item bold red

markdown-it-kbd

[[Ctrl+Esc]]

Ctrl+Esc

markdown-it-underline

_underline_

underline

markdown-it-container

::::: container
:::: row
::: col-xs-6 alert alert-success
success text
:::
::: col-xs-6 alert alert-warning
warning text
:::
::::
:::::

container-demo.png

(Rendered with style bootstrap, to see the same result, you need the follow config)

"markdown.styles": [
    "https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
]

Known Issues & Feedback

Please post and view issues on GitHub

Enjoy!

About

Extended syntaxes to built-in markdown & What you see is what you get exporter.

Resources

License

Stars

Watchers

Forks

Packages

No packages published