Unverified Commit d8105f47 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by GitHub
Browse files

Merge pull request #30 from vue-leaflet/add-basic-docs

Add basic docs and vitepress
parents 6ed34842 ea1ebe00
Loading
Loading
Loading
Loading

docgen.config.js

deleted100644 → 0
+0 −31
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}
`;
    },
  },
};

docs/.nojekyll

0 → 100644
+0 −0

Empty file added.

+29 −0
Original line number Diff line number Diff line
const path = require("path");
const fs = require("fs");
const componentsFolder = path.join(__dirname, "../components/");
const examplesFolder = path.join(__dirname, "../examples/");

const components = fs
  .readdirSync(componentsFolder)
  .filter((c) => c !== "index.md");

const examples = fs.readdirSync(examplesFolder).filter((c) => c !== "index.md");

module.exports = {
  title: "Vue Leaflet",
  description: "Documentations, API, and FAQ for vue leaflet",
  themeConfig: {
    sidebar: {
      "/components/": components,
      "/examples/": examples,
    },
    nav: [
      { text: "Intro", link: "/" },
      { text: "Quickstart", link: "/quickstart/" },
      //   { text: "Components", link: "/components/" },
      //   { text: "Examples", link: "/examples/" },
      //   { text: "FAQ", link: "/faq/" },
      { text: "Plugins", link: "/plugins/" },
    ],
  },
};
+77 −0
Original line number Diff line number Diff line
---
sidebarDepth: 2
---

# Introduction

Vue Leaflet is a wrapper library for the mapping library [leaflet](https://leafletjs.com)

To easily encapsulate most of the functionality of leaflet a series of composable vue-components are provided.

::: tip
Most of our components do not emit events
but **all** the components pass down listeners for leaflets events.
It's possible to bind to them by simply writing `@leafletEventName`
:::

## Base

- [l-map](/components/LMap.md)

## Shapes

- [l-circle](/components/LCircle.md)

- [l-polygon](/components/LPolygon.md)

- [l-polyline](/components/LPolyline.md)

- [l-rectangle](/components/LRectangle.md)

## Tiles

- [l-grid-layer](/components/LGridLayer.md)

- [l-tile-layer](/components/LTileLayer.md)

- [l-wms-tile-layer](/components/LWmsTileLayer.md)

## Markers

- [l-circle-marker](/components/LCircleMarker.md)

- [l-icon-default](/components/LIconDefault.md)

- [l-icon](/components/LIcon.md)

- [l-marker](/components/LMarker.md)

## Controls

- [l-control](/components/LControl.md)

- [l-control-attribution](/components/LControlAttribution.md)

- [l-control-layers](/components/LControlLayers.md)

- [l-control-scale](/components/LControlScale.md)

- [l-control-zoom](/components/LControlZoom.md)

## Info

- [l-popup](/components/LPopup.md)

- [l-tooltip](/components/LTooltip.md)

## Grouping

- [l-feature-group](/components/LFeatureGroup.md)

- [l-layer-group](/components/LLayerGroup.md)

## Other

- [l-geo-json](/components/LGeoJson.md)

- [l-image-overlay](/components/LImageOverlay.md)

docs/examples/index.md

0 → 100644
+5 −0
Original line number Diff line number Diff line
---
sidebar: auto
---

# TODO
 No newline at end of file
Loading