@telefonica/markdown-confluence-sync
Version:
Creates/updates/deletes Confluence pages based on markdown files in a directory. Supports Mermaid diagrams and per-page configuration using frontmatter metadata. Works great with Docusaurus
25 lines (24 loc) • 648 B
JavaScript
// SPDX-FileCopyrightText: 2024 Telefónica Innovación Digital
// SPDX-License-Identifier: Apache-2.0
function composeNotice(message) {
return {
type: "element",
tagName: "p",
children: [
{
type: "element",
tagName: "strong",
children: [{ type: "raw", value: message }],
},
],
};
}
/**
* UnifiedPlugin to add a notice to the AST.
*/
const rehypeAddNotice = function rehypeAddNotice(options) {
return function (tree) {
tree.children.unshift(composeNotice(options.noticeMessage));
};
};
export default rehypeAddNotice;