Giter VIP home page Giter VIP logo

demo-js-wildpad's Introduction

demo-js-wildpad

Wildpad是一个开源的协同文本编辑器,它可以嵌入到较大的应用中.

在线示例

可以参考wilddog demo

一个demo页面的快照

在线文档

Wildpad在线文档

下载

Wildpad 使用 Wilddog提供后端服务,因此它不需要后端的支持,只需要引入少量的 js文件,就可以把它嵌入到你的应用中。

<!-- Wilddog -->
<script src='https://cdn.wilddog.com/js/client/current/wilddog.js'></script>

<!-- CodeMirror -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.2.0/codemirror.css"/>

<!-- Wildpad -->
<link rel="stylesheet" href="https://cdn.wilddog.com/app/wildpad/0.1/wildpad.css" />
<script src="https://cdn.wilddog.com/app/wildpad/0.1/wildpad.js"></script>

示例代码

<div id="wildpad"></div>
<script>
  var wildpadRef = new Wilddog('<WILDDOG URL>');
  var codeMirror = CodeMirror(document.getElementById('wildpad'), { lineWrapping: true });
  var wildpad = Wildpad.fromCodeMirror(wildpadRef, codeMirror,
      { richTextShortcuts: true, richTextToolbar: true, defaultText: 'Hello, World!' });
</script>

野狗支持使用 CodeMirrorACE作为基础编辑器,可以参考 wildpad文档

本地运行

首先确认本机已经安装 Node.js 运行环境,然后执行下列指令:

git clone [email protected]:WildDogTeam/demo-js-wildpad.git
cd  demo-js-wildpad

安装依赖:

npm install bower -g
npm install
bower install

启动项目:

grunt

你也可以通过npm 或者 bowr安装Wildchat, 他们会自动下载依赖。

$ bower install wildpad --save
  • dist/ - grunt文件合并路径 (wildpad.js, wildpad.min.js, wildpad.css, wildpad.eot).
  • examples/ - 一些嵌入Wildpad的例子.
  • font/ - 工具栏的图标和字体.
  • lib/
    • wildpad.js
    • text-operation.js, client.js
    • annotation-list.js
    • rich-text-codemirror.js
    • wilddog-adapter.js

生成本地文档

本地文档是用jekyll构建的,jekyll需要ruby环境的运行环境。如果没有ruby环境,可以查看上面的在线文档。

cd website/

生成web部署文件:

jekyll build

本地运行

jekyll serve --watch

你可以访问http://localhost:4000/预览

发布生成html文件,可以运行 ./deploy.sh

入门

Wildpad使用野狗数据库,你可以从这里 注册一个免费体验账号。

更多示例

这里分类汇总了 WildDog平台上的示例程序和开源应用, 链接地址:https://github.com/WildDogTeam/wilddog-demos

支持

如果在使用过程中有任何问题,请提 issue ,我会在 Github 上给予帮助。

相关文档

License

MIT http://wilddog.mit-license.org/

感谢 Thanks

We would like to thank the following projects for helping us achieve our goals:

Open Source:

  • firepad Firepad is an open-source, collaborative code and text editor. It is designed to be embedded inside larger web applications.
  • jquery The Write Less, Do More, JavaScript Library
  • codemirror CodeMirror is a versatile text editor implemented in JavaScript for the browser.
  • ace Ace is an embeddable code editor written in JavaScript.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.