remark-language-server

Language server for markdown using remark

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
remark-language-server
2903.0.012 days ago2 years agoMinified + gzip package size for remark-language-server in KB

Readme

remark-language-server
!Buildbuild-badgebuild !Downloadsdownloads-badgedownloads !Sponsorssponsors-badgecollective !Backersbackers-badgecollective !Chatchat-badgechat
A language server to lint and format markdown files with remark.

Contents

Configuration file
Settings Emacs Neovim vim-lsp Visual Studio Code

What is this?

This package is a language server which can lint and format markdown files using remark.

When should I use this?

You can use this package when you want to enhance your editor with linting and formatting of markdown files. Some editors can consume this package directly, others need a plugin in order to consume this package.

Install

This package is ESM only. In Node.js (version 16.0+, or 18.0+), install with npm:
npm install remark-language-server

Use

Usage of this package depends on your editor integration. Because this is based on unified-languageserver-nodeunified-languageserver-node, the same features are supported.

Configuration file

remark-language-server uses the same configuration files as remark-cliremark-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 language server supports the following settings:
  • remark.requireConfig (boolean, default: false) — If true, only perform
actions if a configuration fileconfiguration-file is found.

Examples

Emacs

Use lsp-modelsp-mode to use the remark language server with Emacs.

Neovim

The remark language server is part of nvim-lspconfignvim-lspconfig, a collection of common configurations for Neovim’s built-in language server client. This means you can add remark language server in one line:
require'lspconfig'.remark_ls.setup {
  settings = {
    requireConfig = true
  }
}

nvim-lspconfig has detailed installation instructionsnvim-lspconfig-instructions such as configuration options.

vim-lsp

The remark language server can be used with vim-lspvim-lsp. You can configure it to be started when a markdown file is opened.
if (executable('remark-language-server'))
  au User lsp_setup call lsp#register_server({
  \ 'name': 'remark',
  \ 'cmd': {server_info->['remark-language-server', '--stdio']},
  \ 'allowlist': ['markdown'],
  \ 'config': lsp_settings#get('remark-language-server', 'config', lsp_settings#server_config('remark-language-server')),
  \ 'workspace_config': lsp_settings#get('remark-language-server', 'workspace_config', {
  \   'requireConfig': v:true,
  \ }),
  \ })
endif

Otherwise, if you use vim-lsp-settingsvim-lsp-settings, you will be asked to use the remark language server automatically when a markdown file is opened.

Visual Studio Code

Use vscode-remarkvscode-remark to use the remark language server with Visual Studio Code.

Compatibility

Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 16.0+, and 18.0+. Our projects sometimes work with older versions, but this is not guaranteed.

Contribute

See contributing.mdcontributing in remarkjs/.githubhealth for ways to get started. See support.mdsupport for ways to get help. Join us in Discussionschat to chat with the community and contributors.
This project has a code of conductcoc. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MITlicense © Remco Haszingauthor