Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonspalmer committed Dec 18, 2022
1 parent fce8124 commit 1355479
Show file tree
Hide file tree
Showing 12 changed files with 186 additions and 423 deletions.
10 changes: 6 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FOr local development this is typically:
// .storybook/preview.js
export const parameters = {
server: {
url: `http://localhost:3000/rails/stories`,
url: `http://localhost:3000/rails/view_components`,
},
};
```
Expand All @@ -27,20 +27,22 @@ Story classes live in `test/components/stories`, which can be configured using t

```ruby
# config/application.rb
config.view_component_storybook.stories_path = Rails.root.join("spec/components/stories")
config.view_component_storybook.stories_paths << Rails.root.join("spec/components/stories")
```

## Stories Route

Stories are served from <http://localhost:3000/rails/stories> by default. To use a different endpoint, set the `stories_route` option:
Stories are served from the same route as ViewComponent previews <http://localhost:3000/rails/view_components> by default. To use a different endpoint, set the ViewComponent `previews_route` option:

```ruby
# config/application.rb
config.view_component_storybook.stories_route = "/stories"
config.view_component.preview_route = "/stories"
```

This example will make the previews available from <http://localhost:3000/stories>.

For more details see the [ViewCompontent `preview_route` documentation](https://viewcomponent.org/api.html#preview_route--string)

## Stories Title Generation

You may wish to customize how the title of stories are generated, this can be done by setting a custom `stories_title_generator` lambda function:
Expand Down
75 changes: 0 additions & 75 deletions docs/guide/constructor.md

This file was deleted.

119 changes: 0 additions & 119 deletions docs/guide/content.md

This file was deleted.

Loading

0 comments on commit 1355479

Please sign in to comment.