PolymerElements / iron-component-page

A reusable landing page for elements
36 stars 32 forks source link

Add deep linking #76

Closed arthurevans closed 8 years ago

arthurevans commented 8 years ago

Fixes #28.

This may not be ready for prime time, but I'm going to leave it here as a proof-of-concept if nothing else.

Requires coordinating changes in iron-doc-viewer PR#73.

Supports linking to various bits of the docs using the following URL hash formats:

#element-name
#element-name:properties (or methods, or events)
#element-name:property.propertyName (or method, or event).

For example: #dom-repeat:method.render

@frankiefu @blasten PTAL

arthurevans commented 8 years ago

Also pinging @ebidel @robdodson for good luck...

arthurevans commented 8 years ago

OK, refactored this:

My idea here, in case it's unclear, is that when running as a standalone page, iron-component-page should be solely responsible for routing. But iron-doc-viewer has direct access to the iron-doc-property elements, so it's responsible for figuring out which element the current hash represents and scrolling it into view.

In my testing, it works correctly in the catalog and in the doc site (for example, a deep link like .../1.0/api/#Polymer.Base:method-importHref should work on the doc site with this change).

robdodson commented 8 years ago

Looking over the code, everything looks OK to me. :+1:

blasten commented 8 years ago

This is looking sweet. Thanks!

arthurevans commented 8 years ago

Awesome! Thanks, @blasten! (Now go on vacation already :smile_cat:)

blasten commented 8 years ago

@arthurevans should we tag a release, so we have this feature?

arthurevans commented 8 years ago

That would be great—if you can tag iron-doc-viewer and iron-component-page, I can update the doc site with the latest goodies.

blasten commented 8 years ago

sweet. will do :)