Refactoring nodejs api and making more options available #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a little bit of an overhaul of the nodejs api, and an upgrade!
What I'm doing is making the api more like the
octicons_gem
api. With the ability to scale and add classes to the svg via the node api.Here's the docs I added to the readme, that makes this repo more powerful.
After installing
npm install octicons
you can access the icons like this.There will be a key for every icon, with
keywords
andsvg
.octicons.alert.symbol
Returns the string of the symbol name
octicons.person.path
Path returns the string representation of the path of the icon.
octicons.issue.options
This is a json object of all the
options
that will be added to the output tag.octicons.alert.width
Width is the icon's true width. Based on the svg view box width. Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon
octicons.alert.height
Height is the icon's true height. Based on the svg view box height. Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon
keywords
Returns an array of keywords for the icon. The data comes from the octicons repository. Consider contributing more aliases for the icons.
octicons.alert.toSVG()
Returns a string of the svg tag
The
.toSVG()
method accepts an optionaloptions
object. This is used to add CSS classnames, a11y options, and sizing.class
Add more CSS classes to the
<svg>
tag.aria-label
Add accessibility
aria-label
to the icon.width & height
Size the SVG icon larger using
width
&height
independently or together.