{"_id":"gitbook-plugin-duoshuo","_rev":"30-fdc56b8711f74127f278d9b0a3453b81","name":"gitbook-plugin-duoshuo","time":{"modified":"2022-06-18T08:42:06.832Z","created":"2014-09-01T02:31:38.261Z","1.4.0":"2014-09-01T02:31:53.647Z","1.5.0":"2014-09-01T03:32:19.298Z","1.6.0":"2014-09-10T04:27:04.178Z","1.6.1":"2014-09-10T04:49:22.037Z","1.6.2":"2015-03-25T07:29:32.241Z","1.6.3":"2015-03-25T08:02:38.044Z"},"maintainers":[{"name":"codepiano","email":"codepiano.li@gmail.com"}],"description":"gitbook plugin for duoshuo,a comment hosting service for online communities","readme":"gitbook-plugin-duoshuo\n======================\n[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/codepiano/gitbook-plugin-duoshuo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nDuoshuo is a comment hosting service for Web sites and online communities that uses a networked platform.\n\n多说平台的gitbook插件，给gitbook集成评论功能\n\nhow to install\n--------------\n\n安装到gitbook所在目录，如果build时提示无法找到插件，可能是由于使用了nvm或n之类的模块所致，请将插件安装到gitbook模块所在的目录\n\n```shell\nnpm install gitbook-plugin-duoshuo -g\n```\n\nhow to use\n----------\n\nAdd config in book.json, the config will be duoshuoQuery object as a global variable which used by duoshuo's code.\n\n在book.json中添加设置，属性名为duoshuo，该对象将被设置为多说插件使用的全局变量duoshuoQuery\n\n```json\n{\n    \"plugins\": [\n        \"duoshuo\"\n    ],\n    \"pluginsConfig\": {\n        \"duoshuo\": {\n            \"short_name\": \"your duoshuo's shortname\",\n            \"theme\": \"default\"\n        }\n    }\n}\n```\n\nhow to work\n-----------\n\nLoad comment elements when gitbook's page.change event triggered.\n\n由于gitbook特殊的页面加载方式，使用了官方提供的动态加载评论框的方法，具体描述见 [动态加载多说评论框的方法](http://dev.duoshuo.com/docs/50b344447f32d30066000147)\n\nurls like /a/b/\n--------------\n\nDuoshuo prefer a unique id to distinguish the pages,but sometimes a page can have different urls.\n\n[www.example.com/](www.example.com/) and [www.example.com/index.html](www.example.com/index.html) refer to the same page.\n\nAdd some code to process these situation,the procedure to generate unique page id is:\n\n1. get the location.pathname from browser\n1. replace all the '/' with '-'\n1. if the last char of the result string is '-',append 'index.html' to it(eg: /a/b/ will be cast to -a-b-,final result is -a-b-index.html).\n\n为了处理同一个页面有不同的url的情况，多说要求一个单独的id来分辨页面。\n\n[www.example.com/](www.example.com/) 和 [www.example.com/index.html](www.example.com/index.html) 是同一个页面，应该显示相同的评论。\n\n为了兼容这种情况，插件生成惟一id的过程如下：\n\n1. 从location.pathname 中获取url\n1. 替换'/'为'-'\n1. 如果最后一个字符为-，在末尾添加'index.html'。（/a/b/ 会被转换为 -a-b-，再加上index.html即为最后的id）\n","versions":{"1.5.0":{"name":"gitbook-plugin-duoshuo","description":"gitbook plugin for duoshuo,a comment hosting service for online communities","main":"index.js","version":"1.5.0","engines":{"gitbook":">=1.0.0"},"homepage":"https://github.com/codepiano/gitbook-plugin-duoshuo","repository":{"type":"git","url":"https://github.com/codepiano/gitbook-plugin-duoshuo.git"},"license":"Apache 2","bugs":{"url":"https://github.com/codepiano/gitbook-plugin-duoshuo/issues"},"keywords":["gitbook","duoshuo","plugin"],"author":{"name":"codepiano"},"_from":"git://github.com/codepiano/gitbook-plugin-duoshuo","_fromGithub":true,"_id":"gitbook-plugin-duoshuo@1.5.0","dist":{"shasum":"b8c59078ad0a351f96da8e1b3573841400a945a4","tarball":"https://registry.npmjs.org/gitbook-plugin-duoshuo/-/gitbook-plugin-duoshuo-1.5.0.tgz","integrity":"sha512-NgOKS8VUJAGF5JY4uUjteZAXj08RJzzFEGEZ7LLhhcQuSpuWTmFWqm3Upbm0A0WwsmHJaRwBCAiJLz/s77rF4Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDm1fZCpVEdr1WS1ieY7VNR/X42mO5cxUY6wcqz1qK/CgIgOSoC3lwQurbkfWCLvV/Lg1PKsacLyif+XFGNBD8Tw2w="}]},"_npmVersion":"1.3.14","_npmUser":{"name":"codepiano","email":"codepiano.li@gmail.com"},"maintainers":[{"name":"codepiano","email":"codepiano.li@gmail.com"}]},"1.6.0":{"name":"gitbook-plugin-duoshuo","description":"gitbook plugin for duoshuo,a comment hosting service for online communities","main":"index.js","version":"1.6.0","engines":{"gitbook":">=1.0.0"},"homepage":"https://github.com/codepiano/gitbook-plugin-duoshuo","repository":{"type":"git","url":"https://github.com/codepiano/gitbook-plugin-duoshuo.git"},"license":"Apache 2","bugs":{"url":"https://github.com/codepiano/gitbook-plugin-duoshuo/issues"},"keywords":["gitbook","duoshuo","plugin"],"author":{"name":"codepiano"},"_from":"git://github.com/codepiano/gitbook-plugin-duoshuo","_fromGithub":true,"_id":"gitbook-plugin-duoshuo@1.6.0","_shasum":"d7ca812c8ecab63a5ae1190e2d3b935ce667e1c4","_npmVersion":"1.4.9","_npmUser":{"name":"codepiano","email":"codepiano.li@gmail.com"},"maintainers":[{"name":"codepiano","email":"codepiano.li@gmail.com"}],"dist":{"shasum":"d7ca812c8ecab63a5ae1190e2d3b935ce667e1c4","tarball":"https://registry.npmjs.org/gitbook-plugin-duoshuo/-/gitbook-plugin-duoshuo-1.6.0.tgz","integrity":"sha512-cKvNMr1hp3N3V8BMLj8ZAsGnk6CieBvh/rJrtXGpt125i81LPIBbHFbvBqiYoszxqDeWYHQzd/8gsEysHg2r3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoi6oe2TSXk7IEkdcMu6Yr8obeVvoJiN/P6JNOxc2W+wIhAOgQle5LTFLuU+8xa1o98poY/SHaoWLGxGNKBKTj8sjo"}]}},"1.6.1":{"name":"gitbook-plugin-duoshuo","description":"gitbook plugin for duoshuo,a comment hosting service for online communities","main":"index.js","version":"1.6.1","engines":{"gitbook":">=1.0.0"},"homepage":"https://github.com/codepiano/gitbook-plugin-duoshuo","repository":{"type":"git","url":"https://github.com/codepiano/gitbook-plugin-duoshuo.git"},"license":"Apache 2","bugs":{"url":"https://github.com/codepiano/gitbook-plugin-duoshuo/issues"},"keywords":["gitbook","duoshuo","plugin"],"author":{"name":"codepiano"},"_from":"git://github.com/codepiano/gitbook-plugin-duoshuo","_fromGithub":true,"_id":"gitbook-plugin-duoshuo@1.6.1","_shasum":"a6288b37e4381d4f6269ffc88d4b029f3bc9042a","_npmVersion":"1.4.9","_npmUser":{"name":"codepiano","email":"codepiano.li@gmail.com"},"maintainers":[{"name":"codepiano","email":"codepiano.li@gmail.com"}],"dist":{"shasum":"a6288b37e4381d4f6269ffc88d4b029f3bc9042a","tarball":"https://registry.npmjs.org/gitbook-plugin-duoshuo/-/gitbook-plugin-duoshuo-1.6.1.tgz","integrity":"sha512-txC60VcKiIsRNZqm884QEI/6nBZOaLtz9o3vHVOoys4TlLc/EiXe1TASf0RV3NIgy225AdfpKXJOQgl88GG1YA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvy+CEEjw6DbNWmc/MT+mP0Za7QxoqbQYtF8DqJyTxRAIhAKEN0FU59WnshmpbYHJhZJqDDIkQubCTmh0wCdrJUb4o"}]}},"1.6.3":{"name":"gitbook-plugin-duoshuo","description":"gitbook plugin for duoshuo,a comment hosting service for online communities","main":"index.js","version":"1.6.3","engines":{"gitbook":"*"},"homepage":"https://github.com/codepiano/gitbook-plugin-duoshuo","repository":{"type":"git","url":"https://github.com/codepiano/gitbook-plugin-duoshuo.git"},"license":"Apache 2","bugs":{"url":"https://github.com/codepiano/gitbook-plugin-duoshuo/issues"},"keywords":["gitbook","duoshuo","plugin"],"author":{"name":"codepiano"},"_from":"git://github.com/codepiano/gitbook-plugin-duoshuo","_fromGithub":true,"gitHead":"05a7ae4aae6ad3017c33112648614f9033cd3d3c","_id":"gitbook-plugin-duoshuo@1.6.3","scripts":{},"_shasum":"f8a8807d84f49749ad76ad819c6be0a2af63ddad","_npmVersion":"1.4.28","_npmUser":{"name":"codepiano","email":"codepiano.li@gmail.com"},"maintainers":[{"name":"codepiano","email":"codepiano.li@gmail.com"}],"dist":{"shasum":"f8a8807d84f49749ad76ad819c6be0a2af63ddad","tarball":"https://registry.npmjs.org/gitbook-plugin-duoshuo/-/gitbook-plugin-duoshuo-1.6.3.tgz","integrity":"sha512-Rt8DrHmxSaB8MPM3Ey5dy98ABW+z/PrMHY13l7bnzXykWHCzZYwoqDRlDoRsnCjKJ12vcUM6ZS346T207JlNcA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLCSMaGyWy2fvtWRSLdV2eQv7Ss/010IjAI5KJRT79GAiEAsF+hOF6LId88kWbe875+LoucEqJMyRAkZqYBQ4JNixk="}]}}},"dist-tags":{"1.5.0":"1.5.0","latest":"1.6.3","1.6.0":"1.6.0"},"readmeFilename":"README.md","homepage":"https://github.com/codepiano/gitbook-plugin-duoshuo","keywords":["gitbook","duoshuo","plugin"],"repository":{"type":"git","url":"https://github.com/codepiano/gitbook-plugin-duoshuo.git"},"author":{"name":"codepiano"},"bugs":{"url":"https://github.com/codepiano/gitbook-plugin-duoshuo/issues"},"license":"Apache 2","users":{}}