From 088082508efa70ace592329f659d863208934efa Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Fri, 11 May 2018 17:53:53 +0300 Subject: [PATCH] add info about scripts to readme --- README.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/README.md b/README.md index aafcf22e..a4986bd0 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,97 @@ URLs for development: * `localhost:8080/last-comments.html` — page with embedded script for last comments; * `localhost:8080/counter.html` — page with embedded script for counter with examples. +#### Usage + +##### Comments + +It's a main widget which renders list of comments. + +Add this snippet to the bottom of web page: + +```html + +``` + +And then add this node in the place where you want to see Remark42 widget: + +```html +
+``` + +After that widget will be rendered inside this node. + +##### Last comments + +It's a widget which renders list of last comments from your site. + +Add this snippet to the bottom of web page: + +```html + +``` + +And then add this node in the place where you want to see last comments widget: + +```html +
+``` + +`data-max` sets the max amount of comments (default: `15`). + +##### Counter + +It's a widget which renders a number of comments for the specified page. + +Add this snippet to the bottom of web page: + +```html + +``` + +And then add a node like this in the place where you want to see a number of comments: + +```html + +``` + +You can use as many nodes like this as you need to. +The script will found all them by the class `remark__counter`, +and it will use `data-url` attribute to define the page with comments. + +Also script can uses `url` property from `remark_config` object, or `window.location.href` if nothing else is defined. + ## API ### Authorization