BibTeX language support for CodeMirror
npm install @citedrive/codemirror-lang-bibtex[WEBSITE | ISSUES | FORUM | CHANGELOG | NPM ]
This package implements BibTeX language support for the
CodeMirror code editor.
The project page has more information, a
number of examples and the
documentation.
This code is released under an
MIT license.
``javascript
import { EditorView, basicSetup } from "codemirror";
import { bibtex } from "@citedrive/codemirror-lang-bibtex";
const view = new EditorView({
parent: document.body,
doc: fmt.Println("hello world"),``
extensions: [basicSetup, bibtex()],
});
bibtex(config?: {biblatex?: boolean, smartSuggest?: boolean, snippetRecs?: boolean, autoCursor?: boolean, syntaxLinter?: boolean, keywords?: readonly string[]} = {}) → LanguageSupportBibTeX language support with BibLaTeX dialect support, autocompletion configuration, and snippets for both BibTeX and BibLaTeX that are suggested based on the editor context.
There are configuration options for the following:
biblatex: falsesmartSuggest: trueentries (i.e. @article = {...}) when the user is not currently editing an entry and only suggests snippets for bibliography fields (i.e. author = {Donald Knuth}) when the user is currently editing an entry.snippetRecs: trueautoCursor: truesyntaxLinter: truekeywords: []FieldValue syntax node.bibtexLanguage: LRLanguageBibTeX Language configuration with syntax highlighting, folding, and indentation.
biblatexLanguage: LRLanguageBibLaTeX Language configuration as a dialect of BibTeX.
bibtexCompletion: ExtensionBibTeX autocompletion configuration.
bibtexLinter: ExtensionBibTeX syntax linter.