Commit aa7fcc0e authored by Michael Underwood's avatar Michael Underwood
Browse files

Install and configure vue-docgen

parent e72397a7
Loading
Loading
Loading
Loading

docgen.config.js

0 → 100644
+31 −0
Original line number Diff line number Diff line
module.exports = {
  componentsRoot: "src/components",
  components: "**/[A-Z]*.vue",
  outDir: "./docs/components",
  defaultExamples: false,
  templates: {
    component: (renderedUsage, doc) => {
      const { displayName, description, docsBlocks, tags, functional } = doc;
      const { deprecated, author, since, version, see, link } = tags || {};
      return `
---
title: ${displayName}
---
# ${deprecated ? `~~${displayName}~~` : displayName}
${deprecated ? `> **Deprecated** ${deprecated[0].description}\n` : ""}
${description ? "> " + description : ""}
${functional ? renderedUsage.functionalTag : ""}
${author ? author.map((a) => `Author: ${a.description}\n`) : ""}
${since ? `Since: ${since[0].description}\n` : ""}
${version ? `Version: ${version[0].description}\n` : ""}
${see ? see.map((s) => `[See](${s.description})\n`) : ""}
${link ? link.map((l) => `[See](${l.description})\n`) : ""}
${docsBlocks ? "---\n" + docsBlocks.join("\n---\n") : ""}
${renderedUsage.props}
${renderedUsage.methods}
${renderedUsage.events}
${renderedUsage.slots}
`;
    },
  },
};
+1 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
    "rollup-plugin-vue": "^6.0.0-beta.11",
    "vitepress": "^0.6.0",
    "vue": "^3.0.0",
    "vue-docgen-cli": "^4.34.2",
    "vue-router": "^4.0.0-rc.5"
  },
  "husky": {
+402 −6

File changed.

Preview size limit exceeded, changes collapsed.