Skip to content

An npm package which allows to generate a markdown file using a pure object oriented oriented approach which can be used to create documentation (README.md) for projects.

License

Notifications You must be signed in to change notification settings

hygull/node-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-markdown

An npm package which allows to generate a markdown file using a pure object oriented oriented approach which can be used to create documentation (README.md) for projects.

You can also visit https://hygull.github.io/node-markdown/ and read the beautiful documentation.

Installation

Type Command
Locally npm install node-markdown
Globally npm install node-markdown -g

What is markdown and who developed it?

  • Markdown is a lightweight markup language with plain text formatting syntax. Its design allows it to be converted to many output formats, but the original tool by the same name only supports HTML.

  • Developed by » John Gruber (in collaboration with Aaron Swartz on the syntax)

Examples

Please look into the below well commented examples to have a quick taste.

const {Markdown} = require("node-markdown");
const md = new Markdown();

/* Get anchor link (to visit)
   ==========================
   
   [Visit w3schools](https://www.w3schools.com)
*/
console.log(md.getTextLink("Visit w3schools", "https://www.w3schools.com"));

/* Set anchor link (to visit)
   ==========================

	{
	    "elements": [
	        "[Visit w3schools](https://www.w3schools.com)"
	    ]
	}
*/
md.setTextLink('Visit w3schools', 'https://www.w3schools.com');
console.log(JSON.stringify(md.markdown, null, 4));
const {Markdown} = require("node-markdown");
const md = new Markdown();


/* Get image link (to display)
   ===========================

   ![Graph icon]{https://image.flaticon.com/icons/svg/123/123407.svg}
*/
console.log(md.getImageLink("Graph icon", "https://image.flaticon.com/icons/svg/123/123407.svg"));

/* Set image link (to display)
   ===========================

	{
	    "elements": [
	        "![Graph icon]{https://image.flaticon.com/icons/svg/123/123407.svg}"
	    ]
	}
*/
md.setImageLink('Graph icon', 'https://image.flaticon.com/icons/svg/123/123407.svg');
console.log(JSON.stringify(md.markdown, null, 4));

About

An npm package which allows to generate a markdown file using a pure object oriented oriented approach which can be used to create documentation (README.md) for projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published