🚀 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();
🚀 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
ExampleInformationand use them to create a command line "book" of examples that can be stepped through.Details
You can get all these matching keys using
informationKeyswill be an array of stringsYou can get the source of an individual key using
This will be a string of the original source for the example, however, if you use:
Then I have applied some clean up steps to the source so that it is more readable.
To get the related
VNodefor an example, you can use: