{"id":15689744,"url":"https://github.com/thejohnfreeman/jquery-disqus","last_synced_at":"2025-05-07T23:06:39.186Z","repository":{"id":3107206,"uuid":"4133315","full_name":"thejohnfreeman/jquery-disqus","owner":"thejohnfreeman","description":"A jQuery plugin for supporting Markdown and syntax highlighting in Disqus comments.","archived":false,"fork":false,"pushed_at":"2012-08-26T03:35:05.000Z","size":93,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-07T23:06:34.477Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thejohnfreeman.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}},"created_at":"2012-04-25T05:50:13.000Z","updated_at":"2023-10-31T16:38:23.000Z","dependencies_parsed_at":"2022-09-18T00:50:48.610Z","dependency_job_id":null,"html_url":"https://github.com/thejohnfreeman/jquery-disqus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejohnfreeman%2Fjquery-disqus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejohnfreeman%2Fjquery-disqus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejohnfreeman%2Fjquery-disqus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thejohnfreeman%2Fjquery-disqus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thejohnfreeman","download_url":"https://codeload.github.com/thejohnfreeman/jquery-disqus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833251,"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":"2024-10-03T18:04:18.643Z","updated_at":"2025-05-07T23:06:39.157Z","avatar_url":"https://github.com/thejohnfreeman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This [jQuery][jq] plugin enhances your [Disqus][dq] comments with Markdown and\nsyntax highlighting.\n\n[jq]: http://jquery.com/ \"jQuery, a JavaScript library for DOM manipulation\"\n[dq]: http://disqus.com/ \"Disqus, a comment app for blogs\"\n\n## Use\n\nInclude appropriate dependencies in your `\u003chead\u003e`:\n\n```html\n\u003cscript\n  src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js\"\n  type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript\n  src=\"http://cachedcommons.org/javascripts/text/prettify-min.js\"\n  type=\"text/javascript\"\u003e\u003c/script\u003e\n\u003cscript\n  src=\"http://cachedcommons.org/javascripts/text/showdown-min.js\"\n  type=\"text/javascript\"\u003e\u003c/script\u003e\n```\n\nThen configure Disqus and run the plugin from anywhere:\n\n```js\n$(document).ready(function() {\n  /* We do not change the Disqus API. If you want to pass options to\n   * Disqus, do it like they expect: by setting global variables. */\n  disqus_shortname  = \"example\";\n  disqus_identifier = \"/path/to/slug\";\n  $.disqus();\n});\n```\n\n## Caveats\n\nBe aware that the Disqus embed script manipulates comments, e.g.,\nchanging long URLs into anchor elements (`\u003ca\u003e`) or newlines into line-break\nelements (`\u003cbr\u003e`).\nThese manipulations must be reversed for the original Markdown to parse as\nthe comment author intended. I have made a minor attempt to address these two\nspecific manipulations, but there are others that my script will not\nhandle correctly.\n\nAn ideal solution would essentially require rewriting the Disqus embed script\nand replacing the transformation that Disqus provides. I suspect it would be\nan easy change for Disqus developers with access to the source. For me, it is\ntoo much reverse engineering to be justified.\n\nI have not tested this script with Disqus 2012. My suspicion is that browsers\nwill prohibit its access to the comments within the Disqus iframe, thus\ndisabling it.\n\n## History\n\nThis plugin was branched off the last published version of the [jQuery Disqus\nplugin by Lance Pollard][lance]. Besides being broken by the time I discovered\nit (likely due to changes in the Disqus API), I believe the original plugin\ntried to do too much. I have made several changes:\n\n- Use a single entry point, `$.disqus()`.\n- Expect Disqus configuration to occur outside the call to this plugin and\n  to follow the expectations documented by [Disqus][dq-config].\n- Use Disqus's published Universal Code instead of a custom AJAX call.\n- Support Markdown conversion using [Showdown][sd].\n- Support syntax highlighting with [Prettify][pretty].\n- Remove everything else, e.g. `ready()` and `add()`.\n\n[lance]: http://code.lancepollard.com/jquery-disqus-plugin \"jQuery Disqus plugin\"\n[dq-config]: http://docs.disqus.com/help/2/ \"JavaScript configuration variables\"\n[sd]: https://github.com/coreyti/showdown \"Showdown, a JavaScript port of Markdown\"\n[pretty]: http://code.google.com/p/google-code-prettify/ \"Prettify, a JavaScript- and CSS-based syntax highlighter\"\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejohnfreeman%2Fjquery-disqus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthejohnfreeman%2Fjquery-disqus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejohnfreeman%2Fjquery-disqus/lists"}