Coder Social home page Coder Social logo

daveying / markdown-editor Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 69.69 MB

This is a markdown editor based on Node.js and ACE web editor.

Home Page: http://md.xp-da.com

HTML 41.67% CSS 46.13% JavaScript 12.21%
markdown-editor ace-editor markdown-it web-app html-tutorial javascript-tutorial nodejs-tutorial

markdown-editor's Introduction

Introduction

This is a markdown editor based on ACE web editor and markdown-it.

You can deploy this editor on a remote server or just install on local computer.

It's very easy to use. Just open the web page and you can edit markdown text at left and you can preview the results at right once you press the button Preview. You can save the file to local if you press the button Save. Click Settings, you can choose the font size of editor, also you can choose the CSS style of preview window.

How to deploy on local computer

Install Node.js

This editor is based on Node.js, so you should install Node.js first. You can find Node.js package here.

Download proper version according your platform and follow the install instructions provided by Node.js website.

The way to verify you have already install Node.js is to run following two command:

$ node -v
$ npm -v

Above commands are used to check the version of Node.js and npm you have just installed. You should get similar output.

$ node -v
v6.9.5
$ npm -v
4.1.2

Download the source code of the editor

Download/clone the source code of the editor from github.

Find the code in server.js:

var server = app.listen(7888, function () {
    var host = server.address().address;
    var port = server.address().port;

    console.log("Markdown Editor is openned at: http://%s:%s", host, port);
})

Make sure the port this application is listening is 7888(you can pick another available port if you know what will be affected).

By now, you can run the server with Node.js.

$ node /path/to/source/code/server.js

Then, open a browser, and visit http://127.0.0.1:7888/index.html, you can see the editor like this.(Yes, you need to specify port 7888 here) Markdown Editor

How to deploy on remote server

You need ssh to your remote server, and do this steps on remote server.

Install Node.js

First ssh to your remote server, I think this step will not be a problem once you already have a remote server.

And then, it is the same as install on local. You may need to install it via PPA, and you can google it how to install Node.js on remote server.

Download the source code of the editor

First make sure you have installed git on your remote server, so you can clone the source with a simple command line:

git clone https://github.com/daveying/Markdown-Editor.git

You alse need to google it.(note: different OS, different ways)

Find the code in server.js:

var server = app.listen(7888, function () {
    var host = server.address().address;
    var port = server.address().port;

    console.log("Markdown Editor is openned at: http://%s:%s", host, port);
})

Make sure the port this application is listening is 80. Here we choose 80 is because you can visit the app just specify IP address on your broswer. And it is much easier to setup a domain name.

By now, you can run the server with Node.js.

$ node /path/to/source/code/server.js

Then, open a browser, and visit http://ip_of_your_remote_server, you should see this editor.

If you have a domain name

You can add an A record point to ip address of your remote server, and you can using your domain to visit this editor. (If the port is not set to 80, you should using a tool called nginx)

You already have a domain name, so you can figure out how to setup this. Here is the rendering of this web app when visit it via a mobile device.

Markdown Editor

markdown-editor's People

Contributors

daveying avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.