0.3.0 • Published 5 months ago

markmark v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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