octicons icon indicating copy to clipboard operation
octicons copied to clipboard

Unclear how to actually use Octicons in a project

Open dlo opened this issue 8 years ago • 4 comments

I've combed through everything and can't find a canonical example for how to use Octicons. Lots of examples are floating through the web re: how to use them in their old font form, but not with SVG. Help? 🙏

dlo avatar Mar 08 '18 18:03 dlo

The method used will depend on the language (and potentially framework) your project is using. How are you generating the HTML?

For example, if you're using Ruby with Rails, then https://github.com/primer/octicons/tree/master/lib/octicons_helper is likely to be helpful to you.

dmitshur avatar Mar 08 '18 23:03 dmitshur

Sorry, should have mentioned that. :)

I'm working with Django, and using Webpack for JS bundling.

dlo avatar Mar 09 '18 02:03 dlo

@dmitshur Sorry clearly this is an old issue but I am a novice web developer trying to incorporate Octicons into my rails project. I've installed the gem but when I use the examples like <%= octicon "chevron-right" %> and <%= octicon "alert", :height => 32, :class => "right left", :"aria-label" => "hi" %> in my .erb files I get the error "undefined method `octicon' for #<#Class:0x0000559c28d867f0:0x0000559c28d8e9c8>" Is there an extra step to importing the octicons into my erb files?

mroc170 avatar Dec 10 '19 23:12 mroc170

@mroc170 I know little about Rails, so I'm not a good person to ask.

In general, I suggest using a medium like Stack Overflow or similar to ask questions. The interface of an issue tracker is better suited for tracking bugs in a project, not for answering questions. Few people are going to see the question in a closed issue, and fewer people will be able to find existing answers.

If you believe there is a bug in this project, you should open a new issue.

dmitshur avatar Dec 11 '19 03:12 dmitshur