-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
🚀 Feature Proposal
Using import * as Examples from "@virtualstate/examples" you can access all the examples available from this repository.
This proposal is to use all the objects available with keys ending with ExampleInformation and use them to create a command line "book" of examples that can be stepped through.
Details
You can get all these matching keys using
import * as Examples from "@virtualstate/examples";
const informationKeys = Object.keys(Examples)
.filter(key => key.endsWith("ExampleInformation");informationKeys will be an array of strings
You can get the source of an individual key using
const { source } = Examples[key];This will be a string of the original source for the example, however, if you use:
const { cleanerSource } = Examples[key];Then I have applied some clean up steps to the source so that it is more readable.
To get the related VNode for an example, you can use:
const node = await Examples[key].import();Metadata
Metadata
Assignees
Labels
No labels