Skip to content

Commit

Permalink
Version 2.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Oct 16, 2018
1 parent 572c704 commit 1c658a9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. This
project adheres to [Semantic Versioning](http://semver.org/). This change log is based upon
[keep-a-changelog](https://github.com/olivierlacan/keep-a-changelog).

## [2.8.10](https://github.com/k0kubun/hamlit/compare/v2.8.8...v2.8.9) - 2018-09-05
## [2.9.0](https://github.com/k0kubun/hamlit/compare/v2.8.10...v2.9.0) - 2018-10-16

### Added

- Consider aria attribute as another attribute that supports hyphenation and boolean like data attribute.
[#57](https://github.com/k0kubun/hamlit/pull/57). *Thanks to @francesco-loreti*

## [2.8.10](https://github.com/k0kubun/hamlit/compare/v2.8.9...v2.8.10) - 2018-09-05

### Fixed

Expand Down
10 changes: 6 additions & 4 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ But some helpers are supported on Rails. Some of not-implemented methods are pla

### Limited attributes hyphenation
In Haml, `%a{ foo: { bar: 'baz' } }` is rendered as `<a foo-bar='baz'></a>`, whatever foo is.
In Hamlit, this feature is supported only for data attribute. Hamlit renders `%a{ data: { foo: 'bar' } }`
In Hamlit, this feature is supported only for aria and data attribute. Hamlit renders `%a{ data: { foo: 'bar' } }`
as `<a data-foo='bar'></a>` because it's data attribute. This design allows us to reduce work on runtime
and the idea is originally in [Faml](https://github.com/eagletmt/faml).

Expand All @@ -91,7 +91,7 @@ In Haml, `%a{ foo: false }` is rendered as `<a></a>`, whatever `foo` is.
In Hamlit, this feature is supported for only boolean attributes, which are defined by
http://www.w3.org/TR/xhtml1/guidelines.html or https://html.spec.whatwg.org/.
The list is the same as `ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES`.
In addition, data-\* is also regarded as boolean.
In addition, aria-\* and data-\* is also regarded as boolean.

Since `foo` is not boolean attribute, `%a{ foo: false }` is rendered as `<a foo='false'></a>`
This is the same behavior as Rails helpers. Also for `%a{ foo: nil }`,
Expand All @@ -102,7 +102,7 @@ is the only difference between Faml and Hamlit.
## 5 Types of Attributes

Haml has 3 types of attributes: id, class and others.
In addition, Hamlit treats data and boolean attributes specially.
In addition, Hamlit treats aria/data and boolean attributes specially.
So there are 5 types of attributes in Hamlit.

### id attribute
Expand Down Expand Up @@ -143,7 +143,7 @@ and merging multiple classes results in unique alphabetical sort.
<div class=''></div>
```

### data attribute
### aria / data attribute
Completely compatible with Haml, hyphenation and boolean are supported.

```rb
Expand All @@ -156,6 +156,8 @@ Completely compatible with Haml, hyphenation and boolean are supported.
<div data-foo='bar'></div>
```

aria attribute works in the same way as data attribute.

### boolean attributes
No hyphenation but complete boolean support.

Expand Down
2 changes: 1 addition & 1 deletion lib/hamlit/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Hamlit
VERSION = '2.8.10'
VERSION = '2.9.0'
end

0 comments on commit 1c658a9

Please sign in to comment.