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

19 lines (18 loc) 871 B
// SPDX-FileCopyrightText: 2024 Telefónica Innovación Digital // SPDX-License-Identifier: Apache-2.0 import { basename } from "node:path"; import { isStringWithLength } from "../../support/typesValidations.js"; import { DocusaurusDocPage } from "../pages/DocusaurusDocPage.js"; import { isNotIndexFile } from "../util/files.js"; export const DocusaurusDocTreePage = class DocusaurusDocTreePage extends DocusaurusDocPage { 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 ${basename(path)} that is not an index file. This confluence short name will be ignored.`); } } async visit() { return this.meta.syncToConfluence ? [this] : []; } };