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

Remove trailing period from Styleguide section in examples and tests #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A button suitable for giving stars to someone.
.stars-given:hover - Subtle hover highlight on top of stars-given styling.
.disabled - Dims the button to indicate it cannot be used.

Styleguide 2.1.3.
Styleguide 2.1.3
*/
a.button.star{
...
Expand All @@ -33,9 +33,9 @@ a.button.star.disabled{

KSS can also support words as Styleguide section names
```scss
// Styleguide Forms.Checkboxes.
// Styleguide Forms.Checkboxes
// - or -
// Styleguide Forms - Special Checkboxes.
// Styleguide Forms - Special Checkboxes
```

## Ruby Library [![Build Status](https://travis-ci.org/kneath/kss.png)](https://travis-ci.org/kneath/kss) [![Code Climate](https://codeclimate.com/github/kneath/kss.png)](https://codeclimate.com/github/kneath/kss)
Expand Down
8 changes: 4 additions & 4 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A button suitable for giving stars to someone.
.stars-given:hover - Subtle hover highlight on top of stars-given styling.
.disabled - Dims the button to indicate it cannot be used.

Styleguide 2.1.3.
Styleguide 2.1.3
*/
a.button.star{
...
Expand All @@ -50,7 +50,7 @@ When using a preprocessor that supports the functionality, use `//` to prefix yo
// .stars-given:hover - Subtle hover highlight on top of stars-given styling.
// .disabled - Dims the button to indicate it cannot be used.
//
// Styleguide 2.1.3.
// Styleguide 2.1.3
a.button.star{
...
&.star-given{
Expand Down Expand Up @@ -106,15 +106,15 @@ If the UI element you are documenting has multiple states or styles depending on
If the UI element you are documenting has an example in the styleguide, you should reference it using the "Styleguide [ref]" syntax.

```scss
// Styleguide 2.1.3.
// Styleguide 2.1.3
```

References can be integer sections separated by periods. Each period denotes a hierarchy of the styleguide. Styleguide references can point to entire sections, a portion of the section, or a specific example.

References may also be period seperated word keys. Leading words denote hierarchy.

```scss
// Styleguide Forms.Checkboxes.
// Styleguide Forms.Checkboxes
```

Finally, references may be more readable word phrases.
Expand Down
14 changes: 11 additions & 3 deletions test/fixtures/css/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Your standard form button.
.primary - Indicates button is the primary action.
.smaller - A little bit smaller now.

Styleguide 2.1.1.
Styleguide 2.1.1
*/
button {
padding: 5px 15px; }
Expand All @@ -26,7 +26,7 @@ A button suitable for giving stars to someone.
.star-given - A highlight indicating you've already given a star.
.disabled - Dims the button to indicate it cannot be used.

Styleguide 2.2.1.
Styleguide 2.2.1
*/
a.button.star {
display: inline-block; }
Expand All @@ -37,12 +37,20 @@ a.button.star {
a.button.star.disabled {
opacity: 0.5; }

/*
Test that trailing period is stripped from the reference.

Styleguide 2.2.2.
*/
a.button.trailing:after {
content: '.'; }

/*
A big button

.really-big - Even bigger button

Styleguide Buttons.Big.
Styleguide Buttons.Big
*/
a.button.big {
display: inline-block;
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/less/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Your standard form button.
.primary - Indicates button is the primary action.
.smaller - A little bit smaller now.

Styleguide 2.1.1.
Styleguide 2.1.1
*/
button, .button {
padding:5px 15px;
Expand Down Expand Up @@ -34,7 +34,7 @@ A button suitable for giving stars to someone.
.star-given - A highlight indicating you've already given a star.
.disabled - Dims the button to indicate it cannot be used.

Styleguide 2.2.1.
Styleguide 2.2.1
*/
a.button.star{
display:inline-block;
Expand All @@ -55,7 +55,7 @@ A big button

.really-big - Even bigger button

Styleguide Buttons.Big.
Styleguide Buttons.Big
*/
a.button.big {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/less/mixins.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Your standard grid helper.

Styleguide 4.0.0.
Styleguide 4.0.0
*/
.grid(@columns, @max: 10) {
width: (@columns / @max) * 960px;
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/sass/buttons.sass
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* .primary - Indicates button is the primary action.
* .smaller - A little bit smaller now.
*
* Styleguide 2.1.1. */
* Styleguide 2.1.1 */
button
padding: 5px 15px

Expand All @@ -26,7 +26,7 @@ button
// .star-given - A highlight indicating you've already given a star.
// .disabled - Dims the button to indicate it cannot be used.
//
// Styleguide 2.2.1.
// Styleguide 2.2.1
a.button.star
display: inline-block

Expand All @@ -43,7 +43,7 @@ a.button.star
//
// .really-big - A really big button
//
// Styleguide Buttons.Big.
// Styleguide Buttons.Big
a.button.big
display: inline-block;
font-size: 10em;
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/scss/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// .primary - Indicates button is the primary action.
// .smaller - A little bit smaller now.
//
// Styleguide 2.1.1.
// Styleguide 2.1.1
button{
padding:5px 15px;

Expand All @@ -31,7 +31,7 @@ button{
// .star-given - A highlight indicating you've already given a star.
// .disabled - Dims the button to indicate it cannot be used.
//
// Styleguide 2.2.1.
// Styleguide 2.2.1
a.button.star{
display:inline-block;

Expand All @@ -50,7 +50,7 @@ a.button.star{
//
// .really-big - Even bigger button
//
// Styleguide Buttons.Big.
// Styleguide Buttons.Big
a.button.big {
display: inline-block;
font-size: 10em;
Expand Down
7 changes: 6 additions & 1 deletion test/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ def setup
@css_parsed.section('2.1.1').description
end

test "parses KSS keys that have a trailing period" do
assert_equal 'Test that trailing period is stripped from the reference.',
@css_parsed.section('2.2.2').description
end

test "parses KSS keys that are words in CSS" do
assert_equal 'A big button',
@css_parsed.section('Buttons.Big').description
Expand All @@ -76,7 +81,7 @@ def setup
end

test "public sections returns hash of sections" do
assert_equal 5, @css_parsed.sections.count
assert_equal 6, @css_parsed.sections.count
end

test "parse multiple paths" do
Expand Down
2 changes: 1 addition & 1 deletion test/section_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setup
.primary - Indicates button is the primary action.
.smaller - A smaller button

Styleguide 2.1.1.
Styleguide 2.1.1
comment

@section = Kss::Section.new(@comment_text, 'example.css')
Expand Down