
Product
Introducing Pull Request Stories to Help Security Teams Track Supply Chain Risks
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
@markdoc/language-support
Advanced tools
A Markdoc language server and Visual Studio Code extension
@markdoc/language-server
This is the official Visual Studio Code extension and language server for the Markdoc authoring framework.
When the language server and extension are used together and configured to load a Markdoc schema, they support the following features:
After installing the Markdoc extension in Visual Studio Code, create a Markdoc language server configuration file. The extension looks for a file called markdoc.config.json
in your workspace root, but you can customize this in the extension's settings.
The JSON configuration file consists of an array of server instance descriptions. The following example demonstrates how to create a basic Markdoc language server configuration:
[
{
"id": "my-site",
"path": "docs/content",
"schema": {
"path": "docs/dist/schema.js",
"type": "node",
"property": "default",
"watch": true
},
"routing": {
"frontmatter": "route"
}
}
]
id
property is a string that uniquely identifies the server configuration. In Visual Studio Code, the extension displays this in the status bar when a file from the configuration has focuspath
property is a string that contains the path to the base directory where your Markdoc content is stored, relative to your workspace root directoryschema
property is an object that describes the location of your Markdoc schema and how to load it from the filesystem
path
property is string that contains the path to the schema module, relative to the workspace root directorytype
property is a string that must be either "node"
or "esm"
. This property indicates whether the schema module uses node's module.exports
convention or the standards-based ECMAScript modules export
syntaxproperty
property is the name of the property exported by the module that contains the schema.
"node"
, the extension automatically assumes that the schema itself is the top-level value of module.exports
."esm"
, the extension automatically assumes the schema itself is the default export (e.g. export default {}
)watch
property is a boolean value that, when set to true
, configures the extension to monitor the schema file for changes and reload it automaticallyrouting
property is an optional object that describes your project's routing configuration
frontmatter
property is a string that tells the extension which property in the Markdoc file's YAML frontmatter contains the URL route associated with the fileIt is possible to have multiple Markdoc configurations for the same workspace by adding additional configuration objects to the top-level array. This is useful in cases where you have multiple websites with different schemas under different subdirectories of the same workspace. For example, you might want separate configurations for narrative documentation and an API reference.
In multi-root workspaces, a Markdoc configuration file is specific to an individual workspace root. You can have separate Markdoc configuration files for each root. If you need to override the location of the Markdoc language server configuration file in a multi-root workspace, you can use a folder setting to customize this behavior per root.
$ npm install
$ (cd server && npm install) && (cd client && npm install)
$ npm run build
$ npm run build:types
$ npm run build:extension
The test suite relies on the 'node:test' module that is only included in Node.js 18.x or higher.
$ npm run test
This project uses the MIT license.
FAQs
A Markdoc language server and Visual Studio Code extension
The npm package @markdoc/language-support receives a total of 1 weekly downloads. As such, @markdoc/language-support popularity was classified as not popular.
We found that @markdoc/language-support demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.