Canvas网络教学平台安装RCE富文本编辑插件(Rich Content Editor)
Rich Content Editor
Canvas includes a new rich content editor component to support a consistent editor experience across multiple applications in the Canvas ecosystem. To make use of this component you need to run a supporting API server. See the Canvas RCE API Documentation for information on running the service and configuring Canvas to make use of it. Starting July 14, 2018, the stable branch of canvas-lms will require this service to be running and configured for full rich content editing functionality.
设置里说明:
富内容编辑器侧栏增强 hidden 启用功能:富内容编辑器侧栏增强
在任何地方使用新的带有增强侧栏的富内容编辑器
原始效果图:
安装RCE插件后:
除了样式好看一些,功能上没有什么区别吧!!!
安装:
网址:https://github.com/instructure/canvas-rce-api
- 克隆代码
cd /var
git clone https://github.com/instructure/canvas-rce-api.git
- 安装依赖
cd canvas-rce-api
npm install --production
如果提示无权限Permission denied,加了sudo也没用的话,执行下一句安装
npm install --unsafe-perm=true --allow-root
- 添加配置文件
复制配置文件:cp .env.example .env
修改配置文件:vi .env
PORT=3000
NODE_ENV=production
#STATSD_HOST=127.0.0.1
#STATSD_PORT=8125
ECOSYSTEM_SECRET="astringthatisactually32byteslong"
ECOSYSTEM_KEY="astringthatisactually32byteslong"
#CIPHER_PASSWORD=TEMP_PASSWORD
其中,port代表api服务使用的端口,访问即为localhost:port。
ECOSYSTEM_SECRET和ECOSYSTEM_KEY即为Canvas配置文件中dynamic_settings.yml
配置的。
需配置dynamic_settings.yml
中rich-content-service
下的app-host
。(貌似需要用域名,因为是前端访问的,不是主机访问,故不能使用localhost或内网ip地址)
production:
config:
canvas:
canvas:
encryption-secret: "astringthatisactually32byteslong"
signing-secret: "astringthatisactually32byteslong"
rich-content-service:
app-host: "canvas-rce-api-host"
参数数明:
Configuration options are set via the following environment variables:
ECOSYSTEM_KEY: Required The encryption secret shared with Canvas.
ECOSYSTEM_SECRET: Required The signing secret shared with Canvas.
FLICKR_API_KEY: Required to support Flickr image search.
YOUTUBE_API_KEY: Required for querying titles of YouTube embeds.
NODE_ENV: This should always be set to production when running in production.
PORT: Defaults to port 3000. This is not used when running with Docker since Node Passenger monkey patches node http to control the port each node process is listening on.
STATSD_HOST: If you would like to collect metrics with statsd, this should be set to the host of your statsd server.
STATSD_PORT: If you would like to collect metrics with statsd, this should be set to the port of your statsd server.
- 启动
cd canvas-rce-api
npm run start:dev
- Canvas后台开启
设置,功能选项,富内容编辑器侧栏增强,打开