Giter VIP home page Giter VIP logo

mditor's Introduction

alt

简单说明

Mditor 最早只有「组件版」,随着「桌面版」的发布,Mditor 目前有两个版本:

相关特性

除常规的编辑功能,Mditor 桌面版还有如下特性

  • 多文件编辑,Mditor 桌面版是一个「多窗口」应用,可以通过「菜单、Dock、右键菜单」打开多个窗口实例进行多件编辑
  • 支持 GFM,如表格等(GFM 是 Github 拓展的基于 Markdown 的一种纯文本的书写格式)
  • 自动完成,Mditor 支持「无序列表、有序列表、引用」的自动完成,以辅助输入。
  • 多种编辑语言的的「代码高亮」支持(通过 ``` 语法)
  • 分屏实时预览,全屏预览
  • 导出 「HTML、PDF、Image」等功能。

如何参与

  • 如果有任何问题或建议,可以直接发起 Issue
  • 当然,你也可以直接向 Mditor 发起 Pull Request
  • 非常欢迎,直接给 Mditor 加个 Star,这将是对 Midior 不错的鼓励,它会变成动力。

开发指南

Clone 源码
$ git clone [email protected]:Houfeng/mditor-desktop.git your_path
安装依赖

前提是需要安装好 Nodejs 和 npm(建议用 cnpm 可以通过国内镜象加速)

$ npm install
自动构建

将会自动进行基于 Webpack 的构建(部分资源需要 Webpack 打包),并将 Watch 文件的改动然后自动进行构建

$ npm run dev
启动程序

将会启动开发中的 Mditor

$ npm start

mditor's People

Contributors

houfeng avatar p-ppc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mditor's Issues

不支持iframe解析吗?

<iframe width="100%" height="300" src="//jsfiddle.net/lys623/38ewfkby/embedded/" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

楼主超赞👍

基本上你的这个编辑器全部满足自己的需求,前端编辑器可视化编辑,后端接受markdown格式字符串存入数据库,在node层面做解析。但是如果可以选择不同的代码高亮皮肤就更好了

npm方式下载的包,只引出了Parser方法。

我在想前端工程里使用您的项目,但是发现我用npm下的包 只引出了Parser方法。
如果我想用这个项目的话, 只能通过script的方式使用吗?

补充:
刚刚我看了一下,发现src/server/index里的确只有暴露出了Parserversion这两个不知道方不方便做一下修改?

如何在textarea中加入input元素

你好,我在node项目中使用了Mditor,现在有个问题是我修改js代码在 textarea元素中加入了一个input元素作为文章标题,执行后html结构中有input元素,但页面中却找不到,请问这个问题应该怎么解决.

崩溃情况

已经出现过几次了,如果文档写的稍微大了一点就会出现崩溃(不知是否是这个原因,几次出现的情况都是这样),崩溃后再次打开一编辑又崩溃

react页面渲染

hi, 我发现当我编辑时,样式比如是比较完美的,但是当我用parser.parse渲染的时候发现并没有展现出预期的样式效果,而是一堆字符串,只好使用react的自带的html渲染来做,但是使用dangerouslySetInnerHTML={{
__html: ${data.content}
}}
会发现有很多样式根本无法渲染,请问是不是服务端的parse有问题?

加油

看了这个比很多md组件都好用,试用后特来感谢!

和vuejs冲突

vujs 和 mditor都用{{}},编辑器加载不出来,有如下错误:

  • class="mditor {{split?'split':''}} {{preview?'preview':''}} {{fullscreen?'fullscreen':''}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of
    , use
    .
  • style="width:{{width}};height:{{height}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of
    , use
    .
  • class="finder {{active?'active':''}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of
    , use
    .

(found in )

可以增加一个vue-cli项目的模板吗

小白看完文档想在vue-cli的项目使用 mditor 发现报错
我在vue-cli 项目的index.html中引入

   <!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>oscweb</title>
    <link rel="stylesheet" type="text/css" href="/static/css/mditor.min.css">
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
		<script type="text/javascript" src="/static/js/mditor.min.js"></script>
  </body>
</html>

在使用的时候

    mounted () {
      this.$nextTick(function () {
        var mditor = Mditor.fromTextarea(document.getElementById('editor'))
        mditor.on('ready', function () {
          console.log(mditor.value)
          mditor.value = '** hello **'
        })
      })
    }

控制台告知我Mditor not defined
然后我通过npm 安装 mditor
在.vue文件中

import Mditor from 'mditor'

控制台输出信息

[Vue warn]: Error in nextTick: "TypeError: __WEBPACK_IMPORTED_MODULE_0_mditor___default.a.fromTextarea is not a function"

found in

---> <AddRes> at C:\git\OSCourse\oscweb\src\components\add_res.vue
       <App> at C:\git\OSCourse\oscweb\src\App.vue
         <Root>
  • 希望知道如何在vue项目中使用mditor
  • 希望可以增加一个vue项目使用的demo

可否上传至CDN

这个项目非常不错,给作者点赞 👍

我准备在 tale 项目中使用,可否将发布的js/css 发布到CDN上,比如 http://www.bootcdn.cn 或者其他的前端CDN

还有个小tip,希望把 toolbar 的选项列举出来 😄

Uncaught TypeError: Function.prototype.toString requires that 'this' be a Function

@Houfeng 感谢分享,然后我在web上调用的时候,出现这个错误,请问是怎么回事呢?非常感谢~

错误提示: Uncaught TypeError: Function.prototype.toString requires that 'this' be a Function
qq20180623-213617

调用代码:

<textarea name="editor" id="editor"></textarea>
<script>
    //获取textarea dom对象
    var ele_textarea = document.getElementById('editor');
    //实例化Mditor
    var editor = new Mditor(ele_textarea);

</script>

初始化mditor只有一种方式么?

初始化mditor 只有一种方式么?
mditor = window.mditor = Mditor.fromTextarea(document.getElementById('md-editor'));

我现在只想用Parser去解析markdown怎么办到呢?

请问有什么方式能卸载编辑器吗?

比如我需要通过一个选项组来切换是否是普通的富文本编辑器或者是markdown编辑器?
我发现mditor在渲染后就一直存在了,有没有什么方式能在选择普通富文本编辑器的时候让我卸载mditor渲染普通的编辑器?

程序外的复制无法粘贴

在窗口外的复制无法在程序里粘贴.
例如我在Chrome还是notepad里复制一段text, 在程序里无法粘贴.
但是在程序里复制就可以正常使用.

最新版里面,能否加个地理位置上去??

最新版里面,能否加个地理位置上去??

先看看我添加的上传部分哈,哈哈
image

但是我看到一款编辑器也挺好的,就是没有 mditor 简便(个人想法哈)...,他里面有两个功能是很强大的....,你看看哈:
视频:
image

地理位置:
image

个人建议哈,目前这个版本的功能我也够用了

gpcc install

gpcc 安装记录

gpcc(Greenplum Command Center)是pivotal提供的Greenplum性能监控工具, 可监控各segment的状态、内存使用情况、磁盘io. 安装包可以在这里下载

安装步骤:

  1. 执行下面的命令,建立名为gpperfmon的数据库,默认使用gpmon用户
    ```[gpadmin@mdw ~]$ gpperfmon_install --enable --password gpmon --port 5432` ``

1

  1. 重启数据库

`[gpadmin@mdw ~]$ gpstop -r`

gpstop_log

重启时报错,查看日志发现实pg_hba.conf文件配置出错,修改后就可以了

  1. 查看gpmmon进程是否已经启动
    `` `gpadmin@mdw ~]$ ps -ef | grep gpmmon| grep -v grep```

4 . 查看Performance Monitor数据库写入数据是否正常,检查是否有记录写入
[gpadmin@mdw ~]$ psql -d gpperfmon -c 'select * from system_now'

  1. 如果配置了master的standby,拷贝Master主机拷贝配置文件到Standby Master的相应目录
[gpadmin@mdw ~]$ gpscp -h smdw /data/master/gpseg-1/pg_hba.conf =:$MASTER_DATA_DIRECTORY/
[gpadmin@mdw ~]$ gpscp -h smdw ~/.pgpass =:~/
  1. 安装gpccc,注意是root用户
[root@mdw local]# unzip greenplum-cc-web-3.0.1-LINUX-x86_64.zip
[root@mdw local]# ./greenplum-cc-web-3.0.1-LINUX-x86_64.bin
[root@mdw local]# chown -R gpadmin:gpadmin /usr/local/greenplum-cc-web
[root@mdw local]# chown -R gpadmin:gpadmin /usr/local/greenplum-cc-web-3.0.1
  1. 设置环境变量
[root@mdw local]# echo "source /usr/local/greenplum-cc-web-3.0.1/gpcc_path.sh" >>/home/gpadmin/.bashrc
[root@mdw ~]# echo "source /usr/local/greenplum-db-4.3.8.1/greenplum_path.sh" >>.bashrc 
[root@mdw ~]# source .bashrc
[root@mdw ~]# chmod 777 /usr/local/greenplum-cc-web-3.0.1/gpcc_path.sh
[root@mdw ~]# source /usr/local/greenplum-db/greenplum_path.sh
[root@mdw ~]# source /usr/local/greenplum-cc-web/gpcc_path.sh
  1. 在所有主机安装GPCCC
[root@mdw ~]# gpccinstall -f /home/gpadmin/conf/hostlist
  1. 复制配置文件到其他节点主机
[gpadmin@mdw ~]$ gpscp -h sdw1 .bashrc =:~/
[gpadmin@mdw ~]$ gpscp -h sdw2 .bashrc =:~/
  1. 配置安装详细项

gpcmdr --setup

   Please enter a new instance name:输入gpcc
   Is the master host for the Greenplum Database remote? Yy|Nn (default=N):n
   What would you like to use for the display name for this instance:gpcc
   What port does the Greenplum Database use? (default=5432):回车
   will you install workload manaager (default=N):Y
   What port would you like the web server to use for this instance?回车
   Do you want to enable SSL for the Web API Yy|Nn (default=N):n
   Do you want to copy the instance to a standby master host Yy|Nn (default=Y): 没有standby n
   What is the hostname of the standby master host? [mdw]:回车 
  1. 启动实例
    gpcmdr --start gpcc

  2. 登录 ip:28080

Error: Cannot find module './parser'

在前端使用的时候发生这样的错误
这个错误是突然出现的,以前是正常的,不知道是否是我的问题
接着是这个错误
ReferenceError: Mditor is not defined,应该是上面那个引起的

Cool,希望能在 v0.1.2 加入以下优化

谢谢分享。试用感受:

  • 很简洁很大方;
  • 分屏全屏很棒;
  • 遗憾:没有快捷键,希望有,并且可以自定义;
  • 遗憾:从 toolbar 点击插入代码后,ctrl+z 无法恢复到上一步;
  • 遗憾:tab 可以缩进,但 shift+tab 无法取消缩进;
  • 遗憾:-* 无序列表及有序列表,按 enter 后下一行没有自动补全;

undo+redo

是否能加入撤销和重做功能呐?

更改图片工具条行为

按照说明,更改图片工具条行为API:let btn = mditor.Toolbar.getItem('image');但页面报错:Uncaught TypeError: Cannot read property 'getItem' of undefined,求指教!

能不能够多图片上传??

我试用了下 demo ,但是只能够但图片添加,能否一次性添加多图片??

还有,demo中,添加图片都是 ![alt](img src) 这种格式,需要自己手动填入 img src 才能够生成图片预览。而且只能够但图片添加。

能否一次性上传多张图片 + 上传完毕后,即时预览??

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.