{"id":27103139,"url":"https://github.com/studiole/readgithub","last_synced_at":"2025-04-06T16:39:30.117Z","repository":{"id":25934153,"uuid":"29375510","full_name":"StudioLE/readgithub","owner":"StudioLE","description":"A jQuery plugin to load files from GitHub","archived":false,"fork":false,"pushed_at":"2023-04-16T01:31:37.000Z","size":178,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T11:04:26.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StudioLE.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-17T01:20:49.000Z","updated_at":"2022-10-28T15:25:29.000Z","dependencies_parsed_at":"2022-09-01T13:31:27.862Z","dependency_job_id":null,"html_url":"https://github.com/StudioLE/readgithub","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Freadgithub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Freadgithub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Freadgithub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StudioLE%2Freadgithub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StudioLE","download_url":"https://codeload.github.com/StudioLE/readgithub/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247516705,"owners_count":20951707,"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-04-06T16:39:29.620Z","updated_at":"2025-04-06T16:39:30.112Z","avatar_url":"https://github.com/StudioLE.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# readGitHub.js\n\nA jQuery plugin to load GitHub files into your page\n\n## Install\n\nPackages are available via Bower and NPM\n\n```\nnpm install --save readgithub\n```\n\n```\nbower install --save readgithub\n```\n\n## Use\n\nInclude `dist/css/readgithub.css` and `dist/js/readgithub.js` in your page, ensuring jQuery is loaded first.\n\n``` html\n\u003c!-- css --\u003e\n\u003clink rel=\"stylesheet\" href=\"bower_components/readgithub/dist/css/readgithub.css\"\u003e\n\u003c!-- jQuery --\u003e\n\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"\u003e\u003c/script\u003e\n\u003c!-- readGitHub --\u003e\n\u003cscript src=\"bower_components/readgithub/dist/js/readgithub.js\"\u003e\u003c/script\u003e\n```\n\nAdd the following line whereever you would like to render a file from GitHub:\n\n``` html\n\u003cdiv rel=\"github\" data-repo=\"username/repository\"\u003e\u003c/div\u003e\n```\n\nFinally, call the readGitHub method in your javascript\n\n``` js\n$(document).ready(function() {\n\t$('[rel~=\"github\"]').readGitHub()\n})\n```\n\nreadGitHub will look for the `rel=\"github\"` and read the requested repository from `data-repo`.\n\n\n## Configuration\n\nA number of configuration options are available. One of the most powerful features is the option to use a renderer. For instance you can declare a Markdown render, read your `README.md` and readGitHub will load and convert your `.md` as html.\n\n### Using a renderer\n\n``` js\n$('[rel~=\"github\"]').readGitHub({\n\trenderer: function(file) {\n\t\t// Your render function\n\t\treturn file\n\t}\n})\n```\n\nFor instance to render with markdown-it include the script before `readGitHub.js`.\n\n``` html\n\u003c!-- markdown-it --\u003e\n\u003cscript src=\"//cdnjs.cloudflare.com/ajax/libs/markdown-it/2.2.1/markdown-it.js\"\u003e\u003c/script\u003e\n```\n\nAnd use the following within your javascript\n\n``` js\n$('[rel~=\"github\"]').readGitHub({\n\trenderer: function(file) {\n\t\treturn window.markdownit().render(file)\n\t}\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiole%2Freadgithub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstudiole%2Freadgithub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstudiole%2Freadgithub/lists"}