diff --git a/README.md b/README.md index 2e3d86d1..0aa66e54 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,24 @@ *View Components for Ruby and Rails.* -[![Gitter Chat](https://badges.gitter.im/trailblazer/chat.svg)](https://gitter.im/trailblazer/chat) -[![TRB Newsletter](https://img.shields.io/badge/TRB-newsletter-lightgrey.svg)](http://trailblazer.to/newsletter/) -[![Build +[![Zulip Chat](https://badges.gitter.im/trailblazer/chat.svg)](https://trailblazer.zulipchat.com/login/) +[![TRB Newsletter](https://img.shields.io/badge/TRB-newsletter-lightgrey.svg)](https://trailblazer.to/2.1/#callout-section) +[Build Status](https://github.com/trailblazer/cells/actions/workflows/ci.yml/badge.svg -)] +) [![Gem Version](https://badge.fury.io/rb/cells.svg)](http://badge.fury.io/rb/cells) ## Overview Cells allow you to encapsulate parts of your UI into components into _view models_. View models, or cells, are simple ruby classes that can render templates. -Nevertheless, a cell gives you more than just a template renderer. They allow proper OOP, polymorphic builders, [nesting](#nested-cells), view inheritance, using Rails helpers, [asset packaging](http://trailblazer.to/gems/cells/rails.html#asset-pipeline) to bundle JS, CSS or images, simple distribution via gems or Rails engines, encapsulated testing, [caching](#caching), and [integrate with Trailblazer](https://github.com/trailblazer/trailblazer-cells). +Nevertheless, a cell gives you more than just a template renderer. They allow proper OOP, polymorphic builders, [nesting](#nested-cells), view inheritance, using Rails helpers, [asset packaging](https://trailblazer.to/2.1/docs/cells.html#cells-rails-asset-pipeline) to bundle JS, CSS or images, simple distribution via gems or Rails engines, encapsulated testing, [caching](#caching), and [integrate with Trailblazer](https://github.com/trailblazer/trailblazer-cells). ## Full Documentation -Cells is part of the Trailblazer framework. [Full documentation](http://trailblazer.to/gems/cells) is available on the project site. +Cells is part of the Trailblazer framework. [Full documentation](https://trailblazer.to/2.1/docs/cells/) is available on the project site. -Cells is completely decoupled from Rails. However, Rails-specific functionality is to be found [here](http://trailblazer.to/gems/cells/rails.html). +Cells is completely decoupled from Rails. However, Rails-specific functionality is to be found [here](https://trailblazer.to/2.1/docs/cells/#cells-4-rails). ## Rendering Cells @@ -152,7 +152,7 @@ Capybara.string(html).must_have_css "h3" It is completely up to you how you test, whether it's RSpec, MiniTest or whatever. All the cell does is return HTML. -[In Rails, there's support](http://trailblazer.to/gems/cells/testing.html) for TestUnit, MiniTest and RSpec available, along with Capybara integration. +[In Rails, there's support](https://trailblazer.to/2.1/docs/cells/#cells-4-overview-testing) for TestUnit, MiniTest and RSpec available, along with Capybara integration. ## Properties @@ -183,7 +183,7 @@ song.title #=> "" Comment::Cell.(song).title #=> <script>Dangerous</script> ``` -Properties and escaping are [documented here](http://trailblazer.to/gems/cells/api.html#html-escaping). +Properties and escaping are [documented here](https://trailblazer.to/2.1/docs/cells/#cells-4-api-html-escaping). ## Installation @@ -271,7 +271,7 @@ end ## Asset Packaging -Cells can easily ship with their own JavaScript, CSS and more and be part of Rails' asset pipeline. Bundling assets into a cell allows you to implement super encapsulated widgets that are stand-alone. Asset pipeline is [documented here](http://trailblazer.to/gems/cells/rails.html#asset-pipeline). +Cells can easily ship with their own JavaScript, CSS and more and be part of Rails' asset pipeline. Bundling assets into a cell allows you to implement super encapsulated widgets that are stand-alone. Asset pipeline is [documented here](https://trailblazer.to/2.1/docs/cells/#cells-4-rails-asset-pipeline). ## Render API @@ -345,7 +345,7 @@ This works both in cell views and on the instance, in states. ## View Inheritance -You can not only inherit code across cell classes, but also views. This is extremely helpful if you want to override parts of your UI, only. It's [documented here](http://trailblazer.to/gems/cells/api.html#view-inheritance). +You can not only inherit code across cell classes, but also views. This is extremely helpful if you want to override parts of your UI, only. It's [documented here](https://trailblazer.to/2.1/docs/cells/#cells-4-api-view-inheritance). ## Collections @@ -358,7 +358,7 @@ cell(:comment, collection: comments).() This will invoke `cell(:comment, comment).()` three times and concatenate the rendered output automatically. -Learn more [about collections here](http://trailblazer.to/gems/cells/api.html#collection). +Learn more [about collections here](https://trailblazer.to/2.1/docs/cells/#cells-4-api-collection). ## Builder @@ -383,7 +383,7 @@ The `#cell` helper takes care of instantiating the right cell class for you. cell(:comment, Post.find(1)) #=> creates a PostCell. ``` -Learn more [about builders here](http://trailblazer.to/gems/cells/api.html#builder). +Learn more [about builders here](https://trailblazer.to/2.1/docs/cells/#cells-4-api-builder). ## Caching @@ -402,16 +402,14 @@ The `::cache` method will forward options to the caching engine. cache :show, expires_in: 10.minutes ``` -You can also compute your own cache key, use dynamic keys, cache tags, and conditionals using `:if`. Caching is documented [here](http://trailblazer.to/gems/cells/api.html#caching) and in chapter 8 of the [Trailblazer book](http://leanpub.com/trailblazer). +You can also compute your own cache key, use dynamic keys, cache tags, and conditionals using `:if`. Caching is documented [here](https://trailblazer.to/2.1/docs/cells/#cells-4-api-caching) and in chapter 8 of the [Trailblazer book](http://leanpub.com/trailblazer). ## The Book Cells is part of the [Trailblazer project](https://github.com/apotonick/trailblazer). Please [buy my book](https://leanpub.com/trailblazer) to support the development and to learn all the cool stuff about Cells. The book discusses many use cases of Cells. - -![](https://raw.githubusercontent.com/apotonick/trailblazer/master/doc/trb.jpg) - +[![trb](https://raw.githubusercontent.com/apotonick/trailblazer/master/doc/trb.jpg)](https://leanpub.com/trailblazer) * Basic view models, replacing helpers, and how to structure your view into cell components (chapter 2 and 4). * Advanced Cells API (chapter 4 and 6). @@ -423,11 +421,11 @@ The book picks up where the README leaves off. Go grab a copy and support us - i ## This is not Cells 3.x! -Temporary note: This is the README and API for Cells 4. Many things have improved. If you want to upgrade, [follow this guide](https://github.com/apotonick/cells/wiki/From-Cells-3-to-Cells-4---Upgrading-Guide). When in trouble, join the [Gitter channel](https://gitter.im/trailblazer/chat). +Temporary note: This is the README and API for Cells 4. Many things have improved. If you want to upgrade, [follow this guide](https://github.com/apotonick/cells/wiki/From-Cells-3-to-Cells-4---Upgrading-Guide). When in trouble, join the [Zulip channel](https://trailblazer.zulipchat.com/login/). ## LICENSE -Copyright (c) 2007-2015, Nick Sutterer +Copyright (c) 2007-2024, Nick Sutterer Copyright (c) 2007-2008, Solide ICT by Peter Bex and Bob Leers