Creating samples
Last updated
Last updated
The components section of the bridge catalog app consists of usage samples for each component. These samples are created using a GitHub Gist running in gist.run.
When you create a sample, you actually create a Gist.
In the top right corner of the example you find a "Play" button. When you click the "Play" button, a gist.run
instance will open in a new tab. A very convenient feature of gist.run
is the ability to create a fork. A fork is basically a copy of the current gist with a new ID.
Probably the easiest way to crate a new sample is to fork an existing one.
Assign a meaningful name to the gist (to better find it later) and click the button "fork to public gist"
The components and gist IDs of the catalog app are stored in a file names components.json
.
The button
configuration in this file looks like this:
Note there's a samples
property with a default entry basic-use
and three other properties which have gist IDs as their value.
To add a sample here, create a new property as a child of the samples
property and copy the ID of your gist from the previous section here.
If you refresh your catalog fork now, you should see a new entry on the buttons
component page and when you click on it the app should load your gist along with its source files.