This is a html2markdown converter for the specific README.md(a html file) generated by leethub.
I have done the following:
- The title will be converted to a first-level title .
- The degree of difficulty will be converted into a secondary heading and
"## 1. Problem Description - "
will be added before it. - html <pre> codeblock converted to markdown codeblock with
text
property. - <strong> will be removed when it appers in codeblock.
- The <hr> tag will be filtered out for the title of the github pages comes with a split line.
"\n\n## 2. Solutions\n"
will be added at the end of the file(it only works inrt
command).
install first:
npm install tinyhtmlmd -g
after install:
Make sure you have a README.md(will be converted file) your current folder.
run rt
command,the file will be converted to a pure md file.
- install
npm install tinyhtmlmd --save
- import
commonjs module:
const randomName = require('tinythtmlmd')
es6 module:
import {h2m} from 'tinyhtmlmd'
just cory ./dist/tiny.js, this is a umd browser support file. Output library name is tiny
<script src="../dist/tiny.js"></script>
<script>
console.log(tiny.h2m)
console.log(tiny.h2m('<h3>this is h3</h3>>'))
console.log(another.h2m)
</script>
output:
ƒ P(e){...
## 1. Description - this is h3\>
Uncaught ReferenceError: another is not defined