forked from thetutlage/html-to-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit eee5639
Showing
9 changed files
with
482 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_size = 2 | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
###Node### | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
|
||
###OSX### | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear on external disk | ||
.Spotlight-V100 | ||
.Trashes | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# npm specific | ||
|
||
test | ||
.cz.json | ||
.travis.yml | ||
.editorconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
|
||
/** | ||
* html-to-markdown | ||
* Copyright(c) 2015-2015 Harminder Virk | ||
* MIT Licensed | ||
*/ | ||
|
||
var converter = require('../index'); | ||
|
||
var html = `<div> | ||
<h2> This is a dummy heading for Lorem guy </h2> | ||
<h3> I am sub heading buddy </h3> | ||
<p> This is a paragrap buddy </p> | ||
<ul> | ||
<li> This is ul 1 </li> | ||
</ul> | ||
<ol> | ||
<li> This is ol 1 </li> | ||
</ol> | ||
<ul> | ||
<li> This is ul 2 </li> | ||
</ul> | ||
<section> This is a section </section> | ||
<pre> | ||
var name = "foo"; | ||
</pre> | ||
<blockquote> | ||
This is super quote | ||
In multiple lines | ||
</blockquote> | ||
<b> This is bold tag </b> | ||
<i> Some italic </i> | ||
</div> | ||
` | ||
console.log(converter.convert(html)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
'use strict'; | ||
|
||
/** | ||
* html-to-markdown | ||
* Copyright(c) 2015-2015 Harminder Virk | ||
* MIT Licensed | ||
*/ | ||
|
||
module.exports = require('./src/index.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "html-to-markdown", | ||
"version": "1.0.0", | ||
"description": "html to markdown converter with zero dependencies", | ||
"main": "index.js", | ||
"directories": { | ||
"example": "examples" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [ | ||
"html-to-markdown", | ||
"markdown" | ||
], | ||
"author": "amanvirk", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/thetutlage/html-to-markdown.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/thetutlage/html-to-markdown/issues" | ||
}, | ||
"homepage": "https://github.com/thetutlage/html-to-markdown#readme" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Html to markdown converter | ||
|
||
Html to markdown converter is a dependency free converter which replaces html with a valid markdown syntax. I have just started working on it, so all tags may not be supported. | ||
|
||
## Supported Platforms | ||
|
||
1. Web browsers. | ||
2. NodeJs | ||
|
||
## Tags Supported | ||
|
||
1. h1,h2,h3,h4,h5,h6 | ||
2. p | ||
3. ul,ol | ||
4. blockquote, | ||
5. pre | ||
6. bold,strong | ||
7. italic,em | ||
|
||
## Converting Html Documents | ||
|
||
```javascript | ||
var converter = require('html-to-markdown'); | ||
var markdown = converter.convert('<h2> Happy Journey </h2>'); | ||
``` | ||
|
||
## Extending to add your own formatters. | ||
|
||
```javascript | ||
var converter = require('html-to-markdown'); | ||
converter.use(function (html) { | ||
// making required changes | ||
// and return new html | ||
}) | ||
``` |
Oops, something went wrong.