Giter Site home page Giter Site logo

11ty / eleventy-plugin-inclusive-language Goto Github PK

View Code? Open in Web Editor NEW
41.0 7.0 6.0 162 KB

A linter plugin to check for inclusive language in markdown files.

Home Page: https://www.11ty.dev/docs/plugins/inclusive-language/

License: MIT License

JavaScript 100.00%
eleventy eleventy-plugin

eleventy-plugin-inclusive-language's Introduction

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"
  });
};

eleventy-plugin-inclusive-language's People

Contributors

d2s avatar zachleat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

eleventy-plugin-inclusive-language's Issues

Ability to exclude certain files from linting

Hi @zachleat,

I know, you haven't looked at this repo in a while.
But I noticed, that this plugin scans my imported tweets as well.
Is there a way to tell the plugin to ignore certain files / directories / collections?

For example, I could compare the inputPath argument of

eleventyConfig.addLinter("inclusive-language", function(content, inputPath, outputPath) {
against certain conditions.

Would trim down my logging quite a lot :-)

Once we came up with a nice API, I'd be willing to submit a PR!

Use `main` as primary branch name

This repository currently uses master instead of main as the primary branch name.

GitHub now supports using main as the primary branch name. Maintainers should update the repo settings to use main instead of the other branch name.

Recommendation for handling "master" in file paths

We have a lot of links in our docs to github.com/branch/master/whatever and the linter flags these. I tried doing words: [' master '] but it looks like the plugin calls trim() and strips those spaces out. Any suggestions?

Evaluate usage of retext

Hi @zachleat,

today, I was looking whether I could apply some readbility estimation to my blog posts.
I stumbled upon retext, which is fairly configurable, but settled with text-readability for now.

Perhaps you want to use it (since markdown-it allows plugins as well).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.