Git Product home page Git Product logo

vscode-remark's Introduction

remark for Visual Studio Code

Build Downloads Sponsors Backers Chat

Visual Studio Code extension to format and lint markdown files with remark.

Contents

What is this?

This project is a Visual Studio Code (VS Code) extension that you can use in your editor to inspect and change markdown files. This extension is built around remark, which is a very popular ecosystem of plugins that work with markdown. You can choose from the 150+ plugins that already exist or make your own.

See remark for info on what the remark ecosystem is.

When should I use this?

You can use this extension if you want to check (lint) and format markdown files from within your editor.

To configure this extension, you define your preferred markdown style in a configuration file (.remarkrc, .remarkrc.js, etc. or in package.json). This file is picked up by vscode-remark and other tools (useful for contributors that don’t use VS Code).

The configuration file is also used by remark-cli, which is recommended to be used alongside vscode-remark, as an npm script and/or in CI, to enforce the markdown style.

Install

Get it on the VS Code Marketplace or install it by using Quick Open (Ctrl + P) and running the following:

ext install unifiedjs.vscode-remark

Use

To use this extension, set up remark-cli like you normally would in your project with a configuration file. The extension will find the configuration in your workspace just like running remark-cli in your terminal would. You will be able to see your linter work as you type and you can format your code if you want it to.

Now, you can open markdown files in your project, and you’ll see squiggly lines and warnings in the Problems pane if the code doesn’t adhere to the coding standards. Here’s an example that should produce problems you can use to verify:

1) Hello, _Jupiter_ and *Neptune*!

Configuration file

remark-language-server uses the same configuration files as remark-cli. These files are:

  • .remarkrc
  • .remarkrc.cjs
  • .remarkrc.js
  • .remarkrc.json
  • .remarkrc.mjs
  • .remarkrc.yaml
  • .remarkrc.yml
  • package.json

Language clients should notify the language server if these files change. They are looked up starting at the folder where the checked markdown file exists.

Settings

This extension supports the following settings:

  • remark.requireConfig (boolean, default: false) — If true, only perform actions if a configuration file is found.

Formatting

This extension can format markdown files.

To format a file, pull up the command pallete (Ctrl + Shift + P), choose Format Document With…, and select remark.

To make vscode-remark the default formatter for markdown, add the following to your settings.json (which you can open with Ctrl + ,):

{
  "[markdown]": {
    "editor.defaultFormatter": "unifiedjs.vscode-remark"
  }
}

Now markdown documents can be formatted using Ctrl + Shift + I.

You can optionally choose to automatically format when saving with editor.formatOnSave:

{
  "[markdown]": {
    "editor.defaultFormatter": "unifiedjs.vscode-remark",
    "editor.formatOnSave": true
  }
}

Plugins

The remark ecosystem has a variety of plugins available. Most notably you’ll want to check out remark-lint. See this curated list of plugins for more remark plugins.

Compatibility

This extension is compatible with Visual Studio Code versions 1.67.0 and greater.

Security

This plugin loads configuration files, plugins, and presets from your workspace. Only use this plugin in workspaces you trust.

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help. Join us in Discussions to chat with the community and contributors.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Denis Malinochkin

vscode-remark's People

Contributors

asbjornu avatar christianmurphy avatar jounqin avatar mrmlnc avatar remcohaszing avatar renovate-bot avatar renovate[bot] avatar sagebind avatar tengattack avatar wooorm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-remark's Issues

[macOS] VSCode terminal throwing an error after choosing `remark: beautify markdown code`

VSCode 1.8.1
macOS 10.12.2

[Remark]
TypeError: Cannot read property 'length' of undefined

DevConsole

Illegal value for `line`: Error: Illegal value for `line`
    at t.lineAt (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:11:2702)
    at Object.lineAt (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:11:1706)
    at GuidesController.updateSelection (/.vscode/extensions/spywhere.guides-0.6.1/out/extension.js:41:51)
    at e.invoke (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:4:31992)
    at e.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:5:8945)
    at t.$acceptSelectionsChanged (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:11:7501)
    at t.e.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:10:4203)
    at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:7:11178)
    at p (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:7:11855)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)e.onUnexpectedError @ shell.ts:541(anonymous function) @ shell.ts:457e.onUnexpectedError @ errors.ts:68o @ errors.ts:88t.onUnexpectedExtHostError @ mainThreadErrors.ts:13e.handle @ abstractThreadService.ts:34s @ ipcRemoteCom.ts:269f @ ipcRemoteCom.ts:226_combinedTickCallback @ internal/process/next_tick.js:67_tickCallback @ internal/process/next_tick.js:98

Automatically merge dependency updates

Subject of the feature

With the tests we now have I feel fairly confident about having dependency updates by Renovate automatically merged if the tests are successful. I don't know Renovate, but if it doesn't have this feature, we can use Mergify to both review and merge pull requests from Renovate.

