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

Fixing documentation issues #211

Merged
merged 17 commits into from
Nov 8, 2018
Merged

Conversation

indifferentghost
Copy link
Contributor

Fixes most of the issues #209

can-route.html

  • misspelling aswell -> as well
  • update examples:
    • imports from can
  • remove references of hooking up route.data to HTMLElements.
  • indentation

can-route.start.html

  • codepen
  • add description
  • indentation

can-route.stop.html

  • codepen
  • add description
  • indentation

can-route.currentRule.html

  • codepen
    • move example from body to signature.
  • indentation

can-route.deparam.html

  • codepen
  • indentation
  • updated

can-route.isCurrent

  • codepen
  • added @description.
  • indentation
  • spelling agains -> against

can-route.link.html

  • codepen
    • moved example from body to signature
    • moved relevant example from body to props param.
    • updated example comments to include leading ampersand &.
  • indentation

can-route.param.html

  • codepen
    • moved example from body to signature
  • indentation

can-route.url.html

  • codepen
  • indentation

can-route.data.html

  • deprecate setting to HTMLelement
    • linked to routing guide.
  • removed complete example heading in favor of routing guide.

This includes the following documentation
- deparam
- isCurrent
- link
- param
- url

All documentation is avaliable in the doc folder.
- currentRule.md
- deparam.md
- isCurrent.md
- link.md
- param.md
- url.md
`doc/currentRule.md` needed major updates to the signature example so it
would work. This includes starting the route and adding Timeouts.

Other changes are minor refactoring to improve over all consistency.
@@ -49,7 +49,7 @@ without changing the page.

This provides the basics needed to
create history enabled single-page apps. However,
`route` addresses several other needs aswell, such as:
`route` addresses several other needs as well, such as:

- Pretty urls.
- Keeping routes independent of application code.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup and teardown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already mentions setup and teardown of Widgets - line 57. Should we mention something else?

For your convenience here's the full list:

  - Pretty urls.
  - Keeping routes independent of application code.
  - Listening to specific parts of the history changing.
  - Setup / Teardown of widgets.

doc/can-route.md Outdated Show resolved Hide resolved
doc/can-route.md Outdated Show resolved Hide resolved
doc/can-route.md Outdated Show resolved Hide resolved
doc/data.md Outdated Show resolved Hide resolved
doc/deparam.md Outdated Show resolved Hide resolved
doc/deparam.md Outdated Show resolved Hide resolved
doc/isCurrent.md Outdated Show resolved Hide resolved
doc/isCurrent.md Outdated Show resolved Hide resolved
doc/isCurrent.md Outdated Show resolved Hide resolved
doc/link.md Outdated
@@ -0,0 +1,58 @@
@function can-route.link link
@parent can-route.static
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move into a deprecated group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added deprecate .link() to #209 and put a deprecation warning on the page. Even adding a group for deprecated/can-route.deprecated and setting the group as can-route.link's parent didn't seem to work.

doc/param.md Outdated Show resolved Hide resolved
doc/param.md Outdated Show resolved Hide resolved
doc/register.md Outdated Show resolved Hide resolved
doc/register.md Outdated Show resolved Hide resolved

@return {String|undefined} Returns the [can-route.register registered] routing rule
that best matches the provided url. If no rule matches, `undefined` is returned.
Returns a string that best matches the provided url.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not quite the full url I think. We should probably call this a url fragment. We really should give people a way to get the "matched" part of the url. Can you create an issue for this?

route.urlFragment("http://foo.com/bar?zed=ted#!todoId=1") //->  "todoId=1"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to give a use case for this. I'm not sure why it got added. I bet searching for matchedRule on github might discover it. Or ask folks at Bitovi why they might use it. Generally speaking, you should be able to use the properties to figure out what page you are on. For example, see if there is a route.data.recipeId.

Copy link
Contributor Author

@indifferentghost indifferentghost Nov 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc/start.md Outdated Show resolved Hide resolved
doc/start.md Outdated Show resolved Hide resolved
doc/url.md Outdated Show resolved Hide resolved
doc/url.md Outdated Show resolved Hide resolved
doc/urlData.md Outdated Show resolved Hide resolved
doc/urlData.md Outdated Show resolved Hide resolved
This includes removing examples that have been deemed redundant.
- There were some issues creating a deprecated group in can-route.md. Added to #209.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants