From 24f0c301d3f32f803b328f2e71e5f1508eb072d2 Mon Sep 17 00:00:00 2001 From: Vyrtsev Mikhail Date: Sun, 27 Jan 2019 01:23:04 +0300 Subject: [PATCH] update readme --- README.md | 59 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index a9fe07e2..c1c0264e 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ Remark42 is a self-hosted, lightweight, and simple (yet functional) comment engi - [Install](#install) - [Backend](#backend) - - [With Docker](#with-docker) - - [Without docker](#without-docker) + - [With Docker](#with-docker) + - [Without docker](#without-docker) - [Parameters](#parameters) - [Required parameters](#required-parameters) - [Register oauth2 providers](#register-oauth2-providers) @@ -77,7 +77,7 @@ _this is the recommended way to run remark42_ #### Without docker * download archive for [stable release](https://github.com/umputun/remark/releases) or [development version](https://remark42.com/downloads) -* unpack with `gunzip` (Linux, macOS) or with `zip` (Windows) +* unpack with `gunzip` (Linux, macOS) or with `zip` (Windows) * run as `remark42.{os}-{arch} server {parameters...}`, i.e. `remark42.linux-amd64 server --secret=12345 --url=http://127.0.0.1:8080` * alternatively compile from the sources - `make OS=[linux|darwin|windows] ARCH=[amd64,386,arm64,arm32]` @@ -114,7 +114,7 @@ _this is the recommended way to run remark42_ | auth.github.csec | AUTH_GITHUB_CSEC | | Github OAuth client secret | | auth.yandex.cid | AUTH_YANDEX_CID | | Yandex OAuth client ID | | auth.yandex.csec | AUTH_YANDEX_CSEC | | Yandex OAuth client secret | -| auth.dev | AUTH_DEV | false | local oauth2 server, development mode only | +| auth.dev | AUTH_DEV | `false` | local oauth2 server, development mode only | | notify.type | NOTIFY_TYPE | none | type of notification (none or telegram) | | notify.queue | NOTIFY_QUEUE | 100 | size of notification queue | | notify.telegram.token | NOTIFY_TELEGRAM_TOKEN | | telegram token | @@ -130,6 +130,7 @@ _this is the recommended way to run remark42_ | max-votes | MAX_VOTES | `-1` | votes limit per comment, `-1` - unlimited | | low-score | LOW_SCORE | `-5` | low score threshold | | critical-score | CRITICAL_SCORE | `-10` | critical score threshold | +| positive-score | POSITIVE_SCORE | `false` | restricts comment's score to be only positive | | restricted-words | RESTRICTED_WORDS | | words banned in comments (can use `*`), _multi_ | | edit-time | EDIT_TIME | `5m` | edit window | | read-age | READONLY_AGE | | read-only age of comments, days | @@ -144,7 +145,7 @@ _this is the recommended way to run remark42_ ##### Required parameters -Most of the parameters have sane defaults and don't require customization. There are only a few parameters user has to define: +Most of the parameters have sane defaults and don't require customization. There are only a few parameters user has to define: 1. `SECRET` - secret key, can be any long and hard-to-guess string. 2. `REMARK_URL` - url pointing to your remark42 server, i.e. `https://demo.reamark42.com` @@ -167,7 +168,7 @@ services: - AUTH_GITHUB_CID=12345667890 # oauth2 client ID - AUTH_GITHUB_CSEC=abcdefg12345678 # oauth2 client secret volumes: - - ./var:/srv/var # persistent volume to store all remark42 data + - ./var:/srv/var # persistent volume to store all remark42 data ``` #### Register oauth2 providers @@ -230,7 +231,7 @@ For more details refer to [Yandex OAuth](https://tech.yandex.com/oauth/doc/dg/co #### Initial import from WordPress -1. Install WordPress [plugin](https://wordpress.org/plugins/wp-exporter/) to export comments and follow it instructions. The plugin should produce a xml-based file with site content including comments. +1. Install WordPress [plugin](https://wordpress.org/plugins/wp-exporter/) to export comments and follow it instructions. The plugin should produce a xml-based file with site content including comments. 2. Move this file to your remark42 host within `./var` 3. Run import command - `docker exec -it remark42 import -p wordpress -f {wordpress-export-name}.xml -s {your site id}` @@ -258,25 +259,25 @@ Restore will clean all comments first and then will processed with complete impo ##### Backup format Backup file is a text file with all exported comments separated by EOL. Each backup record is a valid json with all key/value -unmarshaled from `Comment` struct (see below). +unmarshaled from `Comment` struct (see below). #### Admin users -Admins/moderators should be defined in `docker-compose.yml` as a list of user IDs or passed in the command line. +Admins/moderators should be defined in `docker-compose.yml` as a list of user IDs or passed in the command line. ``` environment: - ADMIN_SHARED_ID=github_ef0f706a79cc24b17bbbb374cd234a691a034128,github_dae9983158e9e5e127ef2b87a411ef13c891e9e5 ``` -To get user id just login and click on your username or any other user you want to promote to admins. +To get user id just login and click on your username or any other user you want to promote to admins. It will expand login info and show full user ID. ### Setup on your website #### Comments -It's a main widget which renders list of comments. +It's a main widget which renders list of comments. Add this snippet to the bottom of web page: @@ -302,7 +303,7 @@ 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. @@ -311,13 +312,13 @@ After that widget will be rendered inside this node. Right now Remark has two themes: light and dark. You can pick one using configuration object, but there is also a possibility to switch between themes in runtime. -For this purpose Remark adds to `window` object named `REMARK42`, +For this purpose Remark adds to `window` object named `REMARK42`, which contains function `changeTheme`. Just call this function and pass a name of the theme that you want to turn on: ```js window.REMARK42.changeTheme('light'); -``` +``` #### Last comments @@ -328,7 +329,7 @@ Add this snippet to the bottom of web page: ```html