UNPKG

@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

18 lines (17 loc) 845 B
// SPDX-FileCopyrightText: 2024 Telefónica Innovación Digital // SPDX-License-Identifier: Apache-2.0 import { isStringWithLength } from "../../support/typesValidations.js"; import { DocusaurusDocPageMdx } from "../pages/DocusaurusDocPageMdx.js"; import { isNotIndexFile } from "../util/files.js"; export const DocusaurusDocTreePageMdx = class DocusaurusDocTreePageMdx extends DocusaurusDocPageMdx { constructor(path, options) { super(path, options); if (isNotIndexFile(path) && isStringWithLength(this.meta.confluenceShortName)) { options?.logger?.warn("An unnecessary confluence short name has been set for a file that is not index.md or index.mdx. This confluence short name will be ignored."); } } async visit() { return this.meta.syncToConfluence ? [this] : []; } };