From 0293b021a921e1499ae837095e23b1be8e4e281c Mon Sep 17 00:00:00 2001 From: Dmytro Shevtsov Date: Mon, 27 Nov 2023 14:57:20 -0600 Subject: [PATCH 1/3] COMDOX-857: Add a remark plugin to support custom header id --- .remarkrc.mjs | 10 ++++------ package.json | 1 + yarn.lock | 13 ++++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.remarkrc.mjs b/.remarkrc.mjs index 85c3f3e..ecb95a2 100644 --- a/.remarkrc.mjs +++ b/.remarkrc.mjs @@ -1,3 +1,4 @@ +import remarkHeadingId from "remark-heading-id"; import remarkValidateLinks from "remark-validate-links"; import remarkFrontmatter from "remark-frontmatter"; import remarkLintFrontmatterSchema from "remark-lint-frontmatter-schema"; @@ -5,6 +6,7 @@ import remarkLintNoDeadUrls from "remark-lint-no-dead-urls"; const remarkConfig = { plugins: [ + remarkHeadingId, remarkValidateLinks, remarkFrontmatter, [ @@ -23,14 +25,10 @@ const remarkConfig = { remarkLintNoDeadUrls, { skipUrlPatterns: [ - "https://magento.biterg.io", - "https://marketplacesupport.magento.com", - "https://github.com/magento/partners-magento2ee", - "https://github.com/magento/partners-magento2b2b", - "https://www.php.net", + "https://www.php.net" ] } - ], + ] ], }; export default remarkConfig; diff --git a/package.json b/package.json index be9aced..3e7bdb0 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "devDependencies": { "remark-cli": "^10.0.1", "remark-frontmatter": "4.0.1", + "remark-heading-id": "^1.0.1", "remark-lint-frontmatter-schema": "^3.15.2", "remark-lint-no-dead-urls": "^1.1.0", "remark-validate-links": "^11.0.2" diff --git a/yarn.lock b/yarn.lock index 25f1bd7..5af09a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6768,6 +6768,7 @@ __metadata: react-dom: ^17.0.2 remark-cli: ^10.0.1 remark-frontmatter: 4.0.1 + remark-heading-id: ^1.0.1 remark-lint-frontmatter-schema: ^3.15.2 remark-lint-no-dead-urls: ^1.1.0 remark-validate-links: ^11.0.2 @@ -17445,6 +17446,16 @@ __metadata: languageName: node linkType: hard +"remark-heading-id@npm:^1.0.1": + version: 1.0.1 + resolution: "remark-heading-id@npm:1.0.1" + dependencies: + lodash: ^4.17.21 + unist-util-visit: ^1.4.0 + checksum: 20fd8072436280936dd76cf3a86d3e8e4f89bb4440863ea67d5c2ad27b74e858350aaf5a56a292bdb7f99c28fa823a83d8cfac87bfc410ebb39d23594d5905d8 + languageName: node + linkType: hard + "remark-lint-frontmatter-schema@npm:^3.15.2": version: 3.15.2 resolution: "remark-lint-frontmatter-schema@npm:3.15.2" @@ -20328,7 +20339,7 @@ __metadata: languageName: node linkType: hard -"unist-util-visit@npm:^1.0.0, unist-util-visit@npm:^1.1.0, unist-util-visit@npm:^1.4.1": +"unist-util-visit@npm:^1.0.0, unist-util-visit@npm:^1.1.0, unist-util-visit@npm:^1.4.0, unist-util-visit@npm:^1.4.1": version: 1.4.1 resolution: "unist-util-visit@npm:1.4.1" dependencies: From 2b6145c31c4a5f3ff15b095ae18f7d210b884bdd Mon Sep 17 00:00:00 2001 From: Dmytro Shevtsov Date: Mon, 27 Nov 2023 15:07:13 -0600 Subject: [PATCH 2/3] Revert skipUrlPatterns --- .remarkrc.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.remarkrc.mjs b/.remarkrc.mjs index ecb95a2..edcc272 100644 --- a/.remarkrc.mjs +++ b/.remarkrc.mjs @@ -25,8 +25,11 @@ const remarkConfig = { remarkLintNoDeadUrls, { skipUrlPatterns: [ - "https://www.php.net" - ] + "https://magento.biterg.io", + "https://marketplacesupport.magento.com", + "https://github.com/magento/partners-magento2ee", + "https://github.com/magento/partners-magento2b2b", + "https://www.php.net" ] } ] ], From 70ddf30aee0e79f32036c4b3387bd166480026e5 Mon Sep 17 00:00:00 2001 From: Dmytro Shevtsov Date: Mon, 27 Nov 2023 15:08:14 -0600 Subject: [PATCH 3/3] Formatting --- .remarkrc.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.remarkrc.mjs b/.remarkrc.mjs index edcc272..94de61d 100644 --- a/.remarkrc.mjs +++ b/.remarkrc.mjs @@ -29,7 +29,8 @@ const remarkConfig = { "https://marketplacesupport.magento.com", "https://github.com/magento/partners-magento2ee", "https://github.com/magento/partners-magento2b2b", - "https://www.php.net" ] + "https://www.php.net" + ] } ] ],