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

URL's to iFrame demo's are relative from the docs.html instead of relative from the element.

Open paales opened this issue 8 years ago • 7 comments

Description

I'm trying to create a global documentation page for our app and using the polymer analyze > analysis.json and then creating a docs.html file next to our index.html. This works as it creates a the complete documentation for our app, but the paths to the demo pages are incorrect.

Expected outcome

When I generate documentation directly for the element it's self, it works as expected. screen shot 2017-08-03 at 10 23 02

Actual outcome

It uses a relative path from the docs.html file instead of the element-name.html

screen shot 2017-08-03 at 10 21 34

Live Demo

Steps to reproduce

Browsers Affected

  • [x] Chrome
  • [ ] Firefox - not tested
  • [ ] Safari 9 - not tested
  • [ ] Safari 8 - not tested
  • [ ] Safari 7 - not tested
  • [ ] Edge - not tested
  • [ ] IE 11 - not tested
  • [ ] IE 10 - not tested

paales avatar Aug 03 '17 08:08 paales

Hi @paales. Can you use the demo-src-prefix property on iron-doc-viewer to fix your demo paths?

https://www.webcomponents.org/element/PolymerElements/iron-doc-viewer/elements/iron-doc-viewer#property-demoSrcPrefix

aomarks avatar Aug 09 '17 21:08 aomarks

Hi @aomarks,

I don't think so.. The demo-src-prefix should be different per element, right?

paales avatar Aug 09 '17 22:08 paales

Oh I see. Then I suppose this is a problem with the way Analyzer outputs demo URLs? Can you show what the demo URLs look like in your analysis.json?

aomarks avatar Aug 09 '17 23:08 aomarks

I have the same issue. My case is:

my-components/
|-- bower_components/
|-- components/
|   |-- my-button/
|   |   |-- demo/
|   |   |-- test/
|   |   |-- my-button.html
|   |-- my-checkbox/
|   |   |-- ...
|   |-- ...
|-- docs/
|   |-- index.html
|   |-- analysis.json
|-- index.html

I run polymer analyze > docs/analysis.json to generate the analysis.json.

I go to http://127.0.0.1:8081/components/my-components/docs/ and everything works against the demos.

Example of demos in docs/analysis.json:

...
"demos": [
  {
    "url": "demo/index.html",
    "description": ""
  }
],
...

And the component has:

* @demo demo/index.html

abdonrd avatar Aug 10 '17 00:08 abdonrd

Oh I see. Then I suppose this is a problem with the way Analyzer outputs demo URLs? Can you show what the demo URLs look like in your analysis.json?

It are all relative paths:

"demos": [
  {
    "url": "demo/index.html",
    "description": ""
  }
],

analysis.json.zip

paales avatar Aug 10 '17 09:08 paales

Friendly ping to @aomarks 🙂

abdonrd avatar Aug 29 '17 12:08 abdonrd

Friendly ping to @aomarks 🙂

(Sorry! 😅)

abdonrd avatar Jan 20 '18 11:01 abdonrd