Skip to content

Commit

Permalink
Improve Changelog & Readme for styleguide
Browse files Browse the repository at this point in the history
  • Loading branch information
Spone committed Feb 2, 2019
1 parent b3a9580 commit 36a7578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 3 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@

## Upcoming release

**Enhancements:**
- Implement a styleguide view
- New generator: `rails g komponent:examples` to generate
an example file for each existing component

**Breaking changes:**
- Dropped support for Rails 4.2

**Enhancements:**
- Komponent now reports component stats when you run `bin/rails stats`
- Komponent now includes a styleguide engine that you can mount to your project
to document your components, and a new generator: `rails g komponent:examples`
to generate an example file for each existing component

**Bug fixes:**
- Removed redundant `class` attribute in HAML templates
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,9 @@ I18n.available_locales = [:en, :fr]
### Styleguide

Update your routes to mount the Komponent engine.
Komponent includes a basic styleguide engine that you can use in your project to document your components.

First, mount it in your routes:

```ruby
# config/routes.rb
Expand All @@ -326,12 +328,13 @@ Rails.application.routes.draw do
end
```

Then you need to update the `_example.html.slim` file you have inside your components. This file is used to render the examples.

Finally just visit to `http://localhost:3000/styleguide`.
For each component, the engine will render the `_example.html.slim` file from the component folder.
It this partial, you can describe the component and render examples for each state.

If you have existing components, you can generate all their example files at once with `rails g komponent:examples`

Finally just visit to `http://localhost:3000/styleguide`.

### Configuration

#### Change default root path
Expand Down

0 comments on commit 36a7578

Please sign in to comment.