iron-doc-viewer icon indicating copy to clipboard operation
iron-doc-viewer copied to clipboard

Would like to link to a different doc page

Open morethanreal opened this issue 10 years ago • 8 comments

I would like to refer to a the docs for a different element (potentially in the same repository) from a doc page.

morethanreal avatar May 26 '15 20:05 morethanreal

Me too!

atotic avatar May 26 '15 22:05 atotic

Is there a reason not to just use full markdown links?

On Wed, May 27, 2015, 9:32 AM Aleksandar Totic [email protected] wrote:

Assigned #34 https://github.com/PolymerElements/iron-doc-viewer/issues/34 to @mbleigh https://github.com/mbleigh.

— Reply to this email directly or view it on GitHub https://github.com/PolymerElements/iron-doc-viewer/issues/34#event-315102014 .

mbleigh avatar May 27 '15 16:05 mbleigh

How do we refer to docs for a different element? Will there be a canonical url somewhere on polymer-project? Even then, there are multiple versions.....

On Wed, May 27, 2015 at 9:55 AM, Michael Bleigh [email protected] wrote:

Is there a reason not to just use full markdown links?

On Wed, May 27, 2015, 9:32 AM Aleksandar Totic [email protected] wrote:

Assigned #34 https://github.com/PolymerElements/iron-doc-viewer/issues/34 to @mbleigh https://github.com/mbleigh.

— Reply to this email directly or view it on GitHub < https://github.com/PolymerElements/iron-doc-viewer/issues/34#event-315102014

.

— Reply to this email directly or view it on GitHub https://github.com/PolymerElements/iron-doc-viewer/issues/34#issuecomment-105992632 .

atotic avatar May 27 '15 18:05 atotic

Yes, there will be canonical urls. I think versioning is something to worry about down the road

On Wed, May 27, 2015, 11:01 AM Aleksandar Totic [email protected] wrote:

How do we refer to docs for a different element? Will there be a canonical url somewhere on polymer-project? Even then, there are multiple versions.....

On Wed, May 27, 2015 at 9:55 AM, Michael Bleigh [email protected] wrote:

Is there a reason not to just use full markdown links?

On Wed, May 27, 2015, 9:32 AM Aleksandar Totic <[email protected]

wrote:

Assigned #34 https://github.com/PolymerElements/iron-doc-viewer/issues/34 to @mbleigh https://github.com/mbleigh.

— Reply to this email directly or view it on GitHub <

https://github.com/PolymerElements/iron-doc-viewer/issues/34#event-315102014

.

— Reply to this email directly or view it on GitHub < https://github.com/PolymerElements/iron-doc-viewer/issues/34#issuecomment-105992632

.

— Reply to this email directly or view it on GitHub https://github.com/PolymerElements/iron-doc-viewer/issues/34#issuecomment-106014618 .

mbleigh avatar May 27 '15 19:05 mbleigh

See also #9. I think the correct solution from a tool point of view is to allow the author to link to ArbitraryElement with some specific syntax, like ArbitraryElement or {@link ArbitraryElement} and have hydrolysis/a doc merger script/some other tool resolve those links when you generate a batch of docs.

arthurevans avatar Jun 09 '15 23:06 arthurevans

I think this already works with markdown, both with absolute and relative paths (to the current element). See https://github.com/PolymerElements/iron-icon/blob/master/iron-icon.html#L55 for an example.

notwaldorf avatar Jan 27 '16 00:01 notwaldorf

This kinda works now, but it works more or less by accident. It works because in the catalog, each element has a path like elements/foo-element... Provided that the element is the main element in a package. (You can't, for example, link to [paper-textarea](paper-textarea) and have it work, because the URL for that is elements/paper-input?active=paper-textarea.

You can embed the catalog-specific URL in your doc, but then you can't serve it statically, where the URL will be something like:

my-elements.html#iron-icons

And if you want to link to a specific property on a specific element, getouttatown.

So, my napkin-sketch of how this could work:

  1. hydrolysis resolves {@link iron-input} or {@link iron-input#property-type} to a reference to a particular element or member and inserts (something) in the markup.

Or:

1a. We insert the (something) directly in the markup, in the form of, say, a special URL:

  [iron-input](api:iron-input)
  1. iron-doc-viewer intercepts anchor clicks for api: URLs and fires an event.

  2. iron-component-page or the router of choice receives that event, translates it to the URL scheme in use, and navigates to it.

arthurevans avatar Jan 27 '16 00:01 arthurevans

I'm fine with this being a low priority for now but I do think we need to solve it eventually. Probably blocked by: https://github.com/PolymerElements/iron-component-page/issues/57

arthurevans avatar Jan 27 '16 00:01 arthurevans