{"id":24283557,"url":"https://github.com/polymerelements/iron-doc-viewer","last_synced_at":"2025-04-24T04:16:31.856Z","repository":{"id":29842265,"uuid":"33387023","full_name":"PolymerElements/iron-doc-viewer","owner":"PolymerElements","description":"Polymer documentation viewer elements","archived":false,"fork":false,"pushed_at":"2025-03-10T23:46:26.000Z","size":857,"stargazers_count":17,"open_issues_count":26,"forks_count":16,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-04-24T04:16:26.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolymerElements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2015-04-03T23:11:28.000Z","updated_at":"2020-03-09T18:21:44.000Z","dependencies_parsed_at":"2022-08-31T00:01:36.975Z","dependency_job_id":"ca831ff8-1a90-4d0a-a049-735ee27934d9","html_url":"https://github.com/PolymerElements/iron-doc-viewer","commit_stats":{"total_commits":465,"total_committers":31,"mean_commits":15.0,"dds":0.6731182795698925,"last_synced_commit":"d62e80b011ad560851bf7e832becd72189224e34"},"previous_names":[],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-doc-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-doc-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-doc-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolymerElements%2Firon-doc-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolymerElements","download_url":"https://codeload.github.com/PolymerElements/iron-doc-viewer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250560057,"owners_count":21450173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-16T04:15:57.353Z","updated_at":"2025-04-24T04:16:31.833Z","avatar_url":"https://github.com/PolymerElements.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-doc-viewer.svg)](https://www.npmjs.com/package/@polymer/iron-doc-viewer)\n[![Build status](https://travis-ci.org/PolymerElements/iron-doc-viewer.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-doc-viewer)\n[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-doc-viewer)\n\n## \u0026lt;iron-doc-viewer\u0026gt;\n\nA collection of elements that display documentation about custom elements,\nmixins, classes, and more using the JSON descriptor format produced by [Polymer\nAnalyzer](https://github.com/Polymer/polymer-analyzer).\n\nSee:\n[Documentation](https://www.webcomponents.org/element/@polymer/iron-doc-viewer),\n[Demo](https://www.webcomponents.org/element/@polymer/iron-doc-viewer/demo/demo/index.html).\n\nYou may also be interested in\n[`\u003ciron-component-page\u003e`](https://github.com/PolymerElements/iron-component-page),\nwhich composes the iron-doc elements into a more complete documentation\nbrowser.\n\n### Elements\n\n* `\u003ciron-doc-nav\u003e` Show a table-of-contents.\n* `\u003ciron-doc-viewer\u003e` Manage routing and delegate to a child doc element.\n* `\u003ciron-doc-element\u003e` Show docs about a custom element.\n* `\u003ciron-doc-behavior\u003e` Show docs about a Polymer behavior.\n* `\u003ciron-doc-namespace\u003e` Show docs about a JavaScript namespace.\n* `\u003ciron-doc-class\u003e` Show docs about a JavaScript class.\n* `\u003ciron-doc-mixin\u003e` Show docs about a JavaScript mixin.\n\n## Usage\n\n### Installation\n```\nnpm install --save @polymer/iron-doc-viewer\n```\n\n### In an html file\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@polymer/polymer/lib/elements/dom-bind.js';\n      import '@polymer/iron-ajax/iron-ajax.js';\n      import '@polymer/iron-doc-viewer/iron-doc-viewer.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cdom-bind\u003e\n      \u003ctemplate\u003e\n        \u003ciron-ajax\n          auto\n          url=\"./analysis.json\"\n          last-response=\"{{descriptor}}\"\u003e\n        \u003c/iron-ajax\u003e\n\n        \u003ciron-doc-viewer\n          descriptor=\"[[descriptor]]\"\n          root-namespace=\"MyNamespace\"\u003e\n        \u003c/iron-doc-viewer\u003e\n      \u003c/template\u003e\n    \u003c/dom-bind\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### In a Polymer 3 element\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@polymer/iron-doc-viewer/iron-doc-viewer.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n      \u003ciron-doc-viewer\n        descriptor=\"[[descriptor]]\"\n        root-namespace=\"MyNamespace\"\u003e\n      \u003c/iron-doc-viewer\u003e\n    `;\n  },\n\n  static get properties() {\n    return {\n      descriptor: {\n        type: Object,\n        value: {\n          // Analyzer descriptor goes here.\n        }\n      }\n    };\n  }\n}\n\ncustomElements.define('sample-element', SampleElement);\n```\n\n### Routing\n\n`\u003ciron-doc-viewer\u003e` handles URL routing to provide permanent addresses for all\nlocations in the documentation tree, including scroll anchor targets.\n\nBy default it uses the URL fragment for routing (e.g.\n`docs.html#/elements/my-element#property-foo`), in order to support simple\nstatic file hosts.\n\nTo use the real URL path for routing, set the `base-href` property to the\nserver mount point, omitting the trailing slash (e.g. `/api/docs` or *empty\nstring* for the root path). Note that this requires a host that serves the\napplication from all paths that should be handled by the doc viewer.\n\n### Styling\n\nThe iron-doc elements come with an optional material-design default theme that\nmust be explicitly included as custom style:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import '@polymer/iron-doc-viewer/default-theme.js';\n\u003c/script\u003e\n\n\u003ccustom-style\u003e\n  \u003cstyle is=\"custom-style\" include=\"iron-doc-default-theme\"\u003e\u003c/style\u003e\n\u003c/custom-style\u003e\n```\n\nThe following custom properties and mixins are available for styling:\n\nCustom property | Description | Default\n----------------|-------------|----------\n`--iron-doc-accent-color` | Color for emphasis (e.g. hyperlink hover). | `#1565c0`\n`--iron-doc-font-body` | Mixin applied to non-code text. | `{}`\n`--iron-doc-font-code` | Mixin applied to code snippets. | `{}`\n`--iron-doc-title` | Mixin applied to page titles. | `{}`\n`--iron-doc-heading` | Mixin applied to section headings. | `{}`\n\n## Contributing\nIf you want to send a PR to this element, here are\nthe instructions for running the tests and demo locally:\n\n### Installation\n```sh\ngit clone https://github.com/PolymerElements/iron-doc-viewer\ncd iron-doc-viewer\nnpm install\nnpm install -g polymer-cli\n```\n\n### Running the demo locally\n```sh\npolymer serve --npm\nopen http://127.0.0.1:\u003cport\u003e/demo/\n```\n\n### Running the tests\n```sh\npolymer test --npm\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-doc-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolymerelements%2Firon-doc-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolymerelements%2Firon-doc-viewer/lists"}