create html code reading markdown file by file system of node
npm install austin-markdown-to-htmlshell
npm i austin-html-markdown-to-html
`
$3
`javascript
const mdToHtml = require("autin-html-markdown-to-html");
const resultHtml = mdToHtml("./something.md");
`
- 변환하는 md파일의 경로는 프로젝트 폴더의 루트 위치를 출발지로 합니다. (= 프로젝트의 package.json 파일 위치가 출발지 입니다)
$3
`javascript
const mdToHtml = require("autin-html-markdown-to-html");
const resultHtml = mdToHtml("./something.md", { a: "color: red;" });
`
- styleOptions객체를 옵션으로 원하는 스타일을 추가할 수 있습니다.
| md 문법 | 변환된 tag명 | styleOptions 예시 |
| ------- | :----------------: | :------------------------------------------------------------: |
| | p class='p-impact' | {"p class='" : "color:red;"} |
| code | {code: "padding: 5px;"} |
>
- 아직 개발 초기 단계이기 때문에 버그가 있고, 지원하지 않는 마크다운 문법들이 다수 존재합니다.
Ver.English
$3
`shell
npm i austin-html-markdown-to-html
`
$3
`javascript
const mdToHtml = require("autin-html-markdown-to-html");
const resultHtml = mdToHtml("./something.md");
`
- The path of 'md' file that you will transfer starts at the path of package.json file
$3
`javascript
const mdToHtml = require("autin-html-markdown-to-html");
const resultHtml = mdToHtml("./something.md", { a: "color: red;" });
`
- You can add a custom style to transfered html tag by inserting styleOptions object.
| md Grammar | transfered tag name | example of styleOptions |
| ---------- | :-----------------: | :------------------------------------------------------------: |
| | p class='p-impact' | {"p class='" : "color:red;"} |