Skip to content

This is a html2markdown converter for the specific README.md(a html file) generated by leethub.

Notifications You must be signed in to change notification settings

notdp/tinyhtmlmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tinyhtmlmd

About

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 in rt command).

Usage

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.

npm module

  1. install
npm install tinyhtmlmd --save
  1. import

commonjs module:

const randomName = require('tinythtmlmd')

es6 module:

import {h2m} from 'tinyhtmlmd'

browser

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

About

This is a html2markdown converter for the specific README.md(a html file) generated by leethub.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published