Skip to content
/ markmark Public

Markdown language tooling, exposed as a language server

License

Notifications You must be signed in to change notification settings

nikku/markmark

Repository files navigation

markmark

CI

Markdown language tooling. Use standalone or plug-in as a language server into your favorite IDE.

Features

Language tooling and code intelligence for Markdown files:

  • Go to definition
  • Find references
  • Complete links and tags
  • Validate links

Scalable across many Markdown files:

  • Project awareness
  • Built in or external file watching support

Exposed as a language server, but also usable standalone.

Installation

npm install -g markmark

Usage

Language Server

Start using markmark-lsp binary (depends on the language server protocol integration of your editor):

markmark-lsp --stdio

Standalone

Instantiate markmark yourself to integrate it into your applications:

import { Markmark } from 'markmark';

const markmark = new Markmark(console);

// intialize
markmark.init({ watch: true });

// add a search root
markmark.addRoot('file:///some-folder');

// listen on <ready>
markmark.on('ready', () => {
  console.log('Markmark is ready!');
});

// find references at position
const refs = markmark.findReferences({
  uri: 'file:///some-folder/foo.md',
  position: {
    start: { line: 1, column: 5 },
    end: { line: 1, column: 5 }
  }
});

// find definitions at document position
const defs = markmark.findDefinitions({
  uri: 'file:///some-folder/foo.md',
  position: {
    start: { line: 1, column: 5 },
    end: { line: 1, column: 5 }
  }
});

License

MIT