{"id":13672908,"url":"https://github.com/sumnow/markdown-formatter","last_synced_at":"2025-04-28T04:30:32.412Z","repository":{"id":40718152,"uuid":"159776222","full_name":"sumnow/markdown-formatter","owner":"sumnow","description":"markdown formatter","archived":false,"fork":false,"pushed_at":"2023-06-10T01:21:32.000Z","size":2695,"stargazers_count":119,"open_issues_count":35,"forks_count":36,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-11T11:45:14.603Z","etag":null,"topics":["markdown","markdown-formatter","snippets","typescript","vscode-extension"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sumnow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-11-30T06:04:14.000Z","updated_at":"2024-10-20T01:50:40.000Z","dependencies_parsed_at":"2024-01-17T04:18:54.751Z","dependency_job_id":null,"html_url":"https://github.com/sumnow/markdown-formatter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumnow%2Fmarkdown-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumnow%2Fmarkdown-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumnow%2Fmarkdown-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumnow%2Fmarkdown-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumnow","download_url":"https://codeload.github.com/sumnow/markdown-formatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251251776,"owners_count":21559660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","markdown-formatter","snippets","typescript","vscode-extension"],"created_at":"2024-08-02T09:01:56.637Z","updated_at":"2025-04-28T04:30:31.849Z","avatar_url":"https://github.com/sumnow.png","language":"TypeScript","readme":"# markdown-formatter\n\n[中文文档](./README_CN.md)\n\n## Introduction\n\nThis 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.\n\n## Instructions\n\nAfter the installation is complete, you may need to restart your vscode.\n\nIn any `markdown` standard file with a `.md` suffix, you can use `shift+option+f`(Macos) or `ctrl+shift+f`(window) to quickly format the code. \n\n![example.gif](https://raw.githubusercontent.com/sumnow/markdown-formatter/master/images/example.gif)\n\n\u003e 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.\n\n## Feature\n\n### Ignore file format\n\nIf you want to ignore the current file ( not to be formatted ), you can insert below the code before  or after the article\n\n```code\n\u003c!-- /* md-file-format-disable */ --\u003e\n```\n\n### Snippets part\n\n**First of all, You must config like this in `settings.json`**\n\n```js\n\"[markdown]\": {\n  // auto fill\n  \"editor.quickSuggestions\": {\n    \"other\": true,\n    \"comments\": true,\n    \"strings\": true\n  },\n}\n```\n\n#### import image\n\nTyping `img` \n\n![img](./images/example-img.gif)\n\n#### import table\n\nTyping `tab` \n\n![img](./images/example-tab.gif)\n\n#### import code\n\nTyping `js` , `html` , `css` , `python` , `go` , `java` , or `code` \n\n![img](./images/example-code.gif)\n\n#### import list\n\nTyping `ul` or `ol` \n\n![img](./images/example-list.gif)\n\n### Formatter part\n\n#### symbols\n\n* For `，,。;；！、？：` add a space after these symbols; \n* `，：；！“”‘’（）？。` , unify it as a half-width character(Optional); \n* `.!?` add a space after these symbols, if before uppercase letters or chinese; \n* Supports converting Chinese symbols into full-width symbols according to context, or converting English into half-width symbols; \n* a space before and after the back-quote, which wrapped by back-quote will not be formatted; \n\n#### line\n\n* Empty a line for the title; \n* Empty a line for the code block; \n* The table is aligned automatically; \n* Empty a line for the link block; \n* erase duplicated line; \n\n#### table\n\n![alt](./images/example-tab_format.gif)\n\n#### list\n\n##### unordered list\n\n``` markdown\n\n* TITLE\n  + Title\n    - title\n\n```\n\n![alt](./images/example-list_format.gif)\n\n\n#### code\n\nFormat the code, by `js-beautify` tool, currently only the `javascript` , `html` and `css` language; \n\n##### code block\n\n```lang\nfunction sayHello() {console.log('hello')}\n```\n\n1. If `lang` is `js` or `javascript` or empty, it will be formatted according to js syntax.\n2. If `lang` is `html` , it will be formatted according to html syntax.\n3. If `lang` is `css` , it will be formatted according to css syntax.\n4. If you don't use `js` usually, You can disable code block or code area autoformat code by setting the parameter `formatOpt` to false.\n\n\u003e The js formatting rules can be configured in `settings.json` .\n\n\u003e 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.\n\n##### code area\n\nThe 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.\n\n![img](./images/example-code_area.gif)\n\n**Tips: Empty lines in the code area cannot exceed one line.**\n\n\n## Config\n\n```js\n{\n  // 是否启用格式化\n  \"markdownFormatter.enable\": true,\n  // 将配置里的全角符号转化为半角符号, 例如 `，：；！“”‘’（）？。` \n  // 当设置为 '_' 或者 '' 的时候, 不转换符号\n  // 当设置为 'auto' 的时候, 自动根据上下文转换符号\n  \"markdownFormatter.fullWidthTurnHalfWidth\": \"auto\",\n  // 转换代码块为代码区，默认为''（空字符）,不转换\n  // 可以设置为任意合法英文\n  // 只有设置成js或者javascript，才会按照js语言语法格式化\n  \"markdownFormatter.codeAreaToBlock\": '',\n  // 是否格式化代码\n  // false: 不格式化代码\n  \"markdownFormatter.formatCodes\" : true,\n  // 配置js-beautify\n  // {}: beautifyjs的配置设置\n  // 配置 `js-beautify` , 可以参考[这里](https://github.com/beautify-web/js-beautify)\n  \"markdownFormatter.formatOpt\": {},\n  // 格式化无序列表的符号 \n  \"markdownFormatter.formatULSymbol\": true,\n  // * \u003e + \u003e -\n  \"markdownFormatter.formatULSymbolOpt\": {'tag': [\"*\", \"+\", \"-\"]},\n  // 各种符号后是否需要空格\n  \"markdownFormatter.spaceAfterFullWidthOrHalfWidth\": 'half',\n  // 在文件首部显示时间\n  \"markdownFormatter.displayTime\" : false,\n  // 是否格式化表格\n  \"markdownFormatter.formatTable\" : false,\n  // 代表中文是英文的二倍宽度,用于表格对齐\n  \"markdownFormatter.formatTableOpt\" : {'chineseCharterWidth': 2},\n}\n```\n\nHow to config `beautifyjs` , you can click[here](https://github.com/beautify-web/js-beautify)\n\n### configuration example\n\nYou can refer to my configuration:\n\n```js\n// settings.json\n// markdown-formatter conf\n// Convert the code area of unnamed language into code block according to js type\n// \"markdownFormatter.codeAreaToBlock\": \"js\",\n// or not\n\"markdownFormatter.codeAreaToBlock\": \"\",\n// format punctuation automatically\n\"markdownFormatter.fullWidthTurnHalfWidth\": \"auto\",\n// Chinese punctuation formatted to English\n// \"markdownFormatter.fullWidthTurnHalfWidth\": \"，：；！“”‘’（）？。\",\n\"markdownFormatter.formatOpt\": {\n  \"indent_size\": 2\n},\n\n\"markdownFormatter.formatULSymbol\": true,\n\"markdownFormatter.formatULSymbolOpt\": {'tag': [\"*\", \"+\", \"-\"]},\n\"markdownFormatter.formatTable\" : true,\n// if you use 2-width chinese font, otherwise not set\n\"markdownFormatter.formatTableOpt\" : {'chineseCharterWidth': 2},\n\n\"[markdown]\": {\n  // auto save\n  \"editor.formatOnSave\": false,\n  // show space\n  \"editor.renderWhitespace\": \"all\",\n  // \n  \"editor.quickSuggestions\": {\n    \"other\": true,\n    \"comments\": true,\n    \"strings\": true\n  },\n  // \n  \"editor.snippetSuggestions\": \"top\",\n  \"editor.tabCompletion\": \"on\",\n  // \n  \"editor.acceptSuggestionOnEnter\": \"on\",\n  // \n  \"editor.defaultFormatter\": \"mervin.markdown-formatter\"\n}\n```\n\n\n## Software version and development environment\n\n#### develop version\n\nVSCode version 1.29.1 (macOS Mojave)\n\n#### test version\n\nVSCode version 1.33.1 (macOS Mojave)\n\n## Contact\n\nIf you have any ideas, please contact me.\n\nIf you know how to format other languages using front-end libraries, please let me know.\n\nemail: mydiamervin@gmail.com  or [here](https://github.com/sumnow/markdown-formatter/issues)\n\n\n## Gratitude\n\nThank you for helping me improve this tool.\n\n* [whidy](https://github.com/whidy)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/41)\n* [jackfirth](https://github.com/jackfirth)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/35)\n* [fruh](https://github.com/fruh)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/36)\n* [ddejohn](https://github.com/ddejohn)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/35)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/31)\n* [vio1etus](https://github.com/vio1etus)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/29)\n* [zybieku](https://github.com/zybieku)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/27)\n* [rowild](https://github.com/rowild)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/24)\n* [tifDev](https://github.com/tifDev)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/28)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/23)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/22)\n* [lartpang](https://github.com/lartpang)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/18)\n* [lancerXXXX](https://github.com/lancerXXXX)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/20)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/16)\n* [rgeorgiev583](https://github.com/rgeorgiev583)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/14)\n* [Ardeshir81](https://github.com/Ardeshir81)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/13)\n* [busyrat](https://github.com/busyrat) \n  + Feature(https://github.com/sumnow/markdown-formatter/issues/10)\n* [lartpang](https://github.com/lartpang) \n  + Bug(https://github.com/sumnow/markdown-formatter/issues/15)\n  + Feature(https://github.com/sumnow/markdown-formatter/issues/11)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/9)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/8)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/7)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/6)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/5)\n* [iostalks](https://github.com/iostalks)\n  + Feature(https://github.com/sumnow/markdown-formatter/issues/3)\n* [zhuoyan](https://github.com/zhuoyan)\n  + Bug(https://github.com/sumnow/markdown-formatter/issues/1)\n\n\n\u003e Sorting only according to the time of the question\n\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumnow%2Fmarkdown-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumnow%2Fmarkdown-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumnow%2Fmarkdown-formatter/lists"}