@11ty/eleventy-plugin-inclusive-language 中文文档教程

发布于 3年前 浏览 19 项目主页 更新于 3年前

eleventy-plugin-inclusive-language

一个 Eleventy linter 插件,用于检查降价文件中的包容性语言。 灵感来自 CSS Tricks' Words to Avoid in Educational Writing。 这里没有浏览器/客户端 JavaScript——这个插件的一切都是在构建时完成的。

eleventy-plugin-inclusive-language 的示例屏幕截图

Installation

可在 npm

npm install @11ty/eleventy-plugin-inclusive-language --save-dev

打开你的 Eleventy 配置文件(可能是 .eleventy.js)并使用 addPlugin

const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(inclusiveLangPlugin);
};

阅读更多关于 Eleventy 插件。

Options

可选择将选项对象作为第二个参数传递给 addPlugin 以进一步自定义此插件。

const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(inclusiveLangPlugin, {
    templateFormats: ["md"], // default, add more file extensions here

    // accepts an array or a comma-delimited string
    words: "simply,obviously,basically,of course,clearly,just,everyone knows,however,easy"
  });
};

eleventy-plugin-inclusive-language

An Eleventy linter plugin to check for inclusive language in markdown files. Inspired by CSS Tricks’ Words to Avoid in Educational Writing. No browser/client JavaScript here—everything is this plugin is done at build-time.

Sample screenshot of eleventy-plugin-inclusive-language in action

Installation

Available on npm.

npm install @11ty/eleventy-plugin-inclusive-language --save-dev

Open up your Eleventy config file (probably .eleventy.js) and use addPlugin:

const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(inclusiveLangPlugin);
};

Read more about Eleventy plugins.

Options

Optionally pass in an options object as the second argument to addPlugin to further customize this plugin.

const inclusiveLangPlugin = require("@11ty/eleventy-plugin-inclusive-language");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(inclusiveLangPlugin, {
    templateFormats: ["md"], // default, add more file extensions here

    // accepts an array or a comma-delimited string
    words: "simply,obviously,basically,of course,clearly,just,everyone knows,however,easy"
  });
};
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文