{"_id":"remark-gfm-configurable","name":"remark-gfm-configurable","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"remark-gfm-configurable","version":"1.0.0","description":"remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists) with configurable plugin options","license":"MIT","keywords":["autolink","configurable","footnote","gfm","github","markdown","mdast","plugin","remark","remark-plugin","strikethrough","table","tasklist","unified"],"repository":{"type":"git","url":"git+https://github.com/escherlies/remark-gfm-configurable.git"},"bugs":{"url":"https://github.com/escherlies/remark-gfm-configurable/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Enrico Scherlies","email":"escherlies@pm.me"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"Enrico Scherlies","email":"escherlies@pm.me"}],"sideEffects":false,"type":"module","exports":"./index.js","dependencies":{"@types/mdast":"^4.0.0","mdast-util-gfm-autolink-literal":"^2.0.1","mdast-util-gfm-footnote":"^2.0.0","mdast-util-gfm-strikethrough":"^2.0.0","mdast-util-gfm-table":"^2.0.0","mdast-util-gfm-task-list-item":"^2.0.0","micromark-extension-gfm-autolink-literal":"^2.1.0","micromark-extension-gfm-footnote":"^2.1.0","micromark-extension-gfm-strikethrough":"^2.1.0","micromark-extension-gfm-table":"^2.1.0","micromark-extension-gfm-tagfilter":"^2.0.0","micromark-extension-gfm-task-list-item":"^2.1.0","remark-parse":"^11.0.0","remark-stringify":"^11.0.0","unified":"^11.0.0"},"devDependencies":{"@types/node":"^20.0.0","c8":"^8.0.0","is-hidden":"^2.0.0","prettier":"^3.0.0","remark":"^15.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","string-width":"^6.0.0","to-vfile":"^8.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.56.0"},"scripts":{"build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . --frail --output --quiet && prettier . --log-level warn --write && xo --fix","prepack":"npm run build && npm run format","test":"npm run build && npm run format && npm run test-coverage","test-api":"node --conditions development test/index.js","test-coverage":"c8 --100 --reporter lcov npm run test-api"},"prettier":{"bracketSpacing":false,"singleQuote":true,"semi":false,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"ignoreCatch":true,"strict":true},"xo":{"overrides":[{"files":["test/**/*.js"],"rules":{"no-await-in-loop":"off"}}],"prettier":true},"_id":"remark-gfm-configurable@1.0.0","gitHead":"93732841a39a3b4381fa213b188bf77b70e0fd96","types":"./index.d.ts","homepage":"https://github.com/escherlies/remark-gfm-configurable#readme","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-+JkBOufh9EAY3wOkJ8076Zj06FE3hPhGZ/D0NLo1UEh+FM09yyOiT8mv3COeiaKm1u0xMv8/uetzvcynn21dFg==","shasum":"810717a134aaa8489cfac969be3ee6de32328089","tarball":"https://registry.npmjs.org/remark-gfm-configurable/-/remark-gfm-configurable-1.0.0.tgz","fileCount":7,"unpackedSize":17742,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD89xxzdM/GLSOtXPXYDXoN3kKX5Pt6vepxlL7zg14vHQIhAK8yOQiXloGQh5GcaFHWSMJC2D4tC5C5SKHIO1k+eQRa"}]},"_npmUser":{"name":"escherlies","email":"escherlies@pm.me"},"directories":{},"maintainers":[{"name":"escherlies","email":"escherlies@pm.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-gfm-configurable_1.0.0_1727792407757_0.6996212673410867"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-01T14:20:07.644Z","1.0.0":"2024-10-01T14:20:07.932Z","modified":"2024-10-01T14:20:08.272Z"},"maintainers":[{"name":"escherlies","email":"escherlies@pm.me"}],"description":"remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists) with configurable plugin options","homepage":"https://github.com/escherlies/remark-gfm-configurable#readme","keywords":["autolink","configurable","footnote","gfm","github","markdown","mdast","plugin","remark","remark-plugin","strikethrough","table","tasklist","unified"],"repository":{"type":"git","url":"git+https://github.com/escherlies/remark-gfm-configurable.git"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},{"name":"Enrico Scherlies","email":"escherlies@pm.me"}],"author":{"name":"Enrico Scherlies","email":"escherlies@pm.me"},"bugs":{"url":"https://github.com/escherlies/remark-gfm-configurable/issues"},"license":"MIT","readme":"# remark-gfm-configurable\n\n[![npm version](https://badge.fury.io/js/remark-gfm-configurable.svg)](https://www.npmjs.com/package/remark-gfm-configurable)\n[![Build Status](https://github.com/escherlies/remark-gfm-configurable/actions/workflows/ci.yml/badge.svg)](https://github.com/escherlies/remark-gfm-configurable/actions)\n\nA fork of [remark-gfm](https://github.com/remarkjs/remark-gfm) with configurable plugin options to enable or disable specific GitHub Flavored Markdown (GFM) features.\n\nBy default, [remark-gfm](https://github.com/remarkjs/remark-gfm) enables all underlying features: **autolink literals, footnotes, strikethrough, tables, and task list items**.\n\nThis fork lets you configure which features are enabled by specifying them through a unified options object, offering more granular control over GitHub Flavored Markdown (GFM) features and their behavior.\n\n## Table of Contents\n\n- [remark-gfm-configurable](#remark-gfm-configurable)\n  - [Table of Contents](#table-of-contents)\n  - [Introduction](#introduction)\n  - [Features](#features)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Basic Usage](#basic-usage)\n    - [Configuring Options](#configuring-options)\n  - [Options](#options)\n    - [Plugin Options](#plugin-options)\n      - [Available Plugin Options](#available-plugin-options)\n    - [Extension Options](#extension-options)\n      - [Strikethrough Extension Options](#strikethrough-extension-options)\n      - [Table Extension Options](#table-extension-options)\n      - [Complete Options Example](#complete-options-example)\n  - [Differences from remark-gfm](#differences-from-remark-gfm)\n  - [Contributing](#contributing)\n    - [Development](#development)\n  - [License](#license)\n  - [Acknowledgments](#acknowledgments)\n\n## Introduction\n\n`remark-gfm-configurable` is a [remark](https://github.com/remarkjs/remark) plugin that adds support for GitHub Flavored Markdown (GFM) with the ability to configure which features are enabled. The options are unified into a single object, making it easy to swap this module with the original `remark-gfm` without changing your code structure.\n\n## Features\n\n- **Unified Options Object**: Combine plugin and extension options into a single object for simplicity.\n- **Configurable Plugins**: Enable or disable specific GFM features as needed.\n- **Extension Options**: Pass options directly to individual GFM extensions for fine-grained control.\n- **Compatibility**: By default, all GFM features are enabled, maintaining compatibility with `remark-gfm`.\n\n## Installation\n\nInstall via npm:\n\n```sh\nnpm install remark-gfm-configurable\n```\n\nOr with Yarn:\n\n```sh\nyarn add remark-gfm-configurable\n```\n\n## Usage\n\n### Basic Usage\n\n```js\nimport { remark } from 'remark';\nimport remarkGfm from 'remark-gfm-configurable';\n\nconst markdown = `\nThis is a ~~strikethrough~~ text with a task list:\n\n- [x] Task 1\n- [ ] Task 2\n`;\n\nremark()\n  .use(remarkGfm)\n  .process(markdown)\n  .then((file) => {\n    console.log(String(file));\n  });\n```\n\n### Configuring Options\n\nYou 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.\n\n```js\nimport { remark } from 'remark';\nimport remarkGfm from 'remark-gfm-configurable';\n\nconst options = {\n  plugins: {\n    table: false,        // Disable tables\n    footnote: false,     // Disable footnotes\n  },\n  singleTilde: true,     // Extension option for strikethrough\n  tableCellPadding: false, // Extension option for tables (ignored since tables are disabled)\n};\n\nremark()\n  .use(remarkGfm, options)\n  .process(markdown)\n  .then((file) => {\n    console.log(String(file));\n  });\n```\n\nIn this example:\n\n- **Plugin Options**: We disable `table` and `footnote` features by setting them to `false` under the `plugins` property.\n- **Extension Options**: We set `singleTilde: true` to allow single tilde strikethrough.\n\n## Options\n\nThe `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).\n\n```ts\ninterface Options extends MicromarkStrikethroughOptions, MdastTableOptions {\n  plugins?: PluginOptions;\n}\n```\n\n### Plugin Options\n\nPlugin options are provided under the `plugins` property within the `options` object. All features are enabled by default.\n\n```ts\ninterface PluginOptions {\n  autolinkLiteral?: boolean; // Default: true\n  footnote?: boolean;        // Default: true\n  strikethrough?: boolean;   // Default: true\n  table?: boolean;           // Default: true\n  tasklist?: boolean;        // Default: true\n}\n```\n\n#### Available Plugin Options\n\n- `autolinkLiteral`: Enable or disable [autolink literals](https://github.github.com/gfm/#autolinks).\n- `footnote`: Enable or disable [footnotes](https://github.github.com/gfm/#footnotes).\n- `strikethrough`: Enable or disable [strikethrough](https://github.github.com/gfm/#strikethrough-extension-).\n- `table`: Enable or disable [tables](https://github.github.com/gfm/#tables-extension-).\n- `tasklist`: Enable or disable [task list items](https://github.github.com/gfm/#task-list-items-extension-).\n\n### Extension Options\n\nExtension options are provided at the top level of the `options` object. These options are directly passed to the corresponding GFM extensions.\n\n#### Strikethrough Extension Options\n\n```ts\ninterface MicromarkStrikethroughOptions {\n  singleTilde?: boolean; // Default: false\n}\n```\n\n- `singleTilde`: When set to `true`, allows single tilde (`~like this~`) to be used for strikethrough, in addition to double tildes (`~~like this~~`).\n\n#### Table Extension Options\n\n```ts\ninterface MdastTableOptions {\n  tableCellPadding?: boolean; // Default: true\n  tablePipeAlign?: boolean;   // Default: false\n}\n```\n\n- `tableCellPadding`: When set to `false`, disables padding in table cells when generating Markdown.\n- `tablePipeAlign`: When set to `true`, alignment markers (`:`) are placed next to the pipes in tables.\n\n**Note:** Even if you provide extension options for a feature, they will be ignored if the corresponding plugin is disabled.\n\n#### Complete Options Example\n\n```js\nconst options = {\n  plugins: {\n    autolinkLiteral: true,\n    footnote: false,       // Disable footnotes\n    strikethrough: true,\n    table: true,\n    tasklist: true,\n  },\n  // Extension options\n  singleTilde: true,       // Strikethrough option\n  tableCellPadding: false, // Table option\n  tablePipeAlign: true,    // Table option\n};\n```\n\n## Differences from remark-gfm\n\n- **Unified Options Object**: Unlike `remark-gfm`, this package uses a unified `options` object that includes both plugin and extension options, simplifying configuration.\n- **Configurable Features**: Allows you to enable or disable specific GFM features under the `plugins` property.\n- **Extension Options**: Provides the ability to pass options directly to GFM extensions at the top level of the `options` object.\n- **Module Swapping Compatibility**: Designed to allow seamless swapping with `remark-gfm` without significant code changes.\n\n## Contributing\n\nContributions are welcome! If you have suggestions or find a bug, please open an issue or submit a pull request on [GitHub](https://github.com/escherlies/remark-gfm-configurable).\n\n### Development\n\nTo set up the development environment:\n\n1. Clone the repository:\n\n   ```sh\n   git clone https://github.com/escherlies/remark-gfm-configurable.git\n   ```\n\n2. Install dependencies:\n\n   ```sh\n   cd remark-gfm-configurable\n   npm install\n   ```\n\n3. Run tests:\n\n   ```sh\n   npm test\n   ```\n\n## License\n\n[MIT](LICENSE)\n\n## Acknowledgments\n\n- [Titus Wormer](https://github.com/wooorm) for creating the original [`remark-gfm`](https://github.com/remarkjs/remark-gfm) package.\n- The [remark](https://github.com/remarkjs/remark) and [unified](https://github.com/unifiedjs/unified) communities for their invaluable work.\n","readmeFilename":"readme.md"}