markmark
v0.4.0
Published
Language tooling for markdown
Downloads
109
Readme
markmark
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:
- [x] Go to definition
- [x] Find references
- [x] Complete links and tags
- [X] Validate links
Scalable across many Markdown files:
- [x] Project awareness
- [x] 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