{"id":21094190,"url":"https://github.com/archakov06/editorjs-github-gist-plugin","last_synced_at":"2026-03-19T18:50:31.562Z","repository":{"id":111887229,"uuid":"289338340","full_name":"Archakov06/editorjs-github-gist-plugin","owner":"Archakov06","description":"Github Gist plugin for Editor.js","archived":false,"fork":false,"pushed_at":"2020-07-15T20:04:27.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-01T01:45:27.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":false,"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/Archakov06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-21T18:26:52.000Z","updated_at":"2025-08-29T04:52:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"d16b5b3b-ef45-4155-a173-4468725bc24b","html_url":"https://github.com/Archakov06/editorjs-github-gist-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Archakov06/editorjs-github-gist-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Feditorjs-github-gist-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Feditorjs-github-gist-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Feditorjs-github-gist-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Feditorjs-github-gist-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Archakov06","download_url":"https://codeload.github.com/Archakov06/editorjs-github-gist-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Archakov06%2Feditorjs-github-gist-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30619218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T08:10:05.930Z","status":"ssl_error","status_checked_at":"2026-03-17T08:10:04.972Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-11-19T22:16:40.444Z","updated_at":"2026-03-17T08:38:35.413Z","avatar_url":"https://github.com/Archakov06.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://badgen.net/badge/Editor.js/v2.0/blue)\n\n# Github Gist Plugin for Editor.js\n\nA plugin to add Github Gists to [Editor.js](https://editorjs.io).\n\n### Import Note \nOnly paste the URL in `\u003cscript\u003e` tag not the entire `\u003cscript\u003e` tag.  \n\nFor example, In `\u003cscript src=\"https://gist.github.com/username/gist_id.js\"\u003e\u003c/script\u003e`, only paste the URL inside the \u003cb\u003esrc\u003c/b\u003e attribute i.e. `https://gist.github.com/username/gist_id.js`.\n\n## Screenshot\n\n![Github Gist Plugin](https://img.imageupload.net/2020/07/09/github-gist-plugin.png)\n\n## Features\n\n- Add Gists by pasting its URL.\n- Add an optional Caption explaining the Gist.\n- Specify the height of the added Gist.\n- A preview of the uploaded Gist will be presented.\n- Error will be thrown on invalid URL input or invalid Gist ID.\n\n## Installation\n\n### Install via NPM\nGet the package\n\n```shell\nnpm i editorjs-github-gist-plugin\n```\n\nInclude module at your application\n\n```javascript\nimport Gist from 'editorjs-github-gist-plugin';\n```\n\n### Other methods\n\n#### Manual downloading and connecting\n\n1. Download folder `dist` from repository\n2. Add `dist` folder to your page.\n3. Import `main.js` file inside the `dist` folder.\n\n## Usage\n\nAdd the plugin to the `tools` property of the Editor.js initial config as a new tool.\n\n```javascript\nimport Gist from 'editorjs-github-gist-plugin';\n\nvar editor = EditorJS({\n  ...\n\n  tools: {\n    ...\n    gist: Gist\n  }\n\n  ...\n});\n```\n\n## Output data\n\nThis Plugin/Tool returns `data` with following format:\n\n| Field | Type     | Description        |\n| ----- | -------- | ------------------ |\n| url | `string` | URL of the Github Gist added |\n| caption | `string` | Caption for the Gist |\n| height | `number` | The fixed height of the Gist |\n\nExample:\n\n```json\n{\n    \"type\": \"gist\",\n    \"data\": {\n        \"url\": \"https://gist.github.com/AdeilsonESilva/7ddb4c0f156f20d2642d0414777cff85.js\",\n        \"caption\": \"Get items in array.\",\n        \"height\": 450\n    }\n}\n```\n\n## Preview\n\nThe preview in the block is shown using an `iframe` tag in which the link to the Github Gist is provided as `srcdoc` property.  \nThis way of adding scripts can be helpful for some environments or frameworks in which adding a direct script tag is not permitted or throws an error for example, Vue.js.  \n\nThe code below is how a Github Gist is embedded in `iframe` element which can be helpful if one wants to use the gists same way.\n\n```javascript\nconst iframe = document.createElement('iframe');\n/**\n * Adds the gist as  a srcdoc.\n */\niframe.srcdoc = `\u003cscript src=\"${url}\"\u003e\u003c/script\u003e`;\n\n/**\n* Removes the borders of the inline-frame\n*/\niframe.frameBorder = 0;\n\niframe.addEventListener('load', function () {\n    /**\n     * Sets the height of the inline frame equal to the height of the Gist.\n     */\n    this.style.height = this.contentWindow.document.body.scrollHeight + 16 + 'px';\n\n    /**\n     * Makes all the links in the inline-frame on click, to open in a new tab of the browser \n     * rather than inside the inline-frame itself.\n    */\n    const links = this.contentWindow.document.getElementsByTagName('a');\n\n    for (let i = 0; i \u003c links.length; i++) {\n        links[i].setAttribute('target', '_blank');\n    }\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchakov06%2Feditorjs-github-gist-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchakov06%2Feditorjs-github-gist-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchakov06%2Feditorjs-github-gist-plugin/lists"}