URL's to iFrame demo's are relative from the docs.html instead of relative from the element.
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.

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

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
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
Hi @aomarks,
I don't think so.. The demo-src-prefix should be different per element, right?
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?
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
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": ""
}
],
Friendly ping to @aomarks 🙂
Friendly ping to @aomarks 🙂
(Sorry! 😅)