https://github.com/hygull/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.
https://github.com/hygull/node-markdown
documentation documentation-generator file-creation html5 markdown node-module
Last synced: about 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/hygull/node-markdown
- Owner: hygull
- License: mit
- Created: 2018-12-07T17:06:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-20T17:01:35.000Z (over 7 years ago)
- Last Synced: 2025-03-16T04:41:30.409Z (about 1 year ago)
- Topics: documentation, documentation-generator, file-creation, html5, markdown, node-module
- Language: JavaScript
- Homepage: https://hygull.github.io/node-markdown/
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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/](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
* Get/set markdown code to display image
> Please look into the below well commented examples to have a quick taste.
Get/set visit links
```javascript
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));
```
Get/set markdown code to display image
```javascript
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));
```