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

small documentation fixes - fixing links and spacing #9

Merged
merged 2 commits into from
Jul 24, 2018
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# can-stache-route-helpers

[![Build Status](https://travis-ci.org/donejs/can-stache-route-helpers.svg?branch=master)](https://travis-ci.org/donejs/can-stache-route-helpers)
[![Build Status](https://travis-ci.org/canjs/can-stache-route-helpers.svg?branch=master)](https://travis-ci.org/canjs/can-stache-route-helpers)

helpers for can-route

Expand Down
2 changes: 1 addition & 1 deletion can-stache-route-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ helpers.registerHelper('routeUrl',function(){
var routeCurrent = function(){

var args = calculateArgs.apply(this, arguments);
var result = route.current( args.finalParams, typeof args.finalMerge === "boolean" ? args.finalMerge : undefined );
var result = route.isCurrent( args.finalParams, typeof args.finalMerge === "boolean" ? args.finalMerge : undefined );

if( args.optionsArg && !(args.optionsArg instanceof stacheExpression.Call) ) {
if( result ) {
Expand Down
6 changes: 3 additions & 3 deletions docs/can-stache-route-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Use the `routeUrl` helper like:

```html
<a href='{{routeUrl(page="recipe" id=5)}}'>{{recipe.name}}</a>
<a href='{{ routeUrl(page="recipe" id=5) }}'>{{recipe.name}}</a>
```

This produces (with no pretty routing rules):
Expand All @@ -26,8 +26,8 @@
Use the `routeCurrent` helper like:

```html
<li {{#routeCurrent(page="recipe" id=5)}}class='active'{{/routeCurrent}}>
<a href='{{routeUrl(page="recipe" id=5)}}'>{{recipe.name}}</a>
<li {{# routeCurrent(page="recipe" id=5) }}class='active'{{/ routeCurrent }}>
<a href='{{ routeUrl(page="recipe" id=5) }}'>{{recipe.name}}</a>
</li>
```

Expand Down
20 changes: 10 additions & 10 deletions docs/routeCurrent.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@function can-stache-route-helpers.routeCurrent {{#routeCurrent(hash)}}
@function can-stache-route-helpers.routeCurrent {{# routeCurrent(hash) }}
@parent can-stache-route-helpers

Returns if the hash values match the [can-route]’s current properties.

@signature `routeCurrent( hashes... [,subsetMatch] )`

Calls [can-route.current route.current] with `hashes` and returns the result. This
Calls [can-route.isCurrent route.isCurrent] with `hashes` and returns the result. This
can be used in conjunction with other helpers:

```html
Expand All @@ -15,7 +15,7 @@ Returns if the hash values match the [can-route]’s current properties.
Or on its own:

```html
<a class="{{#routeCurrent(page='todos', true)}}active{{/routeCurrent}}">Todos</a>
<a class="{{# routeCurrent(page='todos', true) }}active{{/ routeCurrent }}">Todos</a>
```

@param {can-stache/expressions/hash} hashes A hash expression like `page='edit' recipeId=id`.
Expand All @@ -24,15 +24,15 @@ Or on its own:
return `true` if every value in `hashes` matches the current route data, even if
the route data has additional properties that are not matched.

@return {Boolean} Returns the result of calling [can-route.current route.current].
@return {Boolean} Returns the result of calling [can-route.isCurrent route.isCurrent].

@signature `{{#routeCurrent([subsetMatch,] hashes...)}}FN{{else}}INVERSE{{/routeCurrent}}`
@signature `{{# routeCurrent([subsetMatch,] hashes...) }}FN{{else}}INVERSE{{/ routeCurrent }}`

Renders `FN` if the `hashes` passed to [can-route.current route.current] returns `true`.
Renders the `INVERSE` if [can-route.current route.current] returns `false`.
Renders `FN` if the `hashes` passed to [can-route.isCurrent route.isCurrent] returns `true`.
Renders the `INVERSE` if [can-route.isCurrent route.isCurrent] returns `false`.

```html
<a class="{{#routeCurrent(true, page='todos')}}active{{/routeCurrent}}">Todos</a>
<a class="{{# routeCurrent(true, page='todos') }}active{{/ routeCurrent }}">Todos</a>
```

@param {Boolean} [subsetMatch] If an optional `true` is passed, `routeCurrent` will
Expand All @@ -59,8 +59,8 @@ Renders the `INVERSE` if [can-route.current route.current] returns `false`.
Use the `routeCurrent` helper like:

```html
<li {{#routeCurrent(page="recipe" id=5)}}class='active'{{/routeCurrent}}>
<a href='{{routeUrl(page="recipe" id=5)}}'>{{recipe.name}}</a>
<li {{# routeCurrent(page="recipe" id=5) }}class='active'{{/ routeCurrent }}>
<a href='{{ routeUrl(page="recipe" id=5) }}'>{{recipe.name}}</a>
</li>
```

Expand Down
12 changes: 6 additions & 6 deletions docs/routeUrl.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@function can-stache-route-helpers.routeUrl {{routeUrl(hashes)}}
@function can-stache-route-helpers.routeUrl {{ routeUrl(hashes) }}
@parent can-stache-route-helpers

Returns a url using [can-route.url route.url].

@signature `routeUrl( hashes... [,merge] )`

Calls [can-route.url] with `hashes` as its `data` argument and an
Calls [can-route.url route.url] with `hashes` as its `data` argument and an
optional `merge`.

This can be used on its own to create `<a>` `href`s like:
Expand All @@ -17,15 +17,15 @@ This can be used on its own to create `<a>` `href`s like:
Or in conjunction with other helpers:

```html
{{makeLink( "details", routeUrl(page='todos', true) )}}
{{ makeLink( "details", routeUrl(page='todos', true) ) }}
```

@signature `{{routeUrl([merge,] hashes...)}}`
@signature `{{ routeUrl([merge,] hashes...) }}`

Passes the hashes to `route.url` and returns the result.

```html
<a href="{{routeUrl(page='todos' id=todo.id)}}">details</a>
<a href="{{ routeUrl(page='todos' id=todo.id) }}">details</a>
```

@param {Boolean} [merge] Pass `true` to create a url that merges `hashes` into the
Expand All @@ -42,7 +42,7 @@ current [can-route] properties.
Use the `routeUrl` helper like:

```html
<a href='{{routeUrl(page="recipe" id=5)}}'>{{recipe.name}}</a>
<a href='{{ routeUrl(page="recipe" id=5) }}'>{{recipe.name}}</a>
```

This produces (with no pretty routing rules):
Expand Down