Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rjfranco
Copy link

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'

…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
Copy link
Owner

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely true

@rjfranco
Copy link
Author

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!

@rjfranco
Copy link
Author

rjfranco commented Nov 8, 2013

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants