Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup a Remark plugin to replace [detekt_version] with the current ve…
…rsion on website (#5001)
- Loading branch information
Showing
11 changed files
with
25 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const visit = require("unist-util-visit"); | ||
|
||
// Remark plugin that is replacing the [detekt_version] with the latest | ||
// released version. Please note that this field is updated automatically | ||
// by the `:detekt-generator:generateDocumentation` task. | ||
const detektVersion = "1.21.0-RC1"; | ||
|
||
const plugin = (options) => { | ||
const transformer = async (ast) => { | ||
visit(ast, "code", (node) => { | ||
if (node.value.includes("[detekt_version]")) { | ||
node.value = node.value.replace("[detekt_version]", detektVersion); | ||
} | ||
}); | ||
}; | ||
return transformer; | ||
}; | ||
|
||
module.exports = plugin; |