This is to convert markdown to HTML via a node.js server.
This is experimental and intended for use on an intranet with an Ubuntu server on LAN. Follow the following instructions at your own risk. This is a successful project for the author, but you may need to customize these next steps based on the unique setup of your system and your unique needs.
This project provides a browser-based tool to convert Markdown text into HTML. Built with Node.js and Express, it allows users to paste Markdown text into a text box and instantly view the HTML output.
The following files are required to set up this project:
app.js: Main Node.js server file.public/index.html: Front-end interface for input and output.LICENSE: License file for the project.
You can access these files directly in the repository to copy or edit them.
Run the following commands on your Ubuntu server:
mkdir markdown-to-html
cd markdown-to-html
mkdir public uploadsUse nano or your preferred text editor to create the following files:
-
app.js: Create in the root directory.nano app.js
Copy the content of the file from the repository.
-
index.html: Create in thepublic/directory.cd public nano index.htmlCopy the content of the file from the repository.
-
LICENSE: Create in the root directory as needed.
Ensure Node.js is installed:
sudo apt update
sudo apt install nodejs npmInstall required dependencies:
npm install expressStart the server:
node app.jsAccess the app in your browser:
http://<SERVER_LOCAL_IP>:4444
Replace <SERVER_LOCAL_IP> with your server's local IP address.
To keep the app running and auto-restart it on reboot:
-
Install PM2:
sudo npm install -g pm2
-
Start the App with PM2:
pm2 start app.js --name markdown-to-html
-
Enable Auto-Start on Boot:
pm2 startup pm2 save
-
Verify Status:
pm2 status
Once the server is running, you can access the app using:
http://<SERVER_LOCAL_IP>:4444
- Node.js and Express.js: For back-end server functionality.
- Marked.js: Client-side Markdown-to-HTML conversion.
This project is licensed under the Apache-2.0 license.