Create the logic
Add a new file following this convention:
new is a single verb indicating the context the segment renders.
You can use the following template as a guide.
When it comes to properties, make sure to use the UTF32 representation (e.g. "\uEFF1") rather than the icon itself. This will facilitate the review process as not all environments display the icons based on the font being used. You can find these values and query for icons easily at Nerd Fonts.
For each segment, there's a single test file ensuring the functionality going forward. The convention
new_segment_test.go, have a look at existing segment tests for inspiration.
Create a name for your Segment
Add your segment.
Add the SegmentType mapping
SegmentType to your Segment in the
Test your functionality
Even with unit tests, it's a good idea to build and validate the changes.
First, we need to package the init scripts:
Next, build the app and validate the changes:
Add the documentation
Create a new
markdown file underneath the
docs/docs folder called
Use the following template as a guide.
Map the new documentation in the sidebar
sidebars.js and add your document id (
new) to the items of the Segments category.
Add the JSON schema
themes/schema.json file to add your segment.
$.definitions.segment.properties.type.enum, add your
SegmentType to the array:
$.definitions.segment.allOf, add your segment details:
Create a pull request
And be patient, I'm going as fast as I can 🏎