Problem

It requires quite a bit of manual labour to go through pull requests from Renovate, review them and merge them, then wait for the next PR to be rebased and then review and merge that as well, and so on. It would be great if this could be automated.

Expected behavior

I expect dependency updates to be automatically merged if the tests are successful.

Add Release Drafter

Subject of the feature

With Release Drafter, creating GitHub releases becomes mostly automatic.

Problem

It requires quite a bit of manual labour to create release notes. Release Drafter automates most of this labour, making the creation of new releases much easier.

Expected behavior

The creation of releases should not be a tiresome, manual ordeal.

Alternatives

GitReleaseManager is an option, but it's more heavy-handed than Release Drafter. There exists a lot of other alternatives as well, but I have not familiarized myself with them.

Vfile API incomplete

Initial checklist

Affected packages and versions

v1.2.1

Link to runnable example

No response

Steps to reproduce

Use the remark-code-import plugin

Expected behavior

remark-code-import runs and imports code into formatted document

Actual behavior

When using the plugin
"TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined"
is printed on the output console.

The problem looks to be that the vFile API is only partially implemented on in the object passed to the transformer. remark-code-import uses https://github.com/vfile/vfile#filedirname to get a relative path to the files its importing from.

When I checked the keys on the object passed as the vFile when running in this plugin i saw that only a handful of the keys were present. Would it possible to add the full vFile API to the object passed to the transformer?

Runtime

Electron

Package manager

npm 8

OS

Windows

Build and bundle tools

No response

Add support for previewing markdown

Initial checklist

Problem

The VSCode markdown previewer uses markdown-it, which does not support GFM, and does not support (of course) the used remark plugins.

Solution

Something like https://github.com/shd101wyy/mume probably, around unified.

It’s only really useful when the output is HTML, so for remark, we should probably find a .remarkrc and inject remark-rehype, rehype-etc afterwards?

Is it one underlying project that supports Atom, VS Code, and other editors, and supports either remark or rehype? Or should there be separate projects for remark and rehype too? Or?

What about MDX?
CSS?

Alternatives

n/a


/cc @voxpelli

Verify Unified.js as a publisher

Initial checklist

Problem

Visual Studio Code extensions can publishers can become a a varified published to verfying the ownership of the registered domain name. This requires access to both the Visual Studio Marketplace management page and the DNS settings for the domain (unifiedjs.com).

Being a verified publisher signals users the extension is officially published by Unified.

Instructions can be found here

Solution

Verify Unified.js as a publisher.

Alternatives

Don’t verify Unified.js as a publisher 🤷

remark config is ignored when formatting

Initial checklist

Affected packages and versions

vscode-remark v2.1.0

Link to runnable example

No response

Steps to reproduce

  1. Create following package.json file and run pnpm install (or npm install):

package.json

{
	"devDependencies": {
		"remark": "^14.0.2",
		"remark-cli": "^11.0.0",
		"remark-preset-lint-markdown-style-guide": "^5.1.2"
	},
	"remarkConfig": {
		"plugins": [
			"remark-preset-lint-markdown-style-guide"
		]
	}
}
  1. Create any markdown file e.g.

test.md

- item 1
-  item 2
  1. Run VSCode command 'Format Document', or 'Format Document...' (if present) and select 'remark' to format a markdown file.

Expected behavior

test.md should be formatted using configured options, resulting:

- item 1
- item 2

Actual behavior

test.md is formatted using remark's default options, resulting:

*   item 1
*   item 2

...and VSCode shows following warnings (which are parts of remark-preset-lint-markdown-style-guide):

Marker style should be `-` remark-lint(unordered-list-marker-style)
Incorrect list-item indent: remove 2 spaces remark-lint(list-item-indent)

This means vscode-remark recognises remarkConfig but ignores them when formatting.

The same thing happens with .remarkrc (etc.) file.

I'm not sure if this is a bug or a missing feature, but I think the formatting feature meant be configurable regarding to #13.

Runtime

Node v16

Package manager

pnpm

OS

Windows

Build and bundle tools

No response

Don't convert html entities

Hi there,

Great plugin! One little gripe I've had with it is that it currently converts (most) html entities to the actual character when it runs into them. Is there any way to avoid this? If not, could this potentially be added?

Thanks in advance!

Use no-code VSCode integration

Initial checklist

Problem

Currently we need a bunch of boilerplate code to create a client for integrating remark-language-server into this extension. This adds ~350kB of minified JavaScript.

Solution

I created feature request microsoft/vscode#158076 upstream. If it gets accepted (needs 20 👍 votes) and implemented, we can remove the client code entirely.

Alternatives

If the upstream doesn’t get accepted, we should just close this issue.

Use globally installed `remark` package when no local dependencies

Initial checklist

Problem

Not all of my repositories are developed with Node.js, and I don't like to have package.json and node-modules wherever I have markdown files.

Solution

I would suggest using globally installed remark package when no local dependencies is in local directory.

It would be even better if you install it in the plugin's data folder.

Alternatives

I have no more ideas.

Local config isn't loading

Initial checklist

Affected packages and versions

1.3.0

Link to runnable example

No response

Steps to reproduce

After running the command Remark: Beautify markdown code got error. Also, highlighting errors in the editor does not work. It is worth noting that npm run lint:md works as it should.

package.json
{
  "scripts": {
    "lint:md": "remark ./src"
  },
  "devDependencies": {
    "remark-cli": "^10.0.0",
    "remark-frontmatter": "^3.0.0",
    "remark-lint": "^8.0.0",
    "remark-lint-blockquote-indentation": "^2.0.1",
    "remark-lint-code-block-style": "^2.0.1",
    "remark-lint-definition-spacing": "^2.0.1",
    "remark-lint-emphasis-marker": "^2.0.1",
    "remark-lint-fenced-code-flag": "^2.0.1",
    "remark-lint-fenced-code-marker": "^2.0.1",
    "remark-lint-file-extension": "^1.0.5",
    "remark-lint-final-newline": "^1.0.5",
    "remark-lint-first-heading-level": "^2.0.1",
    "remark-lint-heading-increment": "^2.0.1",
    "remark-lint-heading-style": "^2.0.1",
    "remark-lint-link-title-style": "^2.0.1",
    "remark-lint-list-item-bullet-indent": "^3.0.0",
    "remark-lint-list-item-content-indent": "^2.0.1",
    "remark-lint-list-item-indent": "^2.0.1",
    "remark-lint-list-item-spacing": "^3.0.0",
    "remark-lint-maximum-heading-length": "^2.0.1",
    "remark-lint-maximum-line-length": "^2.0.3",
    "remark-lint-no-auto-link-without-protocol": "^2.0.1",
    "remark-lint-no-blockquote-without-marker": "^4.0.0",
    "remark-lint-no-consecutive-blank-lines": "^3.0.0",
    "remark-lint-no-duplicate-definitions": "^2.0.1",
    "remark-lint-no-duplicate-headings-in-section": "^2.0.2",
    "remark-lint-no-emphasis-as-heading": "^2.0.1",
    "remark-lint-no-empty-url": "^2.0.1",
    "remark-lint-no-file-name-consecutive-dashes": "^1.0.5",
    "remark-lint-no-file-name-irregular-characters": "^1.0.5",
    "remark-lint-no-file-name-mixed-case": "^1.0.5",
    "remark-lint-no-file-name-outer-dashes": "^1.0.6",
    "remark-lint-no-heading-content-indent": "^3.0.0",
    "remark-lint-no-heading-indent": "^3.0.0",
    "remark-lint-no-heading-like-paragraph": "^2.0.1",
    "remark-lint-no-heading-punctuation": "^2.0.1",
    "remark-lint-no-inline-padding": "^3.0.0",
    "remark-lint-no-literal-urls": "^2.0.1",
    "remark-lint-no-missing-blank-lines": "^2.0.1",
    "remark-lint-no-shell-dollars": "^2.0.2",
    "remark-lint-no-shortcut-reference-link": "^2.0.1",
    "remark-lint-no-tabs": "^2.0.1",
    "remark-lint-no-undefined-references": "^3.0.0",
    "remark-lint-no-unneeded-full-reference-link": "^2.0.1",
    "remark-lint-no-unused-definitions": "^2.0.1",
    "remark-lint-ordered-list-marker-style": "^2.0.1",
    "remark-lint-ordered-list-marker-value": "^2.0.1",
    "remark-lint-rule-style": "^2.0.1",
    "remark-lint-table-cell-padding": "^3.0.0",
    "remark-lint-table-pipe-alignment": "^2.0.1",
    "remark-lint-table-pipes": "^3.0.0",
    "remark-lint-unordered-list-marker-style": "^2.0.1"
  }
}
.remarkrc.js
module.exports = {
  plugins: [
    'remark-frontmatter',
    ['remark-lint-blockquote-indentation'],
    ['remark-lint-code-block-style', 'fenced'],
    ['remark-lint-definition-spacing'],
    ['remark-lint-emphasis-marker', '*'],
    ['remark-lint-fenced-code-flag', { allowEmpty: false }],
    ['remark-lint-fenced-code-marker', '`'],
    ['remark-lint-file-extension', 'md'],
    ['remark-lint-final-newline'],
    ['remark-lint-first-heading-level', 2],
    ['remark-lint-heading-increment'],
    ['remark-lint-heading-style', 'atx'],
    ['remark-lint-link-title-style', '\''],
    ['remark-lint-list-item-bullet-indent'],
    ['remark-lint-list-item-content-indent'],
    ['remark-lint-list-item-indent', 'space'],
    ['remark-lint-list-item-spacing'],
    ['remark-lint-maximum-heading-length'],
    ['remark-lint-maximum-line-length'],
    ['remark-lint-no-auto-link-without-protocol'],
    ['remark-lint-no-blockquote-without-marker'],
    ['remark-lint-no-consecutive-blank-lines'],
    ['remark-lint-no-duplicate-definitions'],
    ['remark-lint-no-duplicate-headings-in-section'],
    ['remark-lint-no-emphasis-as-heading'],
    ['remark-lint-no-empty-url'],
    ['remark-lint-no-file-name-consecutive-dashes'],
    ['remark-lint-no-file-name-irregular-characters'],
    ['remark-lint-no-file-name-mixed-case'],
    ['remark-lint-no-file-name-outer-dashes'],
    ['remark-lint-no-heading-content-indent'],
    ['remark-lint-no-heading-indent'],
    ['remark-lint-no-heading-like-paragraph'],
    ['remark-lint-no-heading-punctuation'],
    ['remark-lint-no-inline-padding'],
    ['remark-lint-no-literal-urls'],
    ['remark-lint-no-missing-blank-lines'],
    ['remark-lint-no-shell-dollars'],
    ['remark-lint-no-shortcut-reference-link'],
    ['remark-lint-no-tabs'],
    ['remark-lint-no-undefined-references'],
    ['remark-lint-no-unneeded-full-reference-link'],
    ['remark-lint-no-unused-definitions'],
    ['remark-lint-ordered-list-marker-style', '.'],
    ['remark-lint-ordered-list-marker-value'],
    ['remark-lint-rule-style', { rule: '-', ruleSpaces: false }],
    ['remark-lint-emphasis-marker', '*'],
    ['remark-lint-table-cell-padding', 'padded'],
    ['remark-lint-table-pipe-alignment'],
    ['remark-lint-table-pipes'],
    ['remark-lint-unordered-list-marker-style', '-'],
  ],
};

Expected behavior

For example, when using the drewbourne.vscode-remark-lint extension, highlighting errors works properly.

remark-lint

Actual behavior

Output error
[Remark]
[remark-frontmatter]: Package not found. Use **npm i remark-remark-frontmatter** or **npm i -g remark-remark-frontmatter**.
[remark-lint-blockquote-indentation]: Package not found. Use **npm i remark-remark-lint-blockquote-indentation** or **npm i -g remark-remark-lint-blockquote-indentation**.
[remark-lint-code-block-style,fenced]: Package not found. Use **npm i remark-remark-lint-code-block-style,fenced** or **npm i -g remark-remark-lint-code-block-style,fenced**.
[remark-lint-definition-spacing]: Package not found. Use **npm i remark-remark-lint-definition-spacing** or **npm i -g remark-remark-lint-definition-spacing**.
[remark-lint-emphasis-marker,*]: Package not found. Use **npm i remark-remark-lint-emphasis-marker,*** or **npm i -g remark-remark-lint-emphasis-marker,***.
[remark-lint-fenced-code-flag,[object Object]]: Package not found. Use **npm i remark-remark-lint-fenced-code-flag,[object Object]** or **npm i -g remark-remark-lint-fenced-code-flag,[object Object]**.
[remark-lint-fenced-code-marker,`]: Package not found. Use **npm i remark-remark-lint-fenced-code-marker,`** or **npm i -g remark-remark-lint-fenced-code-marker,`**.
[remark-lint-file-extension,md]: Package not found. Use **npm i remark-remark-lint-file-extension,md** or **npm i -g remark-remark-lint-file-extension,md**.
[remark-lint-final-newline]: Package not found. Use **npm i remark-remark-lint-final-newline** or **npm i -g remark-remark-lint-final-newline**.
[remark-lint-first-heading-level,2]: Package not found. Use **npm i remark-remark-lint-first-heading-level,2** or **npm i -g remark-remark-lint-first-heading-level,2**.
[remark-lint-heading-increment]: Package not found. Use **npm i remark-remark-lint-heading-increment** or **npm i -g remark-remark-lint-heading-increment**.
[remark-lint-heading-style,atx]: Package not found. Use **npm i remark-remark-lint-heading-style,atx** or **npm i -g remark-remark-lint-heading-style,atx**.
[remark-lint-link-title-style,']: Package not found. Use **npm i remark-remark-lint-link-title-style,'** or **npm i -g remark-remark-lint-link-title-style,'**.
[remark-lint-list-item-bullet-indent]: Package not found. Use **npm i remark-remark-lint-list-item-bullet-indent** or **npm i -g remark-remark-lint-list-item-bullet-indent**.
[remark-lint-list-item-content-indent]: Package not found. Use **npm i remark-remark-lint-list-item-content-indent** or **npm i -g remark-remark-lint-list-item-content-indent**.
[remark-lint-list-item-indent,space]: Package not found. Use **npm i remark-remark-lint-list-item-indent,space** or **npm i -g remark-remark-lint-list-item-indent,space**.
[remark-lint-list-item-spacing]: Package not found. Use **npm i remark-remark-lint-list-item-spacing** or **npm i -g remark-remark-lint-list-item-spacing**.
[remark-lint-maximum-heading-length]: Package not found. Use **npm i remark-remark-lint-maximum-heading-length** or **npm i -g remark-remark-lint-maximum-heading-length**.
[remark-lint-maximum-line-length]: Package not found. Use **npm i remark-remark-lint-maximum-line-length** or **npm i -g remark-remark-lint-maximum-line-length**.
[remark-lint-no-auto-link-without-protocol]: Package not found. Use **npm i remark-remark-lint-no-auto-link-without-protocol** or **npm i -g remark-remark-lint-no-auto-link-without-protocol**.
[remark-lint-no-blockquote-without-marker]: Package not found. Use **npm i remark-remark-lint-no-blockquote-without-marker** or **npm i -g remark-remark-lint-no-blockquote-without-marker**.
[remark-lint-no-consecutive-blank-lines]: Package not found. Use **npm i remark-remark-lint-no-consecutive-blank-lines** or **npm i -g remark-remark-lint-no-consecutive-blank-lines**.
[remark-lint-no-duplicate-definitions]: Package not found. Use **npm i remark-remark-lint-no-duplicate-definitions** or **npm i -g remark-remark-lint-no-duplicate-definitions**.
[remark-lint-no-duplicate-headings-in-section]: Package not found. Use **npm i remark-remark-lint-no-duplicate-headings-in-section** or **npm i -g remark-remark-lint-no-duplicate-headings-in-section**.
[remark-lint-no-emphasis-as-heading]: Package not found. Use **npm i remark-remark-lint-no-emphasis-as-heading** or **npm i -g remark-remark-lint-no-emphasis-as-heading**.
[remark-lint-no-empty-url]: Package not found. Use **npm i remark-remark-lint-no-empty-url** or **npm i -g remark-remark-lint-no-empty-url**.
[remark-lint-no-file-name-consecutive-dashes]: Package not found. Use **npm i remark-remark-lint-no-file-name-consecutive-dashes** or **npm i -g remark-remark-lint-no-file-name-consecutive-dashes**.
[remark-lint-no-file-name-irregular-characters]: Package not found. Use **npm i remark-remark-lint-no-file-name-irregular-characters** or **npm i -g remark-remark-lint-no-file-name-irregular-characters**.
[remark-lint-no-file-name-mixed-case]: Package not found. Use **npm i remark-remark-lint-no-file-name-mixed-case** or **npm i -g remark-remark-lint-no-file-name-mixed-case**.
[remark-lint-no-file-name-outer-dashes]: Package not found. Use **npm i remark-remark-lint-no-file-name-outer-dashes** or **npm i -g remark-remark-lint-no-file-name-outer-dashes**.
[remark-lint-no-heading-content-indent]: Package not found. Use **npm i remark-remark-lint-no-heading-content-indent** or **npm i -g remark-remark-lint-no-heading-content-indent**.
[remark-lint-no-heading-indent]: Package not found. Use **npm i remark-remark-lint-no-heading-indent** or **npm i -g remark-remark-lint-no-heading-indent**.
[remark-lint-no-heading-like-paragraph]: Package not found. Use **npm i remark-remark-lint-no-heading-like-paragraph** or **npm i -g remark-remark-lint-no-heading-like-paragraph**.
[remark-lint-no-heading-punctuation]: Package not found. Use **npm i remark-remark-lint-no-heading-punctuation** or **npm i -g remark-remark-lint-no-heading-punctuation**.
[remark-lint-no-inline-padding]: Package not found. Use **npm i remark-remark-lint-no-inline-padding** or **npm i -g remark-remark-lint-no-inline-padding**.
[remark-lint-no-literal-urls]: Package not found. Use **npm i remark-remark-lint-no-literal-urls** or **npm i -g remark-remark-lint-no-literal-urls**.
[remark-lint-no-missing-blank-lines]: Package not found. Use **npm i remark-remark-lint-no-missing-blank-lines** or **npm i -g remark-remark-lint-no-missing-blank-lines**.
[remark-lint-no-shell-dollars]: Package not found. Use **npm i remark-remark-lint-no-shell-dollars** or **npm i -g remark-remark-lint-no-shell-dollars**.
[remark-lint-no-shortcut-reference-link]: Package not found. Use **npm i remark-remark-lint-no-shortcut-reference-link** or **npm i -g remark-remark-lint-no-shortcut-reference-link**.
[remark-lint-no-tabs]: Package not found. Use **npm i remark-remark-lint-no-tabs** or **npm i -g remark-remark-lint-no-tabs**.
[remark-lint-no-undefined-references]: Package not found. Use **npm i remark-remark-lint-no-undefined-references** or **npm i -g remark-remark-lint-no-undefined-references**.
[remark-lint-no-unneeded-full-reference-link]: Package not found. Use **npm i remark-remark-lint-no-unneeded-full-reference-link** or **npm i -g remark-remark-lint-no-unneeded-full-reference-link**.
[remark-lint-no-unused-definitions]: Package not found. Use **npm i remark-remark-lint-no-unused-definitions** or **npm i -g remark-remark-lint-no-unused-definitions**.
[remark-lint-ordered-list-marker-style,.]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-style,.** or **npm i -g remark-remark-lint-ordered-list-marker-style,.**.
[remark-lint-ordered-list-marker-value]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-value** or **npm i -g remark-remark-lint-ordered-list-marker-value**.
[remark-lint-rule-style,[object Object]]: Package not found. Use **npm i remark-remark-lint-rule-style,[object Object]** or **npm i -g remark-remark-lint-rule-style,[object Object]**.
[remark-lint-emphasis-marker,*]: Package not found. Use **npm i remark-remark-lint-emphasis-marker,*** or **npm i -g remark-remark-lint-emphasis-marker,***.
[remark-lint-table-cell-padding,padded]: Package not found. Use **npm i remark-remark-lint-table-cell-padding,padded** or **npm i -g remark-remark-lint-table-cell-padding,padded**.
[remark-lint-table-pipe-alignment]: Package not found. Use **npm i remark-remark-lint-table-pipe-alignment** or **npm i -g remark-remark-lint-table-pipe-alignment**.
[remark-lint-table-pipes]: Package not found. Use **npm i remark-remark-lint-table-pipes** or **npm i -g remark-remark-lint-table-pipes**.
[remark-lint-unordered-list-marker-style,-]: Package not found. Use **npm i remark-remark-lint-unordered-list-marker-style,-** or **npm i -g remark-remark-lint-unordered-list-marker-style,-**.

Runtime

No response

Package manager

npm v7

OS

macOS

Build and bundle tools

No response

THANKS

Just to tell you this extension is awesome and save me a lot of time. Cheers!

Support .mdx files

Initial checklist

Problem

vscode-remark only recognizes markdown files

documentSelector: [{scheme: 'file', language: 'markdown'}],

but there is now a dedicated MDX language in VS Code. it would be awesome if we could use remark lint on our MDX files!

Solution

Update the documentSelector to include MDX files

Alternatives

You can force VS Code to treat MDX as Markdown, which allows vscode-remark to work, but it comes at the cost of all the other language features of MDX in VS Code via vscode-mdx

  "files.associations": {
    "*.mdx": "markdown",
  },

Maintainers wanted

Hello, friends,

Sadly, I don't have a lot of time to support this plugin (and some others). Although I wish it development. Reply to this issue if you find yourself interested in owning this plugin.

I will transfer the repository and publishing rights to VS Code store (I don't know how to do it yet, click).

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/bb.yml
  • unifiedjs/beep-boop-beta main
.github/workflows/main.yml
  • actions/checkout v3
  • actions/setup-node v3
  • GabrielBB/xvfb-action v1.6
  • actions/checkout v3
  • actions/setup-node v3
  • actions/upload-artifact v3
.github/workflows/publish.yml
  • actions/checkout v2
  • gittools/actions v0.9.11
  • gittools/actions v0.9.11
  • actions/cache v2
  • HaaLeo/publish-vscode-extension v1
  • HaaLeo/publish-vscode-extension v1
  • actions/upload-artifact v2
  • svenstaro/upload-release-action v2
npm
package.json
  • @types/vscode ^1.0.0
  • @vscode/test-electron ^2.0.0
  • esbuild ^0.14.0
  • prettier ^2.0.0
  • remark-cli ^11.0.0
  • remark-language-server ^2.0.0
  • remark-preset-wooorm ^9.0.0
  • rimraf ^3.0.0
  • typescript ^4.0.0
  • vsce ^2.0.0
  • vscode-languageclient ^8.0.0
  • xo ^0.50.0
  • vscode ^1.67.0

  • Check this box to trigger a request for Renovate to run again on this repository

Remark will replace the contents of a markdown file with undefined if remark is not installed

Initial checklist

Affected packages and versions

v2.0.0

Link to runnable example

No response

Steps to reproduce

  1. Install the remark vscode extension
  2. Open a folder that does not contain a remark installation
  3. Format a markdown file
  4. Experience the file being replaced with undefined

Runtime information:

  • Node v18.6.0
  • Build tool & package manager: python-poetry (I am trying to format files in a python project)

Expected behavior

There should be an error telling you to install remark, but the file should be left unchanged.

Actual behavior

There is an error telling you to install remark, but it also replaces the content of your file with undefined

Runtime

Other (please specify in steps to reproduce)

Package manager

Other (please specify in steps to reproduce)

OS

macOS

Build and bundle tools

Other (please specify in steps to reproduce)

Update setting schema

There are some issues with the setting schema in packages.json:

  • The name ruleSpace should be ruleSpaces.
  • Some default values, such as the ones for ruleSpaces and strong, differ from Remark's documentation.
  • For some settings, such as emphasis, enum does not list all possible options.

I didn't check all the settings. I suggest doing a complete check.

Set up Codecov

Subject of the feature

Create a token for Codecov so we can have code coverage reporting in the project and add it as a GitHub secret so code coverage reports can be submitted.

Problem

We currently have no overview of the code coverage of the tests in the project.

Expected behavior

I expect to know approximately how well tested a codebase is. I don't need a precise percentage and 100% should be actively discouraged to avoid tight coupling between tests and code, making refactoring difficult, but somewhere between 60% and 80% is usually healthy.

Alternatives

There are many code coverage platforms, but I especially like Codecov since it has good integration with GitHub with its code review assertions and report comments and it can be configured to fail builds if coverage drops by merging a PR, for instance.

TypeError: Cannot create property 'rules' on string 'SyntaxError'

This Liquid-Markdown file causes vscode-remark to crash with the following error message when I try to format the file in VS Code:

TypeError: Cannot create property 'rules' on string 'SyntaxError'

It would be good to know where the syntax error occurs so it could be fixed in the document. Even better would be for vscode-remark to handle formatting of the Markdown document without any problems.

listItemIndent value of "1" is still replaced by tabs.

Hello, I read the documentation and have set the remark.format rules listItemIndent option to "1" in my settings.json. When I tell VSCode to do the remark formatting, it is still adding the 3 spaces instead. My other options (like setext: true) are correctly followed.

Relevant portion:

"remark.format": {
        "rules": {
            "setext": true,
            "listItemIndent ": "1",
            "rule": "*"
        }
    },

Disable packages for this project

Initial checklist

Problem

This package is not an npm package, but it has been published as such. https://github.com/remarkjs/vscode-remark/packages/674442

In fact, it’s the only package published to the @remarkjs organization.

Solution

Unpublish the package and disable packages for this project.

Alternatives

N/A

Error in Output

Getting these errors in the output in VSCode:

[Remark]
[[object Object]]: Package not found. Use **npm i remark-[object Object]** or **npm i -g remark-[object Object]**.
[remark-lint-maximum-line-length,999]: Package not found. Use **npm i remark-remark-lint-maximum-line-length,999** or **npm i -g remark-remark-lint-maximum-line-length,999**.
[remark-lint-unordered-list-marker-style,consistent]: Package not found. Use **npm i remark-remark-lint-unordered-list-marker-style,consistent** or **npm i -g remark-remark-lint-unordered-list-marker-style,consistent**.
[remark-lint-ordered-list-marker-style,consistent]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-style,consistent** or **npm i -g remark-remark-lint-ordered-list-marker-style,consistent**.
[remark-lint-emphasis-marker,consistent]: Package not found. Use **npm i remark-remark-lint-emphasis-marker,consistent** or **npm i -g remark-remark-lint-emphasis-marker,consistent**.
[remark-lint-ordered-list-marker-value,ordered]: Package not found. Use **npm i remark-remark-lint-ordered-list-marker-value,ordered** or **npm i -g remark-remark-lint-ordered-list-marker-value,ordered**.
[remark-lint-no-file-name-irregular-characters,false]: Package not found. Use **npm i remark-remark-lint-no-file-name-irregular-characters,false** or **npm i -g remark-remark-lint-no-file-name-irregular-characters,false**.
[remark-lint-list-item-spacing,[object Object]]: Package not found. Use **npm i remark-remark-lint-list-item-spacing,[object Object]** or **npm i -g remark-remark-lint-list-item-spacing,[object Object]**.
[remark-lint-list-item-indent,space]: Package not found. Use **npm i remark-remark-lint-list-item-indent,space** or **npm i -g remark-remark-lint-list-item-indent,space**.
[remark-lint-list-item-content-indent,false]: Package not found. Use **npm i remark-remark-lint-list-item-content-indent,false** or **npm i -g remark-remark-lint-list-item-content-indent,false**.
[remark-lint-code-block-style,false]: Package not found. Use **npm i remark-remark-lint-code-block-style,false** or **npm i -g remark-remark-lint-code-block-style,false**.
[remark-lint-table-cell-padding,false]: Package not found. Use **npm i remark-remark-lint-table-cell-padding,false** or **npm i -g remark-remark-lint-table-cell-padding,false**.
[remark-lint-table-pipe-alignment,false]: Package not found. Use **npm i remark-remark-lint-table-pipe-alignment,false** or **npm i -g remark-remark-lint-table-pipe-alignment,false**.
[function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}]: Package not found. Use **npm i remark-function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}** or **npm i -g remark-function frontmatter(options) {
  var parser = this.Parser
  var compiler = this.Compiler
  var config = matters(options || ['yaml'])

  if (isRemarkParser(parser)) {
    attachParser(parser, config)
  }

  if (isRemarkCompiler(compiler)) {
    attachCompiler(compiler, config)
  }
}**.
[remark-frontmatter,[object Object]]: Package not found. Use **npm i remark-remark-frontmatter,[object Object]** or **npm i -g remark-remark-frontmatter,[object Object]**.

My config file looks like this:

const fs = require("fs");
const path = require("path");

exports.settings = {
    bullet: "consistent",
    listItemIndent: "1",
    rule: "-",
    ruleRepetition: "3",
    ruleSpaces: false,
    emphasis: "*",
    paddedTable: false
};

const personalDictionaryPath = path.join(__dirname, ".vscode/spellright.dict");
const personalDictionary = fs.existsSync(personalDictionaryPath)
    ? {
          personal: fs.readFileSync(personalDictionaryPath, "utf8")
      }
    : {};

exports.plugins = [
    require("remark-preset-lint-markdown-style-guide"),
    ["remark-lint-maximum-line-length", 999],
    ["remark-lint-unordered-list-marker-style", "consistent"],
    ["remark-lint-ordered-list-marker-style", "consistent"],
    ["remark-lint-emphasis-marker", "consistent"],
    ["remark-lint-ordered-list-marker-value", "ordered"],
    ["remark-lint-no-file-name-irregular-characters", false],
    ["remark-lint-list-item-spacing", { checkBlanks: true }],
    ["remark-lint-list-item-indent", "space"],
    ["remark-lint-list-item-content-indent", false],
    ["remark-lint-code-block-style", false],
    ["remark-lint-table-cell-padding", false],
    ["remark-lint-table-pipe-alignment", false],
    require("remark-frontmatter"),
    ["remark-frontmatter", {type: 'custom', marker: '!'}]
];

Prevent entity encoding of Pandoc-style footnotes

When I write markdown documents which use Pandoc style longnotes the colon is encoded. Example:

[^footnote]: Footnote text

encoded:

[^footnote]: Footnote text

I've attempted to disable this by setting:

"remark.format": {
        "rules": {
            "entities": false,
            "gfm": false
        }
    }

This does not help. Any advice on how to prevent encoding at this location?

Thanks,

Brad

Bundle the extension

Subject of the feature

According to Microsoft's best practices, VS Code extensions should be bundled.

Problem

When executing vsce package now, the following is written to the console:

This extension consists of 359 files, out of which 193 are JavaScript files. For performance reasons, you should bundle your extension: https://aka.ms/vscode-bundle-extension . You should also exclude unnecessary files by adding them to your .vscodeignore: https://aka.ms/vscode-vscodeignore

The large amount of JavaScript files being packaged is due to the entire node_modules directory being added to the .vsix archive. Bundling will pull every dependency into one large extension.js file, making it possible to ignore the node_modules directory and pretty much everything else, greatly reducing the size of the package.

Alternatives

Webpack is suggested, but I think there are alternative bundlers that may be used. Bundling is unchartered territory for me, so I have no preference.

Publish the extension to OpenVSX

Hi, I'm a VSCodium user, a FLOSS version of VS Code. It's the same code but without Microsoft's telemetry, branding and licensing.

I would like to request, if possible, to add the Remark for VSCode extension to the open-vsx.org market as it is unclear if it's legal to use the official Microsoft extension marketplace on VS Code forks, see here.

Additional information on how to publish an extension to Open VSX can be obtained here.

Rename vscode-remark to remark

Initial checklist

Problem

The extension id is ${publisher}.${name}, so for this plugin it’s unifiedjs.vscode-remark. This id is used in some places, such as installation instructions and configuration of the formatter once #65 is finalized.

I.e.:

ext install unifiedjs.vscode-remark
"[markdown]": {
    "editor.defaultFormatter": "unifiedjs.vscode-remark"
}

I think the vscode- prefix is a bit superfluous in this context.

Solution

  1. Rename this extension from remark-vscode to `remark
  2. Unpublish the old extension
  3. Publish the new extension

Alternatives

Keep it as-is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.