vmware-archive / live-docs

Live Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Live Docs

Enables Angular based UI component libraries to embed editable code snippets win their showcase style application.

See https://vmware.github.io/vmware-cloud-director-ui-components/dataExporter for an example

This is an ng cli monorepo with two projects:

This is the project that is used from Angular applications, @vmw/live-docs. This is what is used directly by VCD's Common UI Components package

Example application

A minimal example application that showcases one of the components from @vmw/ng-live-docs. This is used mainly to be able to test changes locally without requiring a local installation of @vmw/ng-live-docs from your clone of https://github.com/vmware/vmware-cloud-director-ui-components

Background

By running a script to scour through your projects containing your UI components and their respective examples, Live Docs will be able to showcase their examples with the added benefit of a play button that opens the example in a stackblitz editor.

Features

This library is for library developers that want to write an "Examples Application" that can

  • Display source code for examples
  • Display documentation including @Inputs and @Outputs for a component
  • Allow users to run the example in stackblitz for quicker learning.

We are using Angular Material Docs as inspiration.

Running unit tests

Run ng test to execute the unit tests via Karma. Our unit tests make use of a WidgetObject pattern to minimize duplication of code accessing HTML in tests making the specs easier to read.

Publishing

We recommend that a separate PR be created when publishing a new version of the library. To publish a new version of @vmw/ng-live-docs, you must add the following anywhere in your commit message:

  • [publish @vmw/ng-live-docs] to publish @vmw/ng-live-docs@next
  • [publish @vmw/ng-live-docs@latest] to publish @vmw/ng-live-docs@latest

And modify projects/ng-live-docs/package.json

Note that @latest releases are only to be created when we release a version of VCD. Most releases, except for the final release that is used by a release of VCD, should be @next

To run dev server with simple examples

After having installed the library, you must also include Prism's CSS in your styles.scss, allowing you to choose a theme to be used.

How to use it

For Angular based libraries, please look at 'How to use it' it section of NG LiveDocs

About

Live Docs

License:Other


Languages

Language:TypeScript 86.6%Language:HTML 6.3%Language:JavaScript 5.8%Language:SCSS 1.3%