All Projects → sumnow → Markdown Formatter

sumnow / Markdown Formatter

markdown formatter

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Markdown Formatter

Vscode Markdownlint
Markdown linting and style checking for Visual Studio Code
Stars: ✭ 444 (+534.29%)
Mutual labels:  markdown, vscode-extension
Mdmath
LaTeX Math for Markdown inside of Visual Studio Code.
Stars: ✭ 675 (+864.29%)
Mutual labels:  markdown, vscode-extension
Vscode R
R Extension for Visual Studio Code (execution, snippet, lint, R documantation, R Markdown)
Stars: ✭ 445 (+535.71%)
Mutual labels:  vscode-extension, snippets
Vscode Es7 Javascript React Snippets
Extension for Javascript/React snippets with search supporting ES7 and babel features
Stars: ✭ 435 (+521.43%)
Mutual labels:  vscode-extension, snippets
Vscode Smarty
Smarty syntax highlight extension for Visual Studio Code
Stars: ✭ 10 (-85.71%)
Mutual labels:  vscode-extension, snippets
Marp Vscode
Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
Stars: ✭ 442 (+531.43%)
Mutual labels:  markdown, vscode-extension
Vscode Markdown Pdf
Markdown converter for Visual Studio Code
Stars: ✭ 571 (+715.71%)
Mutual labels:  markdown, vscode-extension
vscode-fortran-support
Fortran language support for Visual Studio Code
Stars: ✭ 49 (-30%)
Mutual labels:  snippets, vscode-extension
Vscode Unity Code Snippets
All snippets for Unity3D development
Stars: ✭ 26 (-62.86%)
Mutual labels:  vscode-extension, snippets
Vscode Badges
Snippets to quickly insert Shield.io badges into HTML, Markdown, reStructuredText or Textile documents
Stars: ✭ 19 (-72.86%)
Mutual labels:  vscode-extension, snippets
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+271.43%)
Mutual labels:  markdown, vscode-extension
Vue Vscode Snippets
These snippets were built to supercharge my workflow in the most seamless manner possible.
Stars: ✭ 1,083 (+1447.14%)
Mutual labels:  vscode-extension, snippets
vscode-gleam
📟 Gleam support for VS Code
Stars: ✭ 34 (-51.43%)
Mutual labels:  snippets, vscode-extension
Gistpad
VS Code extension for managing and sharing code snippets, notes and interactive samples using GitHub Gists
Stars: ✭ 443 (+532.86%)
Mutual labels:  markdown, vscode-extension
vscode-django
Beautiful syntax and snippets for perfectionists with deadlines
Stars: ✭ 113 (+61.43%)
Mutual labels:  snippets, vscode-extension
Vscode Angular Snippets
Angular Snippets for VS Code
Stars: ✭ 530 (+657.14%)
Mutual labels:  vscode-extension, snippets
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (+1017.14%)
Mutual labels:  snippets, vscode-extension
vue-snippets
Visual Studio Code Syntax Highlighting For Vue3 And Vue2
Stars: ✭ 25 (-64.29%)
Mutual labels:  snippets, vscode-extension
Vscode Markdown Preview Enhanced
One of the "BEST" markdown preview extensions for Visual Studio Code
Stars: ✭ 701 (+901.43%)
Mutual labels:  markdown, vscode-extension
Markdowntableprettify Vscodeext
Visual Studio Code extension to prettify markdown tables.
Stars: ✭ 27 (-61.43%)
Mutual labels:  markdown, vscode-extension

markdown-formatter

中文文档

Introduction

This is a tool to improve the writing efficiency of markdown, not only provides a relatively uniform format for the markdown user, but also provides some snippets.

Instructions

After the installation is complete, you may need to restart your vscode.

In any markdown standard file with a .md suffix, you can use shift+option+f(osx) or ctrl+shift+f(window) to quickly format the code.

example.gif

PS: It does not fix your markdown syntax errors. for example, there is no space after # as a title, because in the code # is a usable character that is widely used as a comment or variable declaration.

Feature

Snippets part

First of all, You must config like this in settings.json

"[markdown]": {
  // 快速补全
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
}

import image

Typing img

img

import table

Typing tab

img

import code

Typing js , html , css , python , go , java , or code

img

import list

Typing ul or ol

img

Formatter part

symbols

  • For ,,。;;!、?: add a space after these symbols;
  • ,:;!“”‘’()?。 , unify it as a half-width character(Optional);
  • .!? add a space after these symbols, if before uppercases or chineses;
  • Supports converting Chinese symbols into full-width symbols according to context, or converting English into half-width symbols;
  • a space before and after the back-quote, which wrapped by back-quote will not be formatted;

line

  • Empty a line for the title;
  • Empty a line for the code block;
  • The table is aligned automatically;
  • Empty a line for the link block;
  • erase dulicated line;

table

alt

list

unordered list

* TITLE
  + Title
    - title

alt

code

Format the code, by js-beautify tool, currently only the javascript , html and css language;

code block
function sayHello() {console.log('hello')}
  1. If lang is js or javascript or empty, it will be formatted according to js syntax.
  2. If lang is html , it will be formatted according to html syntax.
  3. If lang is css , it will be formatted according to css syntax.
  4. If you don't use js usually, You can disable code block or code area autoformat code by setting the parameter formatOpt to false.

The js formatting rules can be configured in settings.json .

Code blocks can clearly mark the type of language, so it is recommended to use code blocks, you can configure codeAreaToBlock to set the conversion method.

code area

The default is not formatted. If codeAreaToBlock is any language name, such as js or go, it will be converted into a code block and then formatted.

img

Tips: Empty lines in the code area cannot exceed one line.

Config

// enable/disable markdown-formatter
enable = config.get <boolean> ('enable', true); 
// fullwidth character translate into halfwidth character, such as `,:;!“”‘’()?。`
// Automatically convert symbols based on context when set to 'auto'
// Don't convert symbols based on context when set to '_' or ''
fullWidthTurnHalfWidth = config.get<string>('fullWidthTurnHalfWidth', 'auto');
// Convert code block to code area, and the default is not converted. 
// You can set it by any meaningful strings
// if it is set to js, it will be formatted according to the js language syntax.
codeAreaToBlock = config.get<string>('codeAreaToBlock', '');
// enable/disable format code
// false: disable format code
formatCodes = config.get<boolean>('formatCodes', true);
// config beautifyjs
// {}: config beautifyjs
formatOpt = config.get<any> ('formatOpt', {}); 
// Format the symbols of the unordered list
// * > + > -
formatULSymbol = config.get<boolean>('formatULSymbol', true);
// Whether a space is required after the full-width or half-width symbol
spaceAfterFullWidthOrHalfWidth = config.get<string>('spaceAfterFullWidthOrHalfWidth', 'half');

How to config beautifyjs , you can clickhere

configuration example

You can refer to my configuration:

// settings.json
// markdown-formatter conf
// Convert the code area of unnamed language into code block according to js type
// "markdownFormatter.codeAreaToBlock": "js",
// or not
"markdownFormatter.codeAreaToBlock": "",
// format punctuation automatically
"markdownFormatter.fullWidthTurnHalfWidth": "auto",
// Chinese punctuation formatted to English
// "markdownFormatter.fullWidthTurnHalfWidth": ",:;!“”‘’()?。",
"markdownFormatter.formatOpt": {
  "indent_size": 2
},
"[markdown]": {
  // auto save
  "editor.formatOnSave": false,
  // show space
  "editor.renderWhitespace": "all",
  // 
  "editor.quickSuggestions": {
    "other": true,
    "comments": true,
    "strings": true
  },
  // 
  "editor.snippetSuggestions": "top",
  "editor.tabCompletion": "on",
  // 
  "editor.acceptSuggestionOnEnter": "on",
  // 
  "editor.defaultFormatter": "mervin.markdown-formatter"
}

Software version and development environment

develop version

VSCode version 1.29.1 (macOS Mojave)

test version

VSCode version 1.33.1 (macOS Mojave)

Contact

If you have any ideas, please contact me.

If you know how to format other languages using front-end libraries, please let me know.

email: [email protected] or here

Gratitude

Thank you for helping me improve this tool.

Sorting only according to the time of the question

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].