4.0.0 ā€¢ Published 3 months ago

@mapbox/remark-config-docs v4.0.0

Weekly downloads
81
License
ISC
Repository
github
Last release
3 months ago

remark-config-docs

Remark configuration for documentation sites. Includes:

Install

npm install --save-dev @mapbox/remark-config-docs

Create .remarkrc.js with the following contents (update the config with values that are meaningful to the site):

const rc = require("@mapbox/remark-config-docs");
const config = {
  siteBasePath: "docs-starter-kit",
  constants: "src/constants.json",
  ignoreLinks: "conf/ignore-links.json",
};

exports.plugins = [...rc.plugins(config)];

Configuration

The plugin function take an configuration object:

{
  "siteBasePath": "docs-starter-kit", // required, this is the site's base path
  "siteOrigin": "https://docs.mapbox.com", // default is "https://docs.mapbox.com"
  "pages": "src/pages/", // default is "src/pages/"
  "constants": "src/constants.json", // optional, but encouraged. This value is the relative path to the site's constants file. Used by constantly to assert constant values.
  "ignoreLinks": "conf/ignore-links.json", // optional. Used by link-checker to ignore specific links.
  "disable": ["remark-lint-heading-increment"] // optional. Array of plugin names to be disabled for this site.
}

Add a remark-lint plugin to your local configuration

If you have a specific linter to add to a single repository, you can add it to exports.plugins array. For example, you want to add the remark-lint-roller plugin, your .remarkrc.js could look like:

const rc = require("@mapbox/remark-config-docs");
const config = {
  siteBasePath: "docs-starter-kit",
  constants: "src/constants.json",
  ignoreLinks: "conf/ignore-links.json",
};

exports.plugins = [...rc.plugins(config), ["remark-lint-roller", [2]]];

šŸ“š See unified-engine/configure.md for more options to extend your remark configuration file.

Add a new plugin to remark-config-docs

  1. Add the plugin to peerDependencies in package.json.
  2. Update README.md to list the plugin and document any configuration changes or additions.
  3. Add the plugin in index.js.
  4. Add a test in text/index.test.js to make sure the new plugin outputs in the configuration as you expect.

How to release

From the main branch:

  1. If you haven't already, update CHANGELOG.md to describe the changes, commit, and push.
  2. Run npm version {major|minor|patch}. Example (and usually): npm version minor.
  3. Push changes.
  4. Run mbx npm publish to publish the package to npm.

Dependabot will automatically update @mapbox/remark-config-docs (within 1 day) to all site repositories. If you need it sooner, you can install this package in the repository by following the install steps.

This package uses npm 7, which means it will automatically install the peerDependnecies found in package.json. If your site requires a different version of a peer dependency, you can install the dependency in your repository using the --force flag. Example: npm i @mapbox/remark-lint-mapbox@3.1.0 --force.

4.0.0

3 months ago

3.1.1

3 months ago

3.1.0

4 months ago

3.0.0

4 months ago

2.1.0

6 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0-beta.1

3 years ago

1.2.0-beta.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.14.0

3 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago