added plugin directory

This commit is contained in:
Wyatt Johnson
2018-03-08 19:58:48 -07:00
parent 518e4115ee
commit 44f187dafa
97 changed files with 979 additions and 435 deletions
+11 -11
View File
@@ -98,20 +98,22 @@ sidebar:
url: /configuration/
- title: Advanced Configuration
url: /advanced-configuration/
- title: Integrating
children:
- title: Authentication
url: /authentication/
url: /integrating/authentication/
- title: Configuring the Comment Stream
url: /configuring-comment-stream/
url: /integrating/configuring-comment-stream/
- title: Configuring the Admin
url: /configuring-admin/
url: /integrating/configuring-admin/
- title: Notifications
url: /notifications/
url: /integrating/notifications/
- title: Event Tracking and Metrics
url: /event-tracking-metrics/
url: /integrating/event-tracking-metrics/
- title: Styling and CSS
url: /styling-css/
url: /integrating/styling-css/
- title: Translations and i18n
url: /translations-i18n/
url: /integrating/translations-i18n/
- title: Product Guide
children:
- title: How Talk Works
@@ -130,10 +132,8 @@ sidebar:
children:
- title: Plugins Overview
url: /plugins/
- title: Default Plugins
url: /default-plugins/
- title: Additional Plugins
url: /additional-plugins/
- title: Plugin Directory
url: /plugins-directory/
- title: Plugin Recipes
url: /plugin-recipes/
- title: Reference
+3 -2
View File
@@ -18,9 +18,10 @@
"hexo-generator-index": "^0.2.0",
"hexo-renderer-marked": "^0.3.0",
"hexo-renderer-sass": "^0.3.2",
"hexo-server": "^0.3.1"
"hexo-server": "^0.3.1",
"lunr": "^2.1.6"
},
"devDependencies": {
"nodemon": "^1.14.12"
}
}
}
@@ -56,50 +56,6 @@ When `TRUE`, it will not mount the static asset serving routes on the router.
This is used primarily in conjunction with [TALK_STATIC_URI](#talk_static_uri)
when the static assets are being hosted on an external domain. (Default `FALSE`)
## TALK_FACEBOOK_APP_ID
The Facebook App ID for your Facebook Login enabled app. You can learn more
about getting a Facebook App ID at the
[Facebook Developers Portal](https://developers.facebook.com)
or by visiting the
[Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
## TALK_FACEBOOK_APP_SECRET
The Facebook App Secret for your Facebook Login enabled app. You can learn more
about getting a Facebook App Secret at the
[Facebook Developers Portal](https://developers.facebook.com)
or by visiting the
[Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
## TALK_GOOGLE_CLIENT_ID
The Google OAuth2 client ID for your Google login web app. You can learn more
about getting a Google Client ID at the
[Google API Console](https://console.developers.google.com/apis/){:target="_blank"}.
You will need to enable the Google+ API in the dashboard and create credentials
for a new OAuth client ID web application. The authorized JavaScript origin
should be set to the Talk domain, and the authorized redirect URI should be set
to http://<example.com>/api/v1/auth/google/callback. This is only required while
the `talk-plugin-google-auth` plugin is enabled.
## TALK_GOOGLE_CLIENT_SECRET
The Google OAuth2 client ID for your Google login web app. You can learn more
about getting a Google Client ID at the
[Google API Console](https://console.developers.google.com/apis/){:target="_blank"}.
You will need to enable the Google+ API in the dashboard and create credentials
for a new OAuth client ID web application. The authorized JavaScript origin
should be set to the Talk domain, and the authorized redirect URI should be set
to http://<example.com>/api/v1/auth/google/callback. This is only required while
the `talk-plugin-google-auth` plugin is enabled.
## TALK_HELMET_CONFIGURATION
A JSON string representing the configuration passed to the
-32
View File
@@ -1,32 +0,0 @@
---
title: Plugins Overview
permalink: /plugins/
---
There are several ways to install plugins.
### Default Plugins vs. Custom Plugins
Talk ships with a default set of plugins, available in `plugins.default.json`. When you run Talk with just the default plugins, these are the plugins that will be enabled.
If you want to use the additional plugins that are available, you can create a `plugins.json` file. If this file exists, Talk will use that to determine which plugins to use.
### Installing a Plugin from npm
If you create your own plugin, you can publish the plugin to npm and use it in Talk. The npm package can be public (open source) or private.
You would include this in your `plugins.json`:
EXAMPLE HERE
### Installing a Local Plugin
If you host your own plugin on Github, you can enable it by adding this to your `plugins.json`:
EXAMPLE HERE
### Best Practice
-148
View File
@@ -1,148 +0,0 @@
---
title: Default Plugins
permalink: /default-plugins/
class: configuration
toc: true
---
The default Talk plugins can be found in the `plugins.default.json` file
[here](https://github.com/coralproject/talk/blob/master/plugins.default.json).
Talk ships out of the box with these plugins enabled.
We ship [Additional Plugins](./additional-plugins/) with
Talk that are not enabled by default. You can enable these or disable these
default plugins by consulting the [Plugins Overview](./plugins/)
page.
## talk-plugin-auth
Source: [plugins/talk-plugin-auth](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-auth)
Enables generic registration via an email address, a username, a password, and a
password confirmation. To sync Talk auth with your own auth systems, you can use
this plugin as a template.
## talk-plugin-facebook-auth
Source: [plugins/talk-plugin-auth](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-auth)
Requires: [talk-plugin-facebook-auth](#talk-plugin-facebook-auth)
Enables sign-in via Facebook via the server side passport middleware.
Configuration:
- [TALK_FACEBOOK_APP_ID](./configuration/#talk_facebook_app_id) (**required**) - See the existing documentation for the [TALK_FACEBOOK_APP_ID](./configuration/#talk_facebook_app_id).
- [TALK_FACEBOOK_APP_SECRET](./configuration/#talk_facebook_app_secret) (**required**) - See the existing documentation for the [TALK_FACEBOOK_APP_SECRET](./configuration/#talk_facebook_app_secret).
## talk-plugin-featured-comments
Source: [plugins/talk-plugin-featured-comments](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-featured-comments)
Enables the ability for Moderators to feature and un-feature comments via the
Stream and the Admin. Featured comments show in a first-place tab on the Stream
if there are any featured comments on that story.
## talk-plugin-respect
Source: [plugins/talk-plugin-respect](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-respect)
Enables a `respect` reaction button. Why a "respect" button, you ask?
[Read more here](https://mediaengagement.org/research/engagement-buttons/).
## talk-plugin-comment-content
Source: [plugins/talk-plugin-comment-content](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-comment-content)
Pluginizes the text of a comment to support custom treatment of this text. This
plugin currently parses the given text to see if it contains a link, and makes
them clickable.
## talk-plugin-ignore-user
Source: [plugins/talk-plugin-ignore-user](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-ignore-user)
Enables ability for users to ignore (or "mute") other users. If a user is
ignored, you will not see any of their comments. You can un-ignore a user via
the My Profile tab.
## talk-plugin-permalink
Source: [plugins/talk-plugin-permalink](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-permalink)
Enables a `Link` button that will provide a permalink to the comment that can be
shared with others.
## talk-plugin-viewing-options
Source: [plugins/talk-plugin-viewing-options](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-viewing-options)
Pluginizes the sorting/viewing options for a comment stream.
## talk-plugin-sort-newest
Source: [plugins/talk-plugin-sort-newest](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-newest)
Requires: [talk-plugin-viewing-options](#talk-plugin-viewing-options)
Provides a sort for the newest comments first. This isn't necessarily required
as the default sort without options/plugins is newest first.
## talk-plugin-sort-oldest
Source: [plugins/talk-plugin-sort-oldest](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-oldest)
Requires: [talk-plugin-viewing-options](#talk-plugin-viewing-options)
Provides a sort for the newest comments first.
## talk-plugin-sort-most-respected
Source: [plugins/talk-plugin-sort-most-respected](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-most-respected)
Requires: [talk-plugin-viewing-options](#talk-plugin-viewing-options), [talk-plugin-respect](#talk-plugin-respect)
Provides a sort for the comments with the most `respect` reactions first.
## talk-plugin-sort-most-replied
Source: [plugins/talk-plugin-sort-most-replied](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-most-replied)
Requires: [talk-plugin-viewing-options](#talk-plugin-viewing-options)
Provides a sort for the comments with the most replies first.
## talk-plugin-offtopic
Source: [plugins/talk-plugin-offtopic](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-offtopic)
Allows the comment authors to tag their comment as `Off-Topic` which will add a
visible badge on the frontend to other users that their comment is off-topic.
## talk-plugin-author-menu
Source: [plugins/talk-plugin-author-menu](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-author-menu)
Pluginizes the author's name on hover.
## talk-plugin-member-since
Source: [plugins/talk-plugin-member-since](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-member-since)
Requires: [talk-plugin-author-menu](#talk-plugin-author-menu)
Displays the date that the user was created as a `Member Since ${created_at}`.
## talk-plugin-moderation-actions
Source: [plugins/talk-plugin-moderation-actions](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-moderation-actions)
Enables in-stream moderation so that Moderators can reject, approve comments,
as well as ban users, directly from the comment stream. When [talk-plugin-featured-comments](#talk-plugin-featured-comments) is enabled
## talk-plugin-flag-details
Source: [plugins/talk-plugin-flag-details](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-flag-details)
Pluginizes the Flag Details area of comments in the Moderation Queues to display
data. Some basic details are already included on flags by default.
-169
View File
@@ -1,169 +0,0 @@
---
title: Additional Plugins
permalink: /additional-plugins/
class: configuration
toc: true
---
Talk ships with several plugins that aren't enabled by default. These plugins
can be enabled by consulting the [Plugins Overview](./plugins/)
page.
## talk-plugin-like
Source: [plugins/talk-plugin-like](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-like)
Enables a `like` reaction button.
## talk-plugin-sort-most-liked
Source: [plugins/talk-plugin-sort-most-liked](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-most-liked)
Requires: [talk-plugin-viewing-options](./default-plugins/#talk-plugin-viewing-options), [talk-plugin-like](#talk-plugin-like)
Provides a sort for the comments with the most `like` reactions first.
## talk-plugin-love
Source: [plugins/talk-plugin-love](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-love)
Enables a `love` reaction button.
## talk-plugin-sort-most-loved
Source: [plugins/talk-plugin-sort-most-loved](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-sort-most-loved)
Requires: [talk-plugin-viewing-options](./default-plugins/#talk-plugin-viewing-options), [talk-plugin-love](#talk-plugin-love)
Provides a sort for the comments with the most `love` reactions first.
## talk-plugin-remember-sort
Source: [plugins/talk-plugin-remember-sort](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-remember-sort)
Requires: [talk-plugin-viewing-options](./default-plugins/#talk-plugin-viewing-options)
Enables saving a users last sort selection as they browse other articles.
## talk-plugin-deep-reply-count
Source: [plugins/talk-plugin-deep-reply-count](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-deep-reply-count)
Enables counting of comments to include replies via a new graph edge. Not
recommended for large installations as it will unreasonably reduce the query
efficiency to compute this number.
## talk-plugin-slack-notifications
Source: [plugins/talk-plugin-slack-notifications](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-slack-notifications)
Enables all new comments that are written to be posted to a Slack channel as
well. Configure an
[Incoming Webhook](https://api.slack.com/incoming-webhooks)
app and provide that url in the form of the `SLACK_WEBHOOK_URL`
detailed below.
*Warning: On high volume sites, this means every single comment will flow into
Slack, if this isn't what you want, be sure to use the provided plugin as a
recipe to further customize the behavior*.
Configuration:
- `SLACK_WEBHOOK_URL` (**required**) - The webhook url that will be
used to post new comments to.
## talk-plugin-toxic-comments
Source: [plugins/talk-plugin-toxic-comments](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-toxic-comments)
Using the [Perspective API](http://perspectiveapi.com/), this
plugin will warn users and reject comments that exceed the predefined toxicity
threshold. For more information on what Toxic Comments are, check out the
[Toxic Comments](./toxic-comments/) documentation.
Configuration:
- `TALK_PERSPECTIVE_API_KEY` (**required**) - The API Key for Perspective. You
can register and get your own key at [http://perspectiveapi.com/](http://perspectiveapi.com/).
- `TALK_TOXICITY_THRESHOLD` - If the comments toxicity exceeds this threshold,
the comment will be rejected. (Default `0.8`)
- `TALK_PERSPECTIVE_API_ENDPOINT` - API Endpoint for hitting the
perspective API. (Default `https://commentanalyzer.googleapis.com/v1alpha1`)
- `TALK_PERSPECTIVE_TIMEOUT` - The timeout for sending a comment to
be processed before it will skip the toxicity analysis, parsed by
[ms](https://www.npmjs.com/package/ms). (Default `300ms`)
- `TALK_PERSPECTIVE_DO_NOT_STORE` - Whether the API is permitted to store comment and context from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. (Default `true`) [Perspective API - Analize Comment Request](https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md#analyzecomment-request)
## talk-plugin-subscriber
Source: [plugins/talk-plugin-subscriber](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-subscriber)
Enables a `Subscriber` badge to be added to comments where the author has the
`SUBSCRIBER` tag. This must match with a custom auth integration that adds the
tag to the users that are subscribed to the service.
## talk-plugin-akismet
Source: [plugins/talk-plugin-akismet](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-akismet)
Enables spam detection from [Akismet](https://akismet.com/). Comments will be passed to the Akismet API for spam detection. If a comment
is determined to be spam, it will prompt the user, indicating that the comment might be considered spam. If the user continues after this
point with the still spam-like comment, the comment will be reported as containing spam, and sent for moderator approval.
**Note: [Akismet](https://akismet.com/) is a premium service, charges may apply.**
Configuration:
- `TALK_AKISMET_API_KEY` (**required**) - The Akismet API key located on your account page.
- `TALK_AKISMET_SITE` (**required**) - The URL where you are embedding the comment stream on to provide context to Akismet. If you're hosting talk on https://talk.mynews.org/, and your news site is https://mynews.org/, then you should set this parameter to `https://mynews.org/`
## talk-plugin-notifications
Source: [plugins/talk-plugin-notifications](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-notifications){:target="_blank"}
Enables the Notification system for sending out enabled email notifications to
users when they interact with Talk. By itself, this plugin will not send
anything. You need to enable one of the `talk-plugin-notifications-category-*` plugins.
**Note that all `talk-plugin-notifications-*` plugins must be registered
*before* this plugin in order to work. For example:**
```js
{
"server": [
// ...
"talk-plugin-notifications-category-reply",
"talk-plugin-notifications",
// ...
]
}
```
{:.no-copy}
Configuration:
- `DISABLE_REQUIRE_EMAIL_VERIFICATIONS` - When `TRUE`, it will disable the verification email check before sending notifications for those emails. **Note that organizations implementing a custom authentication system _must_ disable this feature, as they don't use our integrated auth**. (Default `FALSE`).
### talk-plugin-notifications-category-reply
{:.param}
Source: [plugins/talk-plugin-notifications-category-reply](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-notifications-category-reply){:target="_blank"}
Replies made to each user will trigger an email to be sent with the notification
details if enabled.
### talk-plugin-notifications-category-featured
{:.param}
Source: [plugins/talk-plugin-notifications-category-featured](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-notifications-category-featured){:target="_blank"}
When a comment is featured (via the `talk-plugin-featured-comments` plugin), the
user will receive a notification email.
### talk-plugin-notifications-category-staff
{:.param}
Source: [plugins/talk-plugin-notifications-category-staff](https://github.com/coralproject/talk/tree/master/plugins/talk-plugin-notifications-category-staff){:target="_blank"}
Replies made to each user by a staff member will trigger an email to be sent
with the notification details if enabled.
+72
View File
@@ -0,0 +1,72 @@
- name: talk-plugin-akismet
description: Enables auto-moderation from Akismet.
- name: talk-plugin-auth
description: Enables internal authentication from Coral.
- name: talk-plugin-author-menu
description: Enables the comment author name plugin area.
- name: talk-plugin-comment-content
description: Linkifies comment content that contains links.
- name: talk-plugin-deep-reply-count
description: Enables deep reply count graph edge including all decendant replies.
- name: talk-plugin-facebook-auth
description: Enables a Facebook login strategy.
- name: talk-plugin-featured-comments
description: Allows comments to be featured for other users.
- name: talk-plugin-flag-details
description: Show flag details in the admin panel.
- name: talk-plugin-google-auth
description: Enables a Google login strategy.
- name: talk-plugin-ignore-user
description: Allows other users to ignore one another to hide their comments from view.
- name: talk-plugin-like
description: Allows the like reaction for comments
- name: talk-plugin-love
description: Allows the love reaction for comments
- name: talk-plugin-member-since
description: Shows the users created at time as their member since date.
- name: talk-plugin-moderation-actions
description: Allows moderators to take actions on comments from the comment stream.
- name: talk-plugin-notifications
description: The base notification plugin which enables notifications to be sent.
- name: talk-plugin-notifications-category-featured
description: Enables the on-featured notification.
- name: talk-plugin-notifications-category-reply
description: Enables the on-reply notification.
- name: talk-plugin-notifications-category-staff
description: Enables the on-staff-reply notification.
- name: talk-plugin-notifications-digest-daily
description: Enables daily digesting of comment notifications as an option.
- name: talk-plugin-notifications-digest-hourly
description: Enables hourly digesting of comment notifications as an option.
- name: talk-plugin-offtopic
description: Allows users to mark a comment as off-topic when they create it.
- name: talk-plugin-permalink
description: Shows a Link button on comments for direct-linking to a comment.
- name: talk-plugin-remember-sort
description: Remembers the sort selection made by a user.
- name: talk-plugin-respect
description: Enables the respect reaction for comments.
- name: talk-plugin-rich-text
description: Enables rich text plugins that save data as HTML.
- name: talk-plugin-rich-text-pell
description: Enables the pell rich text editor.
- name: talk-plugin-slack-notifications
description: Sends all comments as notifications to a slack channel
- name: talk-plugin-sort-most-liked
description: Enables sorting by most liked.
- name: talk-plugin-sort-most-loved
description: Enables sorting by most loved.
- name: talk-plugin-sort-most-replied
description: Enables sorting by most replied.
- name: talk-plugin-sort-most-respected
description: Enables sorting by most respected.
- name: talk-plugin-sort-newest
description: Enables sorting by newest.
- name: talk-plugin-sort-oldest
description: Enables sorting by oldest.
- name: talk-plugin-subscriber
description: Shows a subscriber tag on users that have the tag in the database.
- name: talk-plugin-toxic-comments
description: Enables auto-moderation from Google's Perspective API.
- name: talk-plugin-viewing-options
description: Enables the dropdown used to display sorting options on the embed stream.
@@ -1,17 +1,39 @@
---
title: Authenticating with Talk
permalink: /authentication/
permalink: /integrating/authentication/
---
You can integrate Talk with any external authentication service that will enable
seamless single sign-on for users within your organization. There are a few
methods of doing so:
1. Passport Middleware
2. Custom Token Integration
Both methods work, but there are product decisions that will affect the overall
choice.
## Passport Middleware
You would choose the **Passport Middleware** route when you are OK using an auth
that is triggered from inside Talk that is not connected to an external auth
state (you don't use the auth anywhere else now). A great example of this is our
Facebook plugin.
## Custom Token Integration
You can integrate Talk with any authentication service to enable single sign-on for users. The steps to do that are:
### Create auth middleware
## Create auth middleware
Create a middleware service that generates a JWT, which is passed as an option to the Talk embed code (see https://github.com/coralproject/talk/blob/master/client/coral-embed/src/index.js#L36) OR embed bridge (see https://github.com/coralproject/talk/blob/master/client/coral-embed/src/index.js#L44).
### Generate a key to sign the JWT
## Generate a key to sign the JWT
Use https://github.com/coralproject/coralcert to generate a key with which to sign the JWTs and specify the secret as an environment variable (see https://coralproject.github.io/talk/advanced-configuration/#talk_jwt_secret).
You may also provide configuration for other optional JWT components (see https://coralproject.github.io/talk/advanced-configuration/#).
### Create server plugin to handle auth
## Create server plugin to handle auth
Provide an implementation for the tokenUserNotFound hook within a server side plugin (see https://github.com/coralproject/talk/blob/ef49d9a3d2acc4d2fc03b00e0c872dfbc57f005a/docs/_docs/04-04-plugins-server.md#field-tokenusernotfound)
@@ -1,6 +1,6 @@
---
title: Configuring the Talk Admin
permalink: /configuring-admin/
permalink: /integrating/configuring-admin/
---
Using plugins and configuration variables, you can modify the way the Admin looks and how moderation works.
@@ -1,6 +1,6 @@
---
title: Configuring the Talk Comment Stream
permalink: /configuring-comment-stream/
permalink: /integrating/configuring-comment-stream/
---
Using plugins and configuration variables, you can modify the way the Talk comment stream behaves. Here are some common configuration options:
@@ -1,6 +1,6 @@
---
title: Tracking Talk Events and Metrics
permalink: /event-tracking-metrics/
permalink: /integrating/event-tracking-metrics/
---
Talk supports event emitting via Redux, Apollo and GraphQL. This means that common actions taken within Talk, such as successfully posting a comment, posting a reaction, or changing a setting, are automatically emitted from Talk. To send these events to your analytics tool of choice, however, will require some integration on your part.
@@ -1,6 +1,6 @@
---
title: Notifications
permalink: /notifications/
permalink: /integrating/notifications/
---
Talk currently supports 3 types of email notifications.
@@ -1,6 +1,6 @@
---
title: Styling Talk with CSS
permalink: /styling-css/
permalink: /integrating/styling-css/
---
You can add your own stylesheet in Admin > Configure > Tech Settings.
@@ -1,6 +1,6 @@
---
title: Translations and i18n
permalink: /translations-i18n/
permalink: /integrating/translations-i18n/
---
Were so proud to have received submissions from a lot of 3rd party contributors translating Talk into their own languages.
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-akismet/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-auth/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-author-menu/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-comment-content/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-deep-reply-count/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-facebook-auth/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-featured-comments/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-flag-details/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-google-auth/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-ignore-user/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-like/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-love/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-member-since/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-moderation-actions/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications-category-featured/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications-category-reply/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications-category-staff/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications-digest-daily/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications-digest-hourly/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-notifications/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-offtopic/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-permalink/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-remember-sort/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-respect/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-rich-text-pell/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-rich-text/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-slack-notifications/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-most-liked/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-most-loved/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-most-replied/README.md
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-most-respected/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-newest/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-sort-oldest/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-subscriber/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-toxic-comments/README.md
+1
View File
@@ -0,0 +1 @@
../../../plugins/talk-plugin-viewing-options/README.md
@@ -1,6 +1,7 @@
---
title: Plugins Overview
permalink: /plugins/
toc: true
---
Plugins are the integration point between the Talk core code and custom
+10
View File
@@ -0,0 +1,10 @@
---
title: Plugins Directory
permalink: /plugins-directory/
layout: plugins
data: plugins
---
Talk provides a growing ecosystem of plugins that interact with our extensive
Server and Client API's. Below you can search for a plugin to use with Talk and
discover what their requirements and configuration are.
+2 -1
View File
@@ -6,7 +6,8 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha256-Daf8GuI2eLKHJlOWLRR/zRy9Clqcj4TUSumbxYH9kGI=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/docsearch.js/2.4.1/docsearch.min.js" integrity="sha256-/cR58XeT7FS/4QEWCHJj/TdJ4b377Sf9p0DRto6I6cI=" crossorigin="anonymous"></script>
{{ js(['js/highlight.min.js', 'js/main.js']) }}
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.1.6/lunr.min.js" integrity="sha256-zD8ZTg2mp4ePN5bWMHN4r77s2FgpjVIzBlM8Dls10DQ=" crossorigin="anonymous"></script>
{{ js(['js/highlight.min.js', 'js/plugins.js', 'js/main.js']) }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
+62
View File
@@ -0,0 +1,62 @@
<article class="{% if page.class %}{{ page.class }} {% endif %}clearfix">
{% if page.title %}
<a class="btn btn-sm btn-light float-right suggest-edits plain-link" href="https://github.com/coralproject/talk/edit/master/docs/source/{{ page.source }}" title="Suggest edits to this page">Suggest Edits</a>
<h1>{{ page.title }}</h1>
<hr/>
{% endif %}
{% if page.plugin %}
<aside class="card bg-light plugin-details float-md-right ml-md-3 mb-md-3">
<div class="card-header">Plugin Details</div>
<div class="card-body">
<dl>
<dt>Name</dt>
<dd>{{ page.plugin.name }}</dd>
<dt>Source</dt>
<dd>
{% if page.plugin.source %}
<a href="{{ page.plugin.source.link }}">{% if page.plugin.source.name %}{{ page.plugin.source.name }}{% else %}{{ page.plugin.source.link }}{% endif %}</a>
{% else %}
<a href="https://github.com/coralproject/talk/tree/master/plugins/{{ page.plugin.name }}">plugins/{{ page.plugin.name }}</a>
{% endif %}
</dd>
<dt>Enabled by default</dt>
<dd>{% if page.plugin.default %}Yes{% else %}No{% endif %}</dd>
{% if page.plugin.depends %}
<dt>Dependancies</dt>
<dd>
<ul>
{% for dep in page.plugin.depends %}
<li><a href="{% if !dep.link %}/talk/plugin/{{ dep.name }}{% else %}{{ dep.link }}{% endif %}">{{ dep.name }}</a></li>
{% endfor %}
</ul>
</dd>
{% endif %}
<dt>Provides</dt>
<dd>
<ul>
{% for provides in page.plugin.provides %}
<li>{{ provides }}</li>
{% endfor %}
</ul>
</dd>
</dl>
</div>
</aside>
{% endif %}
{% if page.toc === true %}
<aside>
<nav class="toc" markdown="1">
{% if page.toc_title %}
<header>
<h4 class="nav__title">{{ page.toc_title }}</h4>
</header>
{% endif %}
{{ oltoul(toc(page.content, {list_number: false})) }}
</nav>
</aside>
{% endif %}
{{ page.content }}
</article>
+31
View File
@@ -0,0 +1,31 @@
<article class="{% if page.class %}{{ page.class }} {% endif %}clearfix">
{% if page.title %}
<a class="btn btn-sm btn-light float-right suggest-edits plain-link" href="https://github.com/coralproject/talk/edit/master/docs/source/{{ page.source }}" title="Suggest edits to this page">Suggest Edits</a>
<h1>{{ page.title }}</h1>
<hr/>
{% endif %}
{{ page.content }}
<div class="form-group mt-5">
<div class="clearfix">
<label for="exampleInputEmail1">Plugin Search</label>
<div class="text-muted float-md-right" id="plugin-list-count">{{ site.data[page.data].length }} plugins</div>
</div>
<input type="text" class="form-control" id="plugin-search-input" aria-describedby="pluginSearchHelp">
<small id="pluginSearchHelp" class="form-text text-muted">Enter a few keywords about the plugin to filter the list</small>
</div>
<div class="row plugins">
{% for plugin in _.sortBy(site.data[page.data], 'name') %}
<div class="col-sm-6 plugin d-block">
<div class="card mb-3">
<div class="card-body">
<h5 class="card-title"><a class="coral-link" href="{% if !plugin.link %}/talk/plugin/{{ plugin.name }}{% else %}{{ plugin.link }}{% endif %}">{{ plugin.name }}</a></h5>
<p class="card-text">{{ plugin.description }}</p>
</div>
</div>
</div>
{% endfor %}
</ul>
</article>
<script>window.SEARCH_INDEX = {{ lunr_index(site.data[page.data]) }}</script>
+19
View File
@@ -0,0 +1,19 @@
/* global hexo */
const lunr = require('lunr');
const { sortBy, assign } = require('lodash');
// Based on https://github.com/hexojs/site/blob/8e8ed4901769abbf76263125f82832df76ced58b/scripts/helpers.js#L121-L134
hexo.extend.helper.register('lunr_index', data => {
const index = lunr(function() {
this.field('name', { boost: 10 });
this.field('description');
this.ref('id');
sortBy(data, 'name').forEach((item, i) => {
this.add(assign({ id: i }, item));
});
});
return JSON.stringify(index);
});
+6 -1
View File
@@ -292,7 +292,8 @@ pre {
@extend .coral-link;
}
ul:not(.toc__menu) li a,
ol li a {
ol li a,
dd > a {
@extend .coral-link;
}
}
@@ -440,3 +441,7 @@ a.brand {
}
}
}
.plugin {
display: none;
}
+69
View File
@@ -0,0 +1,69 @@
/* global lunr */
/* eslint-env browser */
// Sourced from https://github.com/hexojs/site/blob/8e8ed4901769abbf76263125f82832df76ced58b/themes/navy/source/js/plugins.js.
(function() {
'use strict';
var elements = document.getElementsByClassName('plugin');
var $count = document.getElementById('plugin-list-count');
var $input = document.getElementById('plugin-search-input');
var elementLen = elements.length;
var index = lunr.Index.load(window.SEARCH_INDEX);
function updateCount(count) {
$count.innerHTML = count + (count === 1 ? ' plugin' : ' plugins');
}
function addClass(elem, className) {
var classList = elem.classList;
if (!classList.contains(className)) {
classList.add(className);
}
}
function removeClass(elem, className) {
var classList = elem.classList;
if (classList.contains(className)) {
classList.remove(className);
}
}
function search(value) {
var result = index.search('*' + value + '* ' + value);
var len = result.length;
var selected = {};
var i = 0;
for (i = 0; i < len; i++) {
selected[result[i].ref] = true;
}
for (i = 0; i < elementLen; i++) {
if (selected[i]) {
addClass(elements[i], 'd-block');
} else {
removeClass(elements[i], 'd-block');
}
}
updateCount(len);
}
function displayAll() {
for (var i = 0; i < elementLen; i++) {
addClass(elements[i], 'd-block');
}
updateCount(elements.length);
}
$input.addEventListener('input', function() {
var value = this.value;
if (!value) return displayAll();
search(value);
});
})();
+21
View File
@@ -0,0 +1,21 @@
---
title: talk-plugin-akismet
permalink: /plugin/talk-plugin-akismet/
layout: plugin
plugin:
name: talk-plugin-akismet
provides:
- Server
- Client
---
Enables spam detection from [Akismet](https://akismet.com/). Comments will be passed to the Akismet API for spam detection. If a comment
is determined to be spam, it will prompt the user, indicating that the comment might be considered spam. If the user continues after this
point with the still spam-like comment, the comment will be reported as containing spam, and sent for moderator approval.
**Note: [Akismet](https://akismet.com/) is a premium service, charges may apply.**
Configuration:
- `TALK_AKISMET_API_KEY` (**required**) - The Akismet API key located on your account page.
- `TALK_AKISMET_SITE` (**required**) - The URL where you are embedding the comment stream on to provide context to Akismet. If you're hosting talk on https://talk.mynews.org/, and your news site is https://mynews.org/, then you should set this parameter to `https://mynews.org/`
+15
View File
@@ -0,0 +1,15 @@
---
title: talk-plugin-auth
permalink: /plugin/talk-plugin-auth/
layout: plugin
plugin:
name: talk-plugin-auth
provides:
- Client
---
This provides the base plugin that is the basis for all auth based plugins that
utilize our internal authentication system.
To sync Talk auth with your own auth systems, you can use this plugin as a
template.
+19
View File
@@ -0,0 +1,19 @@
---
title: talk-plugin-author-menu
permalink: /plugin/talk-plugin-author-menu/
layout: plugin
plugin:
name: talk-plugin-author-menu
provides:
- Client
---
Enables plugins to integrate into the embed stream at the author name location.
We have recipes for showing the commenter's "member since" date, and to show a
subscriber badge. These will require some integration on your side to connect
them to the data source that houses this information.
- [talk-plugin-member-since](/talk/plugin/talk-plugin-member-since)
- [talk-plugin-subscriber](/talk/plugin/talk-plugin-subscriber)
To get started, check out our [Talk Recipes](https://github.com/coralproject/talk-recipes).
@@ -0,0 +1,14 @@
---
title: talk-plugin-comment-content
permalink: /plugin/talk-plugin-comment-content/
layout: plugin
plugin:
name: talk-plugin-comment-content
provides:
- Client
---
Pluginizes the text of a comment to support custom treatment of this text. This
plugin currently parses the given text to see if it contains a link, and makes
them clickable using
[react-linkify](https://www.npmjs.com/package/react-linkify).
@@ -0,0 +1,15 @@
---
title: talk-plugin-deep-reply-count
permalink: /plugin/talk-plugin-deep-reply-count/
layout: plugin
plugin:
name: talk-plugin-deep-reply-count
provides:
- Server
---
The Deep Reply Count plugin will add a new graph edge, `Comment.deepReplyCount`
that will return the count of all descendant replies.
**Warning: Enabling the talk-plugin-deep-reply-count plugin introduces a significant
performance impact on larger sites, use with care.**
@@ -4,7 +4,7 @@ const DataLoader = require('dataloader');
const CommentModel = require('../../models/comment');
console.warn(
'Enabling the talk-plugin-deep-reply-count plugin introduces a signifigant performance impact on larger sites, use with care.'
'Enabling the talk-plugin-deep-reply-count plugin introduces a significant performance impact on larger sites, use with care.'
);
// genDeepCommentCount will return the deep comment count for a given parent id.
@@ -72,7 +72,7 @@ module.exports = {
typeDefs: `
type Comment {
# deepReplyCount is the count of all decendant replies.
# deepReplyCount is the count of all descendant replies.
deepReplyCount: Int
}
`,
@@ -0,0 +1,30 @@
---
title: talk-plugin-facebook-auth
permalink: /plugin/talk-plugin-facebook-auth/
layout: plugin
plugin:
name: talk-plugin-facebook-auth
depends:
- name: talk-plugin-auth
provides:
- Server
- Client
---
Enables sign-in via Facebook via the server side passport middleware.
Configuration:
- `TALK_FACEBOOK_APP_ID` (**required**) - The Facebook App ID for your Facebook
Login enabled app. You can learn more about getting a Facebook App ID at the
[Facebook Developers Portal](https://developers.facebook.com) or by visiting
the [Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
- `TALK_FACEBOOK_APP_SECRET` (**required**) - The Facebook App Secret for your
Facebook Login enabled app. You can learn more about getting a Facebook App
Secret at the [Facebook Developers Portal](https://developers.facebook.com)
or by visiting the
[Creating an App ID](https://developers.facebook.com/docs/apps/register)
guide. This is only required while the `talk-plugin-facebook-auth` plugin is
enabled.
@@ -0,0 +1,18 @@
---
title: talk-plugin-featured-comments
permalink: /plugin/talk-plugin-featured-comments/
layout: plugin
plugin:
name: talk-plugin-featured-comments
provides:
- Server
- Client
---
Enables the ability for Moderators to feature and un-feature comments via the
Stream and the Admin. Featured comments show in a first-place tab on the Stream
if there are any featured comments on that story.
When paired with the [talk-plugin-moderator-actions](/talk/plugin/talk-plugin-moderator-actions)
plugin, moderators will have the option of featuring comments from the comment
stream.
@@ -0,0 +1,12 @@
---
title: talk-plugin-flag-details
permalink: /plugin/talk-plugin-flag-details/
layout: plugin
plugin:
name: talk-plugin-flag-details
provides:
- Client
---
Pluginizes the Flag Details area of comments in the Moderation Queues to display
data. Some basic details are already included on flags by default.
+29
View File
@@ -0,0 +1,29 @@
---
title: talk-plugin-google-auth
permalink: /plugin/talk-plugin-google-auth/
layout: plugin
plugin:
name: talk-plugin-google-auth
depends:
- name: talk-plugin-auth
provides:
- Server
- Client
---
Enables sign-in via Facebook via the server side passport middleware.
You will need to enable the Google+ API in the dashboard and create credentials
for a new OAuth client ID web application. The authorized JavaScript origin
should be set to the Talk domain, and the authorized redirect URI should be set
to http://<example.com>/api/v1/auth/google/callback. This is only required while
the `talk-plugin-google-auth` plugin is enabled.
Configuration:
- `TALK_GOOGLE_CLIENT_ID` (**required**) - The Google OAuth2 client ID for your
Google login web app. You can learn more about getting a Google Client ID at
the [Google API Console](https://console.developers.google.com/apis/).
- `TALK_GOOGLE_CLIENT_SECRET` (**required**) - The Google OAuth2 client ID for
your Google login web app. You can learn more about getting a Google Client
ID at the [Google API Console](https://console.developers.google.com/apis/).
+13
View File
@@ -0,0 +1,13 @@
---
title: talk-plugin-ignore-user
permalink: /plugin/talk-plugin-ignore-user/
layout: plugin
plugin:
name: talk-plugin-ignore-user
provides:
- Client
---
Enables ability for users to ignore (or "mute") other users. If a user is
ignored, you will not see any of their comments. You can un-ignore a user via
the My Profile tab.
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-like
permalink: /plugin/talk-plugin-like/
layout: plugin
plugin:
name: talk-plugin-like
provides:
- Server
- Client
---
Enables a `like` reaction button.
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-love
permalink: /plugin/talk-plugin-love/
layout: plugin
plugin:
name: talk-plugin-love
provides:
- Server
- Client
---
Enables a `love` reaction button.
@@ -0,0 +1,14 @@
---
title: talk-plugin-member-since
permalink: /plugin/talk-plugin-member-since/
layout: plugin
plugin:
name: talk-plugin-member-since
depends:
- name: talk-plugin-author-menu
provides:
- Client
---
It will show the date that the member/user joined when you hover over the
username as retrieved from the `createdAt` time on the user.
@@ -0,0 +1,14 @@
---
title: talk-plugin-moderator-actions
permalink: /plugin/talk-plugin-moderator-actions/
layout: plugin
plugin:
name: talk-plugin-moderator-actions
provides:
- Client
---
Enables in-stream moderation so that Moderators can reject, approve comments,
as well as ban users, directly from the comment stream. When
[talk-plugin-featured-comments](/talk/plugin/talk-plugin-featured-comments) is
enabled, it will also give the User's an option to feature from the stream.
@@ -0,0 +1,17 @@
---
title: talk-plugin-notifications-category-featured
permalink: /plugin/talk-plugin-notifications-category-featured/
layout: plugin
plugin:
name: talk-plugin-notifications-category-featured
depends:
- name: talk-plugin-notifications
- name: talk-plugin-featured-comments
provides:
- Server
- Client
---
When a comment is featured (via the
[talk-plugin-featured-comments](/talk/plugin/talk-plugin-featured-comments)
plugin), the user will receive a notification email.
@@ -0,0 +1,15 @@
---
title: talk-plugin-notifications-category-reply
permalink: /plugin/talk-plugin-notifications-category-reply/
layout: plugin
plugin:
name: talk-plugin-notifications-category-reply
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Replies made to each user will trigger an email to be sent with the notification
details if enabled.
@@ -0,0 +1,15 @@
---
title: talk-plugin-notifications-category-staff
permalink: /plugin/talk-plugin-notifications-category-staff/
layout: plugin
plugin:
name: talk-plugin-notifications-category-staff
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Replies made to each user by a staff member will trigger an email to be sent
with the notification details if enabled.
@@ -0,0 +1,16 @@
---
title: talk-plugin-notifications-digest-daily
permalink: /plugin/talk-plugin-notifications-digest-daily/
layout: plugin
plugin:
name: talk-plugin-notifications-digest-daily
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables a digesting option for users to digest their notifications on an `DAILY`
basis, where the notification batching occurs every day at midnight in the
`America/New_York` timezone.
@@ -0,0 +1,16 @@
---
title: talk-plugin-notifications-digest-hourly
permalink: /plugin/talk-plugin-notifications-digest-hourly/
layout: plugin
plugin:
name: talk-plugin-notifications-digest-hourly
depends:
- name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables a digesting option for users to digest their notifications on an `HOURLY`
basis, where the notification batching occurs every hour in the
`America/New_York` timezone.
@@ -0,0 +1,21 @@
---
title: talk-plugin-notifications
permalink: /plugin/talk-plugin-notifications/
layout: plugin
plugin:
name: talk-plugin-notifications
provides:
- Server
- Client
---
Enables the Notification system for sending out enabled email notifications to
users when they interact with Talk. By itself, this plugin will not send
anything. You need to enable one of the `talk-plugin-notifications-category-*` plugins.
Configuration:
- `DISABLE_REQUIRE_EMAIL_VERIFICATIONS` - When `TRUE`, it will disable the verification email check before sending notifications for those emails. **Note that organizations implementing a custom authentication system _must_ disable this feature, as they don't use our integrated auth**. (Default `FALSE`).
You can enable other notification options by adding more
`talk-plugin-notification-*` plugins!
+13
View File
@@ -0,0 +1,13 @@
---
title: talk-plugin-offtopic
permalink: /plugin/talk-plugin-offtopic/
layout: plugin
plugin:
name: talk-plugin-offtopic
provides:
- Server
- Client
---
Allows the comment authors to tag their comment as `Off-Topic` which will add a
visible badge on the frontend to other users that their comment is off-topic.
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-permalink
permalink: /plugin/talk-plugin-permalink/
layout: plugin
plugin:
name: talk-plugin-permalink
provides:
- Client
---
Enables a `Link` button that will provide a permalink to the comment that can be
shared with others.
@@ -0,0 +1,11 @@
---
title: talk-plugin-remember-sort
permalink: /plugin/talk-plugin-remember-sort/
layout: plugin
plugin:
name: talk-plugin-remember-sort
provides:
- Client
---
Enables saving a users last sort selection as they browse other articles.
+12
View File
@@ -0,0 +1,12 @@
---
title: talk-plugin-respect
permalink: /plugin/talk-plugin-respect/
layout: plugin
plugin:
name: talk-plugin-respect
provides:
- Server
- Client
---
Enables a `respect` reaction button.
+38 -9
View File
@@ -1,20 +1,49 @@
# Talk Plugin Rich Text - Pell
---
title: talk-plugin-rich-text-pell
permalink: /plugin/talk-plugin-rich-text-pell/
layout: plugin
plugin:
name: talk-plugin-rich-text-pell
depends:
- name: talk-plugin-rich-text
provides:
- Client
---
Enables rich text support client-side by using [Pell](https://github.com/jaredreich/pell).
## Installation
Add `talk-plugin-rich-text-pell` to the `plugins.json` in your Talk installation. Remember to add this in the `client` property since this plugin only covers the client side. To add server support, please use `talk-plugin-rich-text`. Ensure that you don't have any other plugins utilizing the `commentContent` slot, as it would result in duplicate comments.
Add `"talk-plugin-rich-text-pell"` to the `plugins.json` in your Talk
installation. Remember to add this in the `client` property since this plugin
only covers the client side. To add server support, please use
[talk-plugin-rich-text](/talk/plugin/talk-plugin-rich-text).
_Note: Ensure that you don't have any other plugins utilizing the
`commentContent` slot, as it would result in duplicate comments._
## How does this work?
This plugin contains 2 important components:
- The Editor (`./components/Editor.js`)
- The Comment Content Renderer (`./components/CommentContent.js`)
The editor component contains the rich text editor. For this particular plugin we chose [Pell](https://github.com/jaredreich/pell). Pell is the simplest and smallest WYSIWYG text editor with no dependencies that we could find.
- The Editor (`./components/Editor.js`)
- The Comment Content Renderer (`./components/CommentContent.js`)
If you check our `index.js` you will notice that we inject this editor in the `commentBox` slot. We do this to replace the core comment box with this one.
The editor component contains the rich text editor. For this particular plugin
we chose [Pell](https://github.com/jaredreich/pell). Pell is the simplest and
smallest WYSIWYG text editor with no dependencies that we could find.
Now, in order to render the new styled comments we need a comment renderer. For this task we will have to replace our core comment renderer by using the `commentContent` slot.
If you check our `index.js` you will notice that we inject this editor in the
`commentBox` slot. We do this to replace the core comment box with this one.
If you are not familiar with GraphQL `client/index.js` will look complicated, but fear not! With those functions we specify what to expect from the server schema, how to perform optimistic updates and how keep the client store updated with the latest changes.
Now, in order to render the new styled comments we need a comment renderer. For
this task we will have to replace our core comment renderer by using the
`commentContent` slot.
We encourage you to see the files and check how easy is to build plugins! If you have any feedback, please let us know.
If you are not familiar with GraphQL `client/index.js` will look complicated,
but fear not! With those functions we specify what to expect from the server
schema, how to perform optimistic updates and how keep the client store updated
with the latest changes.
We encourage you to see the files and check how easy is to build plugins! If you
have any feedback, please let us know.
+30 -5
View File
@@ -1,24 +1,49 @@
# Talk Plugin Rich Text
---
title: talk-plugin-rich-text
permalink: /plugin/talk-plugin-rich-text/
layout: plugin
plugin:
name: talk-plugin-rich-text
provides:
- Client
---
Enables secure rich text support server-side.
## Installation
Add `talk-plugin-rich-text` to the `plugins.json` in your Talk installation. Remember to add this in the `server` property since this plugin only covers the server side. To add frontend support consider using `talk-plugin-rich-text-pell`.
Add `"talk-plugin-rich-text"` to the `plugins.json` in your Talk installation.
Remember to add this in the `server` property since this plugin only covers the
server side. To add frontend support consider using
[talk-plugin-rich-text-pell](/talk/plugin/talk-plugin-rich-text-pell).
## How does this work?
This plugin uses the `comment.metadata` field to store the `richTextBody`. By adding `richTextBody` to the schema we can later on resolve it as part of the comment. The original `comment.body` is never touched. Using the `metadata` field allow us to build plugins that are not invasive to the core and also test the capabilities of our plugin framework. We encourage you to see the files and check how easy is to build plugins! If you have any feedback, please let us know.
This plugin uses the `comment.metadata` field to store the `richTextBody`. By
adding `richTextBody` to the schema we can later on resolve it as part of the
comment. The original `comment.body` is never touched. Using the `metadata`
field allow us to build plugins that are not invasive to the core and also test
the capabilities of our plugin framework. We encourage you to see the files and
check how easy is to build plugins! If you have any feedback, please let us
know.
## Configuration
There is a `config.js` in the root folder. This file contains the recommended settings.
There is a `config.js` in the root folder. This file contains the recommended
settings.
### `highlightLinks`
A `boolean` to highlight links. Set it to `false` to turn it off.
### `linkify`
Settings for highlighting links. These will only apply if `higlightLinks` is set to `true`.
### `dompurify`
Rules to sanitize html input. We use [DOMPurify] (https://github.com/cure53/DOMPurify) to prevent web attacks and XSS. Here is the complete list of [settings] (https://github.com/cure53/DOMPurify)
## `jsdom`
In order to run html in the server we need [jsdom](https://github.com/jsdom/jsdom). Usually you wouldnt need to modify this settings.
@@ -0,0 +1,24 @@
---
title: talk-plugin-slack-notifications
permalink: /plugin/talk-plugin-slack-notifications/
layout: plugin
plugin:
name: talk-plugin-slack-notifications
provides:
- Server
---
Enables all new comments that are written to be posted to a Slack channel as
well. Configure an
[Incoming Webhook](https://api.slack.com/incoming-webhooks)
app and provide that url in the form of the `SLACK_WEBHOOK_URL`
detailed below.
*Warning: On high volume sites, this means every single comment will flow into
Slack, if this isn't what you want, be sure to use the provided plugin as a
recipe to further customize the behavior*.
Configuration:
- `SLACK_WEBHOOK_URL` (**required**) - The webhook url that will be
used to post new comments to.
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-liked
permalink: /plugin/talk-plugin-sort-most-liked/
layout: plugin
plugin:
name: talk-plugin-sort-most-liked
depends:
- name: talk-plugin-like
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `like` reactions first.
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-loved
permalink: /plugin/talk-plugin-sort-most-loved/
layout: plugin
plugin:
name: talk-plugin-sort-most-loved
depends:
- name: talk-plugin-love
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `love` reactions first.
@@ -0,0 +1,14 @@
---
title: talk-plugin-sort-most-replied
permalink: /plugin/talk-plugin-sort-most-replied/
layout: plugin
plugin:
name: talk-plugin-sort-most-replied
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most replies first.
@@ -0,0 +1,15 @@
---
title: talk-plugin-sort-most-respected
permalink: /plugin/talk-plugin-sort-most-respected/
layout: plugin
plugin:
name: talk-plugin-sort-most-respected
depends:
- name: talk-plugin-respect
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the comments with the most `respect` reactions first.
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-sort-newest
permalink: /plugin/talk-plugin-sort-newest/
layout: plugin
plugin:
name: talk-plugin-sort-newest
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the newest comments first.
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-sort-oldest
permalink: /plugin/talk-plugin-sort-oldest/
layout: plugin
plugin:
name: talk-plugin-sort-oldest
depends:
- name: talk-plugin-viewing-options
provides:
- Server
- Client
---
Provides a sort for the oldest comments first.
+14
View File
@@ -0,0 +1,14 @@
---
title: talk-plugin-subscriber
permalink: /plugin/talk-plugin-subscriber/
layout: plugin
plugin:
name: talk-plugin-subscriber
provides:
- Server
- Client
---
Enables a `Subscriber` badge to be added to comments where the author has the
`SUBSCRIBER` tag. This must match with a custom auth integration that adds the
tag to the users that are subscribed to the service.
@@ -0,0 +1,28 @@
---
title: talk-plugin-toxic-comments
permalink: /plugin/talk-plugin-toxic-comments/
layout: plugin
plugin:
name: talk-plugin-toxic-comments
provides:
- Server
- Client
---
Using the [Perspective API](http://perspectiveapi.com/), this
plugin will warn users and reject comments that exceed the predefined toxicity
threshold. For more information on what Toxic Comments are, check out the
[Toxic Comments](./toxic-comments/) documentation.
Configuration:
- `TALK_PERSPECTIVE_API_KEY` (**required**) - The API Key for Perspective. You
can register and get your own key at [http://perspectiveapi.com/](http://perspectiveapi.com/).
- `TALK_TOXICITY_THRESHOLD` - If the comments toxicity exceeds this threshold,
the comment will be rejected. (Default `0.8`)
- `TALK_PERSPECTIVE_API_ENDPOINT` - API Endpoint for hitting the
perspective API. (Default `https://commentanalyzer.googleapis.com/v1alpha1`)
- `TALK_PERSPECTIVE_TIMEOUT` - The timeout for sending a comment to
be processed before it will skip the toxicity analysis, parsed by
[ms](https://www.npmjs.com/package/ms). (Default `300ms`)
- `TALK_PERSPECTIVE_DO_NOT_STORE` - Whether the API is permitted to store comment and context from this request. Stored comments will be used for future research and community model building purposes to improve the API over time. (Default `true`) [Perspective API - Analize Comment Request](https://github.com/conversationai/perspectiveapi/blob/master/api_reference.md#analyzecomment-request)
@@ -0,0 +1,11 @@
---
title: talk-plugin-viewing-options
permalink: /plugin/talk-plugin-viewing-options/
layout: plugin
plugin:
name: talk-plugin-viewing-options
provides:
- Client
---
Pluginizes the sorting/viewing options for a comment stream.
+5 -1
View File
@@ -6817,6 +6817,10 @@ lru-cache@^4.0.1, lru-cache@^4.1.1:
pseudomap "^1.0.2"
yallist "^2.1.2"
lunr@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.1.6.tgz#671d2321c4c5bc4c522914953d1c54d612f60aa7"
macaddress@^0.2.8:
version "0.2.8"
resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12"
@@ -7149,7 +7153,7 @@ mocha@^3.1.2:
mkdirp "0.5.1"
supports-color "3.1.2"
moment-timezone@^0.5.14:
moment-timezone@^0.5.14, moment-timezone@^0.5.x:
version "0.5.14"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.14.tgz#4eb38ff9538b80108ba467a458f3ed4268ccfcb1"
dependencies: