I. Introduction of open source project
Today, WE share a wechat Markdown typesetting tool Markdown Nice that supports custom styles, which greatly saves the typesetting problems of wechat public accounts. Good typesetting content can also be published to other platforms, such as Zhihu, Open Source China, Rare Earth Nuggets, Blog Park and CSDN.
Ii. Project construction
The premise
- Locally installed
Node.js
Environment, if not installed please install yourself - Server deployment needs to be mastered
Docker
technology
Download the project
Download the project locally and execute the following code:
cd D:\devEnv\
git clone https://github.com/mdnice/markdown-nice # Download project
Copy the code
Installing a plug-in
Switch to the root directory of the project, open the CLI, and run the following command to install yarn
npm install yarn -g Install plugins
Copy the code
Run locally
Switch to the project root directory, open a command line window, and run the project by executing the following command:
yarn Install plugins
yarn start # Start a project
Copy the code
Note: Because this project requires a lot of project dependencies, all dependencies to install a little wait. Local access: http://localhost:3000/
Server Deployment
In the root directory of the project, run yarn Build to build the project. The generated build directory is the built content. To deploy the built code to the service, HERE I use the Docker tool. Execute the following code to deploy the project to the server.
docker search nginx # Search for docker images
docker pull docker.io/nginx
docker ps -a # View all Docker containers
netstat -an|grep 80 Check the usage of port 80
history |grep docker |grep nginx Docker nginx operation history
docker run --name nginx80 -p 8000:80 -v /usr/myWorkpace/mdedit/markdown-nice/build:/usr/share/nginx/html -d docker.io/nginx
Copy the code
Services deployed success, visit: http://34.68.204.21:8000/
More functions
The image upload function is not configured yet, and I will do so next. For more information and instructions, please refer to the project documentation at docs.mdnice.com/
Three, the last
The reason why I am willing to share open source projects is very simple. The author of open source projects may want to improve technical ability, or solve pain points and so on. Since they can open source their projects, I am more willing to share excellent open source projects with more people, so that more partners can feel the charm of open source projects. Participate in open source, learn to share, and have fun!