Skip to content

remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)

License

Notifications You must be signed in to change notification settings

escherlies/remark-gfm-configurable

 
 

Repository files navigation

remark-gfm-configurable

npm version Build Status

A fork of remark-gfm with configurable plugin options to enable or disable specific GitHub Flavored Markdown (GFM) features.

Enable or disable, these underlying features: autolink literals, footnotes, strikethrough, tables, and task list items.

Usage

You can customize both plugin features and extension options by passing an options object to remarkGfm. The options object can include plugin enable/disable settings under the plugins property and extension-specific options at the top level.

import { remark } from 'remark';
import remarkGfm from 'remark-gfm-configurable';

const options = {
  plugins: {
    table: false,        // Disable tables
    footnote: false,     // Disable footnotes
  },
  singleTilde: true,     // Extension option for strikethrough
  tableCellPadding: false, // Extension option for tables (ignored since tables are disabled)
};

remark()
  .use(remarkGfm, options)
  .process(markdown)
  .then((file) => {
    console.log(String(file));
  });

In this example:

  • Plugin Options: We disable table and footnote features by setting them to false under the plugins property.
  • Extension Options: We set singleTilde: true to allow single tilde strikethrough.

Options

The options object passed to remarkGfm can contain both plugin options (to enable or disable specific GFM features) and extension options (for fine-grained control over individual extensions).

interface Options extends RemarkGfmOptions {
  plugins?: {
    autolinkLiteral?: boolean; // Default: true
    footnote?: boolean;        // Default: true
    strikethrough?: boolean;   // Default: true
    table?: boolean;           // Default: true
    tasklist?: boolean;        // Default: true
  },
}

Complete Options Example

const options = {
  plugins: {
    autolinkLiteral: true,
    footnote: false,       // Disable footnotes
    strikethrough: true,
    table: true,
    tasklist: true,
  },
  // Extension options
  singleTilde: true,       // Strikethrough option
  tableCellPadding: false, // Table option
  tablePipeAlign: true,    // Table option
};

Contributing

Contributions are welcome! If you have suggestions or find a bug, please open an issue or submit a pull request on GitHub.

License

MIT

Acknowledgments

About

remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy