-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Styleguide Entry helper. #28
base: master
Are you sure you want to change the base?
Conversation
…cumentation that does not directly correlate to an element.
@@ -15,5 +15,15 @@ def styleguide_block(section, &block) | |||
content = capture(&block) | |||
render 'kss/shared/styleguide_block', :section => @section, :example_html => content | |||
end | |||
|
|||
def styleguide_entry(section) | |||
raise ArgumentError, 'Missing Entry' unless section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this ArgumentError
since it'll be raised if it's not present when styleguide_entry
is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely true
I've made the changes you suggested, it also adds a requirement for ostruct (and I wasn't really sure where to add that). Let me know how that looks! |
It looks like section.section returns a NoMethodError in cases where a section is not found, and you can't set section on @section instances in the helper. I agree creating a struct feels like a bit much, but not sure what other route to take? |
In cases where there is CSS / SCSS documentation that does not directly correlate to an element, it would be nice to have a helper to simply output the text of the documentation like:
= styleguide_entry '1.1